{
  "components": {
    "schemas": {
      "AcceptApplied": {
        "properties": {
          "asks": {
            "items": {
              "$ref": "#/components/schemas/Ask"
            },
            "type": "array"
          },
          "order_moved": {
            "description": "The record’s status changed because of this decision.",
            "type": "boolean"
          },
          "reply": {
            "description": "`posted`: the reply went out; or why it didn’t (`error`), the change being saved either way.",
            "properties": {
              "error": {
                "nullable": true,
                "type": "string"
              },
              "posted": {
                "type": "boolean"
              }
            },
            "required": ["posted"],
            "type": "object"
          },
          "version": {
            "description": "The record’s version after this decision (no `line`): send it back as `version` with the next decision on this record, or read the next request’s review for one with its line.",
            "nullable": true,
            "properties": {
              "edit_token": {
                "nullable": true,
                "type": "string"
              },
              "group_child": {
                "description": "A split order’s second part: send it back as `group_child`.",
                "nullable": true,
                "properties": {
                  "expected_edit_token": {
                    "nullable": true,
                    "type": "string"
                  },
                  "expected_updated_at": {
                    "type": "string"
                  }
                },
                "type": "object"
              },
              "line": {
                "nullable": true,
                "type": "string"
              },
              "updated_at": {
                "type": "string"
              }
            },
            "type": "object"
          }
        },
        "required": ["asks", "order_moved", "reply"],
        "type": "object"
      },
      "AcceptChanges": {
        "properties": {
          "ask_ids": {
            "description": "The `ask_ids` from the preview: every open change request, or the call is refused as stale.",
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "customer_user_id": {
            "description": "The customer the screen showed, so a change of customer is refused.",
            "nullable": true,
            "type": "string"
          },
          "expected_edit_token": {
            "description": "The `version.edit_token` from the review (`version` holds it).",
            "nullable": true,
            "type": "string"
          },
          "expected_updated_at": {
            "description": "The record’s `version.updated_at` from the review, when you don’t send `version`.",
            "type": "string"
          },
          "group_child": {
            "description": "A split order’s second part’s `version.group_child` from the review: `expected_updated_at`, `expected_edit_token` (`version` holds it).",
            "nullable": true,
            "type": "object"
          },
          "reply": {
            "description": "`{ text }`, sent to the customer.",
            "type": "object"
          },
          "version": {
            "description": "The `version` the review (or the preview, or the last decision) answered, sent back exactly as it is: no read needed first. A change since is refused (409) with the current `version` and what `changed`. Send this, or its fields one by one (`expected_updated_at` and the rest).",
            "type": "object"
          }
        },
        "required": ["ask_ids", "reply"],
        "type": "object"
      },
      "AcceptChangesPreview": {
        "properties": {
          "preview": {
            "description": "What the Accept changes dialog shows.",
            "properties": {
              "ask_ids": {
                "description": "Send these back as `ask_ids`: every open change request.",
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              "blocked_reason": {
                "description": "Why it can’t go, if so.",
                "nullable": true,
                "type": "string"
              },
              "customer_first_name": {
                "nullable": true,
                "type": "string"
              },
              "is_quote": {
                "type": "boolean"
              },
              "items": {
                "items": {
                  "properties": {
                    "ask_id": {
                      "type": "string"
                    },
                    "change": {
                      "description": "The change in words, for display.",
                      "type": "string"
                    },
                    "title": {
                      "type": "string"
                    }
                  },
                  "type": "object"
                },
                "type": "array"
              },
              "leaves_changes_requested": {
                "type": "boolean"
              },
              "reply": {
                "description": "The suggested reply.",
                "type": "string"
              },
              "sign_again": {
                "description": "The customer has to sign again afterwards.",
                "type": "boolean"
              },
              "version": {
                "description": "Send it back with Accept changes as `version`, exactly as it is. It stands for `expected_updated_at` (`updated_at`), `expected_edit_token` (`edit_token`) and `group_child`, which are still taken on their own.",
                "properties": {
                  "edit_token": {
                    "nullable": true,
                    "type": "string"
                  },
                  "group_child": {
                    "description": "A split order’s second part: send it back as `group_child`.",
                    "nullable": true,
                    "properties": {
                      "expected_edit_token": {
                        "nullable": true,
                        "type": "string"
                      },
                      "expected_updated_at": {
                        "type": "string"
                      }
                    },
                    "type": "object"
                  },
                  "updated_at": {
                    "type": "string"
                  }
                },
                "required": ["updated_at"],
                "type": "object"
              }
            },
            "required": ["ask_ids", "items", "reply", "version"],
            "type": "object"
          }
        },
        "required": ["preview"],
        "type": "object"
      },
      "ActivityEntry": {
        "properties": {
          "action": {
            "description": "What happened, in words.",
            "type": "string"
          },
          "actor": {
            "properties": {
              "name": {
                "type": "string"
              },
              "role": {
                "type": "string"
              }
            },
            "type": "object"
          },
          "comment": {
            "nullable": true,
            "type": "string"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "type": {
            "description": "The kind of entry, such as `comment`, `status_changed` or `updated`.",
            "enum": [
              "created",
              "updated",
              "status_changed",
              "comment",
              "order_reviewed",
              "purchase_order_act",
              "purchase_order_received",
              "order_marked_received",
              "order_marked_resolved",
              "serials_added",
              "serial_corrected",
              "serials_released",
              "warranty_coverage",
              "warranty_claim",
              "return"
            ],
            "type": "string"
          },
          "version": {
            "description": "The version of the record this entry produced, when it did.",
            "nullable": true,
            "type": "integer"
          }
        },
        "type": "object"
      },
      "ActivityList": {
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/ActivityEntry"
            },
            "type": "array"
          },
          "next_cursor": {
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "ActivityRestoreInput": {
        "properties": {
          "revision": {
            "description": "The version to go back to, as previewed (an entry’s `version`), with `token`, when you don’t send `version`.",
            "type": "integer"
          },
          "token": {
            "description": "The preview’s `token` for that `revision`.",
            "type": "string"
          },
          "version": {
            "description": "The restore preview’s `version`, sent back as it is: it holds the version to go back to and the preview’s token. A change made since is `409 CONFLICT` with the preview’s `version` now and what `changed`. Send this, or `revision` and `token`.",
            "type": "string"
          }
        },
        "type": "object"
      },
      "ActivityRestorePreview": {
        "properties": {
          "blocked_reason": {
            "description": "Why it can’t be restored, or not by this caller (with what is missing). Null when it can.",
            "nullable": true,
            "type": "string"
          },
          "revision": {
            "description": "The version it goes back to.",
            "type": "integer"
          },
          "revision_at": {
            "description": "When that version was made.",
            "format": "date-time",
            "type": "string"
          },
          "rows": {
            "description": "Each field the restore changes: as it is now, and as it will be.",
            "items": {
              "properties": {
                "current": {
                  "type": "string"
                },
                "label": {
                  "type": "string"
                },
                "restored": {
                  "type": "string"
                }
              },
              "type": "object"
            },
            "type": "array"
          },
          "token": {
            "description": "Send it with the restore: the restore is refused when the record changed since this preview. Null when `blocked_reason` is set.",
            "nullable": true,
            "type": "string"
          },
          "unchanged": {
            "description": "The record already is this version: restoring writes nothing.",
            "type": "boolean"
          },
          "version": {
            "description": "The restore’s `version`: the version it goes back to and `token` in one, sent back as it is (`version`). Null when `blocked_reason` is set.",
            "nullable": true,
            "type": "string"
          },
          "warnings": {
            "description": "What to know first: changes made outside the activity (which the restore undoes too), what it can’t bring back, costs left out.",
            "items": {
              "type": "string"
            },
            "type": "array"
          }
        },
        "type": "object"
      },
      "ActivityRestored": {
        "properties": {
          "restored": {
            "description": "True: the record was changed back. False: it already was that version.",
            "type": "boolean"
          },
          "revision": {
            "description": "The version it went back to.",
            "type": "integer"
          },
          "unchanged": {
            "description": "The record already was that version.",
            "type": "boolean"
          }
        },
        "type": "object"
      },
      "AddressInput": {
        "properties": {
          "address1": {
            "description": "Required to create.",
            "type": "string"
          },
          "address2": {
            "type": "string"
          },
          "city": {
            "type": "string"
          },
          "company": {
            "type": "string"
          },
          "country": {
            "type": "string"
          },
          "first_name": {
            "description": "The recipient on this address.",
            "type": "string"
          },
          "id": {
            "description": "PATCH only: the address to change (an `id` from `GET /customers/{id}/addresses`).",
            "type": "string"
          },
          "last_name": {
            "type": "string"
          },
          "phone": {
            "type": "string"
          },
          "province": {
            "type": "string"
          },
          "set_as_default": {
            "description": "POST only.",
            "type": "boolean"
          },
          "zip": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "AddressList": {
        "properties": {
          "items": {
            "items": {
              "properties": {
                "address1": {
                  "type": "string"
                },
                "address2": {
                  "nullable": true,
                  "type": "string"
                },
                "city": {
                  "nullable": true,
                  "type": "string"
                },
                "company": {
                  "nullable": true,
                  "type": "string"
                },
                "country": {
                  "nullable": true,
                  "type": "string"
                },
                "id": {
                  "description": "The Shopify address id: what `ship_to_address_id` takes.",
                  "type": "string"
                },
                "is_default": {
                  "type": "boolean"
                },
                "name": {
                  "nullable": true,
                  "type": "string"
                },
                "phone": {
                  "nullable": true,
                  "type": "string"
                },
                "province": {
                  "nullable": true,
                  "type": "string"
                },
                "zip": {
                  "nullable": true,
                  "type": "string"
                }
              },
              "type": "object"
            },
            "type": "array"
          }
        },
        "type": "object"
      },
      "Ask": {
        "description": "A customer’s question or change request: what it points at (`anchor_kind`, `line_id`, `definition_id`, `snapshot`), the change asked for (`requested_change`), where it stands (`status`, `outcome`) and the store’s offer, if any. Enum values are lowercase.",
        "properties": {
          "anchor_kind": {
            "enum": [
              "order",
              "line",
              "option",
              "quantity",
              "price",
              "fee",
              "discount",
              "deposit",
              "delivery"
            ],
            "type": "string"
          },
          "answered_by_staff": {
            "description": "The store has the latest word on this open item.",
            "type": "boolean"
          },
          "applied_offer": {
            "description": "An applied request the store made with the value it offered.",
            "nullable": true,
            "type": "string"
          },
          "author_name": {
            "nullable": true,
            "type": "string"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "definition_id": {
            "nullable": true,
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "kind": {
            "enum": ["question", "change_request"],
            "type": "string"
          },
          "latest_word": {
            "nullable": true,
            "properties": {
              "at": {
                "format": "date-time",
                "type": "string"
              },
              "by": {
                "enum": ["customer", "store"],
                "type": "string"
              },
              "staff_id": {
                "nullable": true,
                "type": "string"
              },
              "staff_name": {
                "nullable": true,
                "type": "string"
              }
            },
            "type": "object"
          },
          "line_id": {
            "description": "The live line it points at; null once that line was removed or rebuilt.",
            "nullable": true,
            "type": "string"
          },
          "message_id": {
            "description": "The conversation message that raised it.",
            "type": "string"
          },
          "offered": {
            "description": "An open change request where staff offered another value (it stays open until the customer agrees).",
            "nullable": true,
            "properties": {
              "at": {
                "format": "date-time",
                "type": "string"
              },
              "label": {
                "type": "string"
              }
            },
            "type": "object"
          },
          "outcome": {
            "description": "What became of a change request the store settled; null while open and on a question.",
            "enum": ["accepted", "modified", "declined", "closed", null],
            "nullable": true,
            "type": "string"
          },
          "outcome_value": {
            "nullable": true,
            "type": "string"
          },
          "replaced": {
            "description": "A later applied change on the same line and option replaced this one.",
            "type": "boolean"
          },
          "requested_change": {
            "description": "Change requests only. `kind` says which fields are filled: option (`definition_id`, `from_option_id`, `to_option_id`, `from_label`, `to_label`, `also`), value (`definition_id`, `label`, `field_type`, `from_value`, `to_value`, `unit`, `parts`), quantity (`from_quantity`, `to_quantity`) or other (`text`). The rest are null.",
            "nullable": true,
            "properties": {
              "also": {
                "description": "A value for each required option the new value shows.",
                "items": {
                  "properties": {
                    "definition_id": {
                      "type": "string"
                    },
                    "label": {
                      "type": "string"
                    },
                    "to_label": {
                      "type": "string"
                    },
                    "to_option_id": {
                      "type": "string"
                    }
                  },
                  "type": "object"
                },
                "type": "array"
              },
              "definition_id": {
                "nullable": true,
                "type": "string"
              },
              "field_type": {
                "enum": ["number", "text", "textarea", "dimensions", null],
                "nullable": true,
                "type": "string"
              },
              "from_label": {
                "nullable": true,
                "type": "string"
              },
              "from_option_id": {
                "nullable": true,
                "type": "string"
              },
              "from_quantity": {
                "nullable": true,
                "type": "integer"
              },
              "from_value": {
                "nullable": true,
                "type": "string"
              },
              "kind": {
                "enum": ["option", "value", "quantity", "other"],
                "type": "string"
              },
              "label": {
                "nullable": true,
                "type": "string"
              },
              "parts": {
                "items": {
                  "type": "string"
                },
                "nullable": true,
                "type": "array"
              },
              "price_delta": {
                "description": "The price change each, two decimals (negative for cheaper). Null when it isn’t priced.",
                "nullable": true,
                "type": "number"
              },
              "text": {
                "nullable": true,
                "type": "string"
              },
              "to_label": {
                "nullable": true,
                "type": "string"
              },
              "to_option_id": {
                "nullable": true,
                "type": "string"
              },
              "to_quantity": {
                "nullable": true,
                "type": "integer"
              },
              "to_value": {
                "nullable": true,
                "type": "string"
              },
              "unit": {
                "nullable": true,
                "type": "string"
              }
            },
            "required": ["kind"],
            "type": "object"
          },
          "resolved_at": {
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "resolved_by": {
            "enum": ["store", "customer", null],
            "nullable": true,
            "type": "string"
          },
          "resolved_by_name": {
            "nullable": true,
            "type": "string"
          },
          "resolved_by_staff_id": {
            "nullable": true,
            "type": "string"
          },
          "resolved_in_revision": {
            "nullable": true,
            "type": "integer"
          },
          "snapshot": {
            "description": "What it pointed at when it was asked.",
            "properties": {
              "amount_text": {
                "description": "A formatted amount, for display.",
                "nullable": true,
                "type": "string"
              },
              "fee_key": {
                "nullable": true,
                "type": "string"
              },
              "label": {
                "type": "string"
              },
              "line_title": {
                "nullable": true,
                "type": "string"
              },
              "revision": {
                "nullable": true,
                "type": "integer"
              },
              "swatch": {
                "nullable": true,
                "type": "string"
              },
              "value_label": {
                "nullable": true,
                "type": "string"
              }
            },
            "required": ["label"],
            "type": "object"
          },
          "status": {
            "enum": ["open", "applied", "resolved", "declined"],
            "type": "string"
          },
          "updated_at": {
            "format": "date-time",
            "type": "string"
          }
        },
        "required": [
          "id",
          "message_id",
          "kind",
          "status",
          "anchor_kind",
          "snapshot",
          "created_at",
          "updated_at"
        ],
        "type": "object"
      },
      "AskApplied": {
        "properties": {
          "ask": {
            "$ref": "#/components/schemas/Ask"
          },
          "order_moved": {
            "description": "The record’s status changed because of this decision.",
            "type": "boolean"
          },
          "outcome": {
            "description": "`applied`: the requested value is on the line; `offered`: another value, the request still open.",
            "enum": ["applied", "offered"],
            "type": "string"
          },
          "reply": {
            "description": "`posted`: the reply went out; or why it didn’t (`error`), the change being saved either way.",
            "properties": {
              "error": {
                "nullable": true,
                "type": "string"
              },
              "posted": {
                "type": "boolean"
              }
            },
            "required": ["posted"],
            "type": "object"
          },
          "version": {
            "description": "The record’s version after this decision (no `line`): send it back as `version` with the next decision on this record, or read the next request’s review for one with its line.",
            "nullable": true,
            "properties": {
              "edit_token": {
                "nullable": true,
                "type": "string"
              },
              "group_child": {
                "description": "A split order’s second part: send it back as `group_child`.",
                "nullable": true,
                "properties": {
                  "expected_edit_token": {
                    "nullable": true,
                    "type": "string"
                  },
                  "expected_updated_at": {
                    "type": "string"
                  }
                },
                "type": "object"
              },
              "line": {
                "nullable": true,
                "type": "string"
              },
              "updated_at": {
                "type": "string"
              }
            },
            "type": "object"
          }
        },
        "required": ["ask", "outcome", "order_moved", "reply"],
        "type": "object"
      },
      "AskApply": {
        "properties": {
          "customer_user_id": {
            "description": "The customer the screen showed, so a change of customer is refused.",
            "nullable": true,
            "type": "string"
          },
          "expected_edit_token": {
            "description": "The `version.edit_token` from the review (`version` holds it).",
            "nullable": true,
            "type": "string"
          },
          "expected_line": {
            "description": "The `version.line` from the review (`version` holds it).",
            "nullable": true,
            "type": "string"
          },
          "expected_updated_at": {
            "description": "The record’s `version.updated_at` from the review, when you don’t send `version`.",
            "type": "string"
          },
          "group_child": {
            "description": "A split order’s second part’s `version.group_child` from the review: `expected_updated_at`, `expected_edit_token` (`version` holds it).",
            "nullable": true,
            "type": "object"
          },
          "reply": {
            "description": "`{ text }`, sent to the customer, quoting their message. Required when the value isn’t the one asked for (null is no reply).",
            "nullable": true,
            "type": "object"
          },
          "value": {
            "description": "One of: `{ option_id, also? }` (a value of the option, with a value for each required option it shows: `also` is a list of `{ definition_id, option_id }`), `{ field_value }` (a typed value) or `{ quantity }`.",
            "type": "object"
          },
          "version": {
            "description": "The `version` the review (or the preview, or the last decision) answered, sent back exactly as it is: no read needed first. A change since is refused (409) with the current `version` and what `changed`. Send this, or its fields one by one (`expected_updated_at` and the rest).",
            "type": "object"
          }
        },
        "required": ["value", "reply"],
        "type": "object"
      },
      "AskDecided": {
        "properties": {
          "ask": {
            "$ref": "#/components/schemas/Ask"
          },
          "changed": {
            "description": "False when the item was already in the state asked for.",
            "type": "boolean"
          },
          "order_moved": {
            "description": "The record’s status changed because of this decision.",
            "type": "boolean"
          }
        },
        "required": ["ask", "order_moved", "changed"],
        "type": "object"
      },
      "AskDecision": {
        "properties": {
          "action": {
            "description": "Lowercase; the upper-case spelling is accepted too.",
            "enum": ["resolve", "decline", "apply", "reopen", "accept"],
            "type": "string"
          }
        },
        "required": ["action"],
        "type": "object"
      },
      "AskList": {
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/Ask"
            },
            "type": "array"
          },
          "to_do": {
            "description": "Items waiting on the store.",
            "type": "integer"
          },
          "waiting": {
            "description": "Items waiting on the customer.",
            "type": "integer"
          }
        },
        "required": ["items", "to_do", "waiting"],
        "type": "object"
      },
      "AskReview": {
        "properties": {
          "review": {
            "description": "What the review drawer shows. `change.kind` says which of `change`’s fields are filled (option: `option_label`, `requested_option_id`, `tiles`, `display_style`, `required`, `value_count`; value: `option_label`, `rules`, `from_value`, `requested_value`, `unit_price`, `asked_parts`, `parts_changed`; quantity: `from_quantity`, `requested_quantity`). Send `version` back with the decision.",
            "properties": {
              "apply_blocked_reason": {
                "description": "Why Confirm change can’t be used now, if so.",
                "nullable": true,
                "type": "string"
              },
              "apply_in_editor": {
                "description": "The change goes through the record’s editor, not from here.",
                "type": "boolean"
              },
              "ask": {
                "$ref": "#/components/schemas/Ask"
              },
              "change": {
                "nullable": true,
                "properties": {
                  "asked_parts": {
                    "items": {
                      "type": "string"
                    },
                    "nullable": true,
                    "type": "array"
                  },
                  "display_style": {
                    "enum": ["list", "swatch", null],
                    "nullable": true,
                    "type": "string"
                  },
                  "from_quantity": {
                    "nullable": true,
                    "type": "integer"
                  },
                  "from_value": {
                    "nullable": true,
                    "type": "string"
                  },
                  "kind": {
                    "enum": ["option", "value", "quantity"],
                    "type": "string"
                  },
                  "option_label": {
                    "nullable": true,
                    "type": "string"
                  },
                  "parts_changed": {
                    "nullable": true,
                    "type": "boolean"
                  },
                  "requested_option_id": {
                    "nullable": true,
                    "type": "string"
                  },
                  "requested_quantity": {
                    "nullable": true,
                    "type": "integer"
                  },
                  "requested_value": {
                    "nullable": true,
                    "type": "string"
                  },
                  "required": {
                    "nullable": true,
                    "type": "boolean"
                  },
                  "rules": {
                    "nullable": true,
                    "properties": {
                      "dimension_parts": {
                        "items": {
                          "properties": {
                            "key": {
                              "type": "string"
                            },
                            "label": {
                              "type": "string"
                            },
                            "max": {
                              "nullable": true,
                              "type": "number"
                            },
                            "min": {
                              "nullable": true,
                              "type": "number"
                            },
                            "step": {
                              "nullable": true,
                              "type": "number"
                            }
                          },
                          "type": "object"
                        },
                        "type": "array"
                      },
                      "field_type": {
                        "enum": ["number", "text", "textarea", "dimensions"],
                        "type": "string"
                      },
                      "max_length": {
                        "nullable": true,
                        "type": "integer"
                      },
                      "number_max": {
                        "nullable": true,
                        "type": "number"
                      },
                      "number_min": {
                        "nullable": true,
                        "type": "number"
                      },
                      "number_step": {
                        "nullable": true,
                        "type": "number"
                      },
                      "unit": {
                        "nullable": true,
                        "type": "string"
                      }
                    },
                    "type": "object"
                  },
                  "tiles": {
                    "items": {
                      "properties": {
                        "available": {
                          "description": "It can go on the line.",
                          "type": "boolean"
                        },
                        "blocked_reason": {
                          "description": "Why it can’t go on the line.",
                          "nullable": true,
                          "type": "string"
                        },
                        "current": {
                          "description": "The line holds this value now.",
                          "type": "boolean"
                        },
                        "description": {
                          "nullable": true,
                          "type": "string"
                        },
                        "held_back": {
                          "nullable": true,
                          "type": "string"
                        },
                        "image_url": {
                          "nullable": true,
                          "type": "string"
                        },
                        "label": {
                          "type": "string"
                        },
                        "option_id": {
                          "type": "string"
                        },
                        "price_delta": {
                          "description": "The price change each, two decimals. Null: priced by hand.",
                          "nullable": true,
                          "type": "number"
                        },
                        "requested": {
                          "description": "The customer asked for this value.",
                          "type": "boolean"
                        },
                        "requires": {
                          "description": "Options this value needs a choice for.",
                          "items": {
                            "properties": {
                              "asked": {
                                "nullable": true,
                                "type": "string"
                              },
                              "definition_id": {
                                "type": "string"
                              },
                              "label": {
                                "type": "string"
                              },
                              "values": {
                                "items": {
                                  "properties": {
                                    "label": {
                                      "type": "string"
                                    },
                                    "option_id": {
                                      "type": "string"
                                    },
                                    "price_delta": {
                                      "nullable": true,
                                      "type": "number"
                                    }
                                  },
                                  "type": "object"
                                },
                                "type": "array"
                              }
                            },
                            "type": "object"
                          },
                          "type": "array"
                        },
                        "swatch": {
                          "nullable": true,
                          "type": "string"
                        }
                      },
                      "type": "object"
                    },
                    "type": "array"
                  },
                  "unit_price": {
                    "nullable": true,
                    "type": "number"
                  },
                  "value_count": {
                    "nullable": true,
                    "type": "integer"
                  }
                },
                "required": ["kind"],
                "type": "object"
              },
              "change_blocked_reason": {
                "description": "Why no other value can be applied now, if so.",
                "nullable": true,
                "type": "string"
              },
              "currency": {
                "nullable": true,
                "type": "string"
              },
              "customer_name": {
                "nullable": true,
                "type": "string"
              },
              "is_quote": {
                "type": "boolean"
              },
              "line": {
                "nullable": true,
                "properties": {
                  "id": {
                    "type": "string"
                  },
                  "image": {
                    "nullable": true,
                    "type": "string"
                  },
                  "options": {
                    "items": {
                      "properties": {
                        "definition_id": {
                          "type": "string"
                        },
                        "label": {
                          "type": "string"
                        },
                        "value": {
                          "type": "string"
                        }
                      },
                      "type": "object"
                    },
                    "type": "array"
                  },
                  "quantity": {
                    "type": "integer"
                  },
                  "title": {
                    "type": "string"
                  },
                  "unit_price": {
                    "type": "number"
                  }
                },
                "type": "object"
              },
              "message": {
                "description": "The customer’s message that raised the request.",
                "nullable": true,
                "properties": {
                  "author_name": {
                    "nullable": true,
                    "type": "string"
                  },
                  "id": {
                    "type": "string"
                  },
                  "occurred_at": {
                    "format": "date-time",
                    "type": "string"
                  },
                  "text": {
                    "type": "string"
                  },
                  "via": {
                    "enum": ["portal", "email"],
                    "type": "string"
                  }
                },
                "type": "object"
              },
              "money": {
                "description": "The money the app’s preview works from, the same whatever the person’s role; null when the item points at no line.",
                "nullable": true,
                "properties": {
                  "currency": {
                    "type": "string"
                  },
                  "customer_abroad": {
                    "type": "boolean"
                  },
                  "deposit": {
                    "nullable": true,
                    "properties": {
                      "base": {
                        "type": "number"
                      },
                      "percent": {
                        "type": "number"
                      }
                    },
                    "type": "object"
                  },
                  "discount": {
                    "properties": {
                      "applied": {
                        "type": "boolean"
                      },
                      "description": {
                        "nullable": true,
                        "type": "string"
                      },
                      "type": {
                        "enum": ["fixed_amount", "percentage", null],
                        "nullable": true,
                        "type": "string"
                      },
                      "value": {
                        "nullable": true,
                        "type": "number"
                      }
                    },
                    "type": "object"
                  },
                  "estimate": {
                    "type": "boolean"
                  },
                  "manual_price": {
                    "type": "boolean"
                  },
                  "quantity": {
                    "type": "integer"
                  },
                  "total": {
                    "type": "number"
                  },
                  "unit_price": {
                    "type": "number"
                  }
                },
                "type": "object"
              },
              "order_id": {
                "type": "string"
              },
              "prices_hidden": {
                "description": "The quote is still being priced, so the customer sees no prices yet. It says nothing about the person’s role: staff always get `money`.",
                "type": "boolean"
              },
              "record_label": {
                "description": "“#1001”, “#D12”.",
                "type": "string"
              },
              "signed": {
                "description": "The customer has signed the record.",
                "type": "boolean"
              },
              "version": {
                "description": "Send it back with the decision as `version`, exactly as it is (no read needed between decisions: a decision answers the new one). It stands for `expected_updated_at` (`updated_at`), `expected_edit_token` (`edit_token`), `expected_line` (`line`) and `group_child`, which are still taken on their own.",
                "properties": {
                  "edit_token": {
                    "nullable": true,
                    "type": "string"
                  },
                  "group_child": {
                    "description": "A split order’s second part: send it back as `group_child`.",
                    "nullable": true,
                    "properties": {
                      "expected_edit_token": {
                        "nullable": true,
                        "type": "string"
                      },
                      "expected_updated_at": {
                        "type": "string"
                      }
                    },
                    "type": "object"
                  },
                  "line": {
                    "nullable": true,
                    "type": "string"
                  },
                  "updated_at": {
                    "type": "string"
                  }
                },
                "required": ["updated_at"],
                "type": "object"
              }
            },
            "required": [
              "ask",
              "order_id",
              "is_quote",
              "record_label",
              "prices_hidden",
              "signed",
              "version",
              "apply_in_editor"
            ],
            "type": "object"
          }
        },
        "required": ["review"],
        "type": "object"
      },
      "Attention": {
        "properties": {
          "attention": {
            "description": "Null when there is no verdict yet.",
            "nullable": true,
            "properties": {
              "active": {
                "description": "The record needs attention.",
                "type": "boolean"
              },
              "follow_up": {
                "description": "The suggested follow-up.",
                "nullable": true,
                "properties": {
                  "action": {
                    "nullable": true,
                    "properties": {
                      "label": {
                        "type": "string"
                      },
                      "url": {
                        "type": "string"
                      }
                    },
                    "type": "object"
                  },
                  "body": {
                    "type": "string"
                  },
                  "dialog_title": {
                    "type": "string"
                  },
                  "hint": {
                    "type": "string"
                  },
                  "label": {
                    "type": "string"
                  },
                  "purchase_order_id": {
                    "nullable": true,
                    "type": "string"
                  },
                  "subject": {
                    "type": "string"
                  },
                  "to_label": {
                    "type": "string"
                  },
                  "via": {
                    "enum": [
                      "reply_order",
                      "reply_po",
                      "remind_staff",
                      "contact",
                      "review"
                    ],
                    "type": "string"
                  }
                },
                "type": "object"
              },
              "kind": {
                "enum": [
                  "our_step",
                  "work_in_progress",
                  "follow_up",
                  "status_limit",
                  "money_owed",
                  "sync_problem",
                  null
                ],
                "nullable": true,
                "type": "string"
              },
              "party": {
                "description": "Who it is waiting on.",
                "enum": [
                  "us",
                  "customer",
                  "vendor",
                  "carrier",
                  "teammate",
                  "app",
                  null
                ],
                "nullable": true,
                "type": "string"
              },
              "reason": {
                "nullable": true,
                "properties": {
                  "detail": {
                    "type": "string"
                  },
                  "due_at": {
                    "format": "date-time",
                    "nullable": true,
                    "type": "string"
                  },
                  "follow_up_days": {
                    "nullable": true,
                    "type": "integer"
                  },
                  "label": {
                    "type": "string"
                  },
                  "party_name": {
                    "nullable": true,
                    "type": "string"
                  },
                  "ref_id": {
                    "nullable": true,
                    "type": "string"
                  },
                  "ref_label": {
                    "nullable": true,
                    "type": "string"
                  },
                  "ref_type": {
                    "enum": [
                      "order_email",
                      "purchase_order",
                      "review",
                      "payment_terms",
                      "shipment",
                      "quote_expiry",
                      "change_request",
                      null
                    ],
                    "nullable": true,
                    "type": "string"
                  },
                  "sent_at": {
                    "format": "date-time",
                    "nullable": true,
                    "type": "string"
                  },
                  "title": {
                    "type": "string"
                  }
                },
                "type": "object"
              },
              "since": {
                "format": "date-time",
                "nullable": true,
                "type": "string"
              }
            },
            "required": ["active"],
            "type": "object"
          }
        },
        "required": ["attention"],
        "type": "object"
      },
      "AttentionAction": {
        "properties": {
          "action": {
            "description": "`ignore` hides it for a few days. `followed_up` marks the wait followed up (the order must still be waiting on someone). `follow_up_sent` records a follow-up that went out; `via` says how.",
            "enum": ["ignore", "followed_up", "follow_up_sent"],
            "type": "string"
          },
          "message": {
            "description": "`follow_up_sent` with `remind_staff` only. The team reminder’s text, up to 1,000 characters; the default wording is used when left out.",
            "type": "string"
          },
          "note": {
            "description": "`followed_up` only. An optional note for Activity, up to 500 characters.",
            "type": "string"
          },
          "via": {
            "description": "`follow_up_sent` only, required. How it went out: `reply_order` or `reply_po` (a reply already sent), `remind_staff` (the server emails the team), `contact` or `review`.",
            "enum": [
              "reply_order",
              "reply_po",
              "remind_staff",
              "contact",
              "review"
            ],
            "type": "string"
          }
        },
        "required": ["action"],
        "type": "object"
      },
      "BarcodeMatches": {
        "properties": {
          "matches": {
            "items": {
              "properties": {
                "product": {
                  "properties": {
                    "id": {
                      "description": "Shopify product id.",
                      "type": "string"
                    },
                    "image": {
                      "nullable": true,
                      "type": "string"
                    },
                    "title": {
                      "type": "string"
                    },
                    "vendor": {
                      "type": "string"
                    }
                  },
                  "type": "object"
                },
                "variant": {
                  "properties": {
                    "barcode": {
                      "type": "string"
                    },
                    "id": {
                      "description": "Shopify variant id.",
                      "type": "string"
                    },
                    "image": {
                      "nullable": true,
                      "type": "string"
                    },
                    "inventory_quantity": {
                      "nullable": true,
                      "type": "integer"
                    },
                    "price": {
                      "description": "In the store’s currency, two decimals.",
                      "type": "number"
                    },
                    "sku": {
                      "type": "string"
                    },
                    "title": {
                      "type": "string"
                    }
                  },
                  "type": "object"
                }
              },
              "type": "object"
            },
            "type": "array"
          }
        },
        "type": "object"
      },
      "Brand": {
        "properties": {
          "brand_color": {
            "description": "#RRGGBB, or null for the store’s colour.",
            "nullable": true,
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "image_url": {
            "nullable": true,
            "type": "string"
          },
          "locations": {
            "items": {
              "$ref": "#/components/schemas/BrandLocation"
            },
            "type": "array"
          },
          "name": {
            "type": "string"
          },
          "sort_order": {
            "type": "integer"
          }
        },
        "required": [
          "id",
          "name",
          "image_url",
          "brand_color",
          "sort_order",
          "locations"
        ],
        "type": "object"
      },
      "BrandCreate": {
        "properties": {
          "name": {
            "description": "Up to 255 characters.",
            "type": "string"
          }
        },
        "required": ["name"],
        "type": "object"
      },
      "BrandDeleted": {
        "properties": {
          "deleted": {
            "type": "boolean"
          },
          "id": {
            "type": "string"
          }
        },
        "required": ["id", "deleted"],
        "type": "object"
      },
      "BrandImageCleaned": {
        "properties": {
          "ok": {
            "type": "boolean"
          }
        },
        "type": "object"
      },
      "BrandImageCleanup": {
        "properties": {
          "file_id": {
            "description": "The upload’s `file_id`.",
            "type": "string"
          },
          "upload_token": {
            "description": "The upload’s `upload_token`.",
            "type": "string"
          }
        },
        "required": ["file_id", "upload_token"],
        "type": "object"
      },
      "BrandImageFromUrl": {
        "properties": {
          "url": {
            "description": "Where the image is: a public https address (up to 2,048 characters). Up to three redirects are followed. A key fetches at most 50 files from web addresses a day, each counted before it is fetched (`403 CAP_EXCEEDED`, `reason` `daily_url_fetches`).",
            "type": "string"
          }
        },
        "required": ["url"],
        "type": "object"
      },
      "BrandImageSet": {
        "properties": {
          "image_file_id": {
            "description": "The upload’s `file_id`, or null to clear.",
            "nullable": true,
            "type": "string"
          },
          "image_url": {
            "description": "The upload’s `url` (a Shopify Files URL: https://cdn.shopify.com/s/files/… or https://<shop>.myshopify.com/cdn/shop/…), or null to clear. Other hosts are refused.",
            "nullable": true,
            "type": "string"
          },
          "upload_token": {
            "description": "The upload’s `upload_token`. Required whenever `image_file_id` is not null (`400 INVALID_UPLOAD_TOKEN`).",
            "type": "string"
          }
        },
        "type": "object"
      },
      "BrandImageUploaded": {
        "properties": {
          "file_id": {
            "description": "The Shopify file id, to set on a brand or to clean up.",
            "type": "string"
          },
          "pending": {
            "description": "Shopify is still processing the file.",
            "type": "boolean"
          },
          "upload_token": {
            "description": "Proof this API uploaded the file for this store (24 h): send it with `file_id` to set the image or clean it up.",
            "type": "string"
          },
          "url": {
            "description": "The image’s https URL; null while `pending`.",
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "BrandList": {
        "description": "A small bounded lookup, so not paged.",
        "properties": {
          "brands": {
            "items": {
              "$ref": "#/components/schemas/Brand"
            },
            "type": "array"
          },
          "unassigned_locations": {
            "items": {
              "$ref": "#/components/schemas/BrandLocation"
            },
            "type": "array"
          }
        },
        "required": ["brands", "unassigned_locations"],
        "type": "object"
      },
      "BrandLocation": {
        "properties": {
          "active": {
            "type": "boolean"
          },
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "shopify_location_id": {
            "type": "string"
          },
          "sort_order": {
            "type": "integer"
          }
        },
        "required": [
          "id",
          "shopify_location_id",
          "name",
          "active",
          "sort_order"
        ],
        "type": "object"
      },
      "BrandLocationsReorder": {
        "properties": {
          "brand_id": {
            "description": "The brand, or null for the unassigned locations.",
            "nullable": true,
            "type": "string"
          },
          "ordered_ids": {
            "description": "Location ids (`id` from `GET /brands`), in order.",
            "items": {
              "type": "string"
            },
            "type": "array"
          }
        },
        "required": ["ordered_ids"],
        "type": "object"
      },
      "BrandUpdate": {
        "properties": {
          "brand_color": {
            "description": "#RRGGBB, or null or empty for the store’s colour.",
            "nullable": true,
            "type": "string"
          },
          "name": {
            "description": "Up to 255 characters.",
            "type": "string"
          }
        },
        "type": "object"
      },
      "BrandsReorder": {
        "properties": {
          "ordered_ids": {
            "items": {
              "type": "string"
            },
            "type": "array"
          }
        },
        "required": ["ordered_ids"],
        "type": "object"
      },
      "Bundle": {
        "properties": {
          "changed_template_count": {
            "description": "Of those, the ones that changed something it set.",
            "type": "integer"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "description": {
            "nullable": true,
            "type": "string"
          },
          "followers": {
            "description": "The templates following it, oldest first.",
            "items": {
              "properties": {
                "attached_at": {
                  "format": "date-time",
                  "type": "string"
                },
                "changed": {
                  "description": "It changed something the bundle set.",
                  "type": "boolean"
                },
                "status": {
                  "enum": ["active", "draft"],
                  "type": "string"
                },
                "template_id": {
                  "type": "string"
                },
                "title": {
                  "type": "string"
                }
              },
              "type": "object"
            },
            "type": "array"
          },
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "options": {
            "items": {
              "properties": {
                "disabled": {
                  "description": "Turned off in the library.",
                  "type": "boolean"
                },
                "field_id": {
                  "description": "The option’s `id` in the library.",
                  "type": "string"
                },
                "label": {
                  "type": "string"
                },
                "name": {
                  "type": "string"
                },
                "offered_option_ids": {
                  "description": "Null: every value.",
                  "items": {
                    "type": "string"
                  },
                  "nullable": true,
                  "type": "array"
                },
                "required": {
                  "description": "Null: the option’s own.",
                  "nullable": true,
                  "type": "boolean"
                },
                "shown_when": {
                  "description": "Shown only when another option of the bundle (`field_id`) is set to one of `option_ids` (null: to anything).",
                  "nullable": true,
                  "properties": {
                    "field_id": {
                      "type": "string"
                    },
                    "option_ids": {
                      "items": {
                        "type": "string"
                      },
                      "nullable": true,
                      "type": "array"
                    }
                  },
                  "type": "object"
                },
                "sort_order": {
                  "type": "integer"
                },
                "type": {
                  "enum": [
                    "text",
                    "number",
                    "dropdown",
                    "textarea",
                    "text_image",
                    "dimensions"
                  ],
                  "type": "string"
                },
                "value_rules": {
                  "items": {
                    "properties": {
                      "option_id": {
                        "type": "string"
                      },
                      "shown_when": {
                        "description": "Shown only when another option of the bundle (`field_id`) is set to one of `option_ids` (null: to anything).",
                        "nullable": true,
                        "properties": {
                          "field_id": {
                            "type": "string"
                          },
                          "option_ids": {
                            "items": {
                              "type": "string"
                            },
                            "nullable": true,
                            "type": "array"
                          }
                        },
                        "type": "object"
                      }
                    },
                    "type": "object"
                  },
                  "type": "array"
                },
                "values": {
                  "description": "The option’s values, as the bundle editor lists them (no prices).",
                  "items": {
                    "properties": {
                      "label": {
                        "nullable": true,
                        "type": "string"
                      },
                      "option_id": {
                        "type": "string"
                      },
                      "swatch_color": {
                        "nullable": true,
                        "type": "string"
                      },
                      "value": {
                        "type": "string"
                      }
                    },
                    "type": "object"
                  },
                  "type": "array"
                }
              },
              "type": "object"
            },
            "type": "array"
          },
          "rule_count": {
            "type": "integer"
          },
          "template_count": {
            "description": "Templates following it.",
            "type": "integer"
          },
          "updated_at": {
            "description": "What `version` checks (sent alone as `expected_updated_at`, as before).",
            "format": "date-time",
            "type": "string"
          },
          "version": {
            "description": "Send it back as `version` to rename it or reorder its options.",
            "type": "string"
          }
        },
        "type": "object"
      },
      "BundleCreate": {
        "properties": {
          "description": {
            "description": "Up to 2,000 characters.",
            "nullable": true,
            "type": "string"
          },
          "name": {
            "description": "Unique in the store, up to 120 characters.",
            "type": "string"
          },
          "options": {
            "description": "Its options in order (up to 100).",
            "items": {
              "properties": {
                "field_id": {
                  "description": "An option’s `id` from `GET /options`.",
                  "type": "string"
                },
                "offered_option_ids": {
                  "description": "The values following templates offer, by `option_id` (`GET /options/{id}`); `null`: all of them; `[]`: none.",
                  "items": {
                    "type": "string"
                  },
                  "nullable": true,
                  "type": "array"
                },
                "required": {
                  "description": "The bundle’s own; `null`: the option’s.",
                  "nullable": true,
                  "type": "boolean"
                },
                "shown_when": {
                  "description": "Show it only when another option of the bundle (`field_id`: an `options[].field_id` of `GET /bundles/{id}`, a dropdown above it) is set to one of `option_ids` (that option’s values; null: to anything). `null`: always shown.",
                  "nullable": true,
                  "properties": {
                    "field_id": {
                      "type": "string"
                    },
                    "option_ids": {
                      "items": {
                        "type": "string"
                      },
                      "nullable": true,
                      "type": "array"
                    }
                  },
                  "type": "object"
                },
                "value_rules": {
                  "description": "Per value, when it is shown (up to 200): `[{ option_id, shown_when }]`. `null` clears them all.",
                  "items": {
                    "properties": {
                      "option_id": {
                        "description": "A value of this option: a `values[].option_id` of `GET /options/{id}`.",
                        "type": "string"
                      },
                      "shown_when": {
                        "description": "Show it only when another option of the bundle (`field_id`: an `options[].field_id` of `GET /bundles/{id}`, a dropdown above it) is set to one of `option_ids` (that option’s values; null: to anything). `null`: always shown.",
                        "nullable": true,
                        "properties": {
                          "field_id": {
                            "type": "string"
                          },
                          "option_ids": {
                            "items": {
                              "type": "string"
                            },
                            "nullable": true,
                            "type": "array"
                          }
                        },
                        "type": "object"
                      }
                    },
                    "required": ["option_id", "shown_when"],
                    "type": "object"
                  },
                  "nullable": true,
                  "type": "array"
                }
              },
              "required": ["field_id"],
              "type": "object"
            },
            "type": "array"
          }
        },
        "required": ["name"],
        "type": "object"
      },
      "BundleDeleted": {
        "properties": {
          "deleted": {
            "type": "boolean"
          },
          "id": {
            "type": "string"
          },
          "removed": {
            "description": "What following templates kept and lost.",
            "properties": {
              "deleted": {
                "description": "Options taken off templates.",
                "type": "integer"
              },
              "reassigned": {
                "description": "Options kept, now another bundle’s.",
                "type": "integer"
              },
              "severed": {
                "description": "Options kept as the templates’ own.",
                "type": "integer"
              }
            },
            "type": "object"
          }
        },
        "type": "object"
      },
      "BundleEdit": {
        "properties": {
          "description": {
            "nullable": true,
            "type": "string"
          },
          "expected_updated_at": {
            "description": "The bundle’s `updated_at` from `GET /bundles/{id}`, when you don’t send `version`.",
            "type": "string"
          },
          "name": {
            "description": "Unique in the store, up to 120 characters.",
            "type": "string"
          },
          "order": {
            "description": "Its options top to bottom, by `field_id`; any left out keep their order after them.",
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "version": {
            "description": "The `version` of `GET /bundles/{id}` (or the last change) answered, sent back as it is: no read needed first. A change made since is `409 STALE_VERSION` with the current `version` and what `changed`. Send this or `expected_updated_at`.",
            "type": "string"
          }
        },
        "type": "object"
      },
      "BundleList": {
        "properties": {
          "items": {
            "items": {
              "properties": {
                "changed_template_count": {
                  "description": "Of those, the ones that changed something it set.",
                  "type": "integer"
                },
                "created_at": {
                  "format": "date-time",
                  "type": "string"
                },
                "description": {
                  "nullable": true,
                  "type": "string"
                },
                "id": {
                  "type": "string"
                },
                "name": {
                  "type": "string"
                },
                "options": {
                  "description": "Its options in order.",
                  "items": {
                    "properties": {
                      "field_id": {
                        "type": "string"
                      },
                      "name": {
                        "type": "string"
                      },
                      "required": {
                        "nullable": true,
                        "type": "boolean"
                      }
                    },
                    "type": "object"
                  },
                  "type": "array"
                },
                "rule_count": {
                  "type": "integer"
                },
                "template_count": {
                  "description": "Templates following it.",
                  "type": "integer"
                },
                "updated_at": {
                  "description": "What `version` checks (sent alone as `expected_updated_at`, as before).",
                  "format": "date-time",
                  "type": "string"
                }
              },
              "type": "object"
            },
            "type": "array"
          },
          "next_cursor": {
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "BundleOptionAdd": {
        "properties": {
          "field_id": {
            "description": "An option’s `id` from `GET /options`.",
            "type": "string"
          },
          "offered_option_ids": {
            "description": "The values following templates offer, by `option_id` (`GET /options/{id}`); `null`: all of them; `[]`: none.",
            "items": {
              "type": "string"
            },
            "nullable": true,
            "type": "array"
          },
          "required": {
            "description": "The bundle’s own; `null`: the option’s.",
            "nullable": true,
            "type": "boolean"
          },
          "shown_when": {
            "description": "Show it only when another option of the bundle (`field_id`: an `options[].field_id` of `GET /bundles/{id}`, a dropdown above it) is set to one of `option_ids` (that option’s values; null: to anything). `null`: always shown.",
            "nullable": true,
            "properties": {
              "field_id": {
                "type": "string"
              },
              "option_ids": {
                "items": {
                  "type": "string"
                },
                "nullable": true,
                "type": "array"
              }
            },
            "type": "object"
          },
          "value_rules": {
            "description": "Per value, when it is shown (up to 200): `[{ option_id, shown_when }]`. `null` clears them all.",
            "items": {
              "properties": {
                "option_id": {
                  "description": "A value of this option: a `values[].option_id` of `GET /options/{id}`.",
                  "type": "string"
                },
                "shown_when": {
                  "description": "Show it only when another option of the bundle (`field_id`: an `options[].field_id` of `GET /bundles/{id}`, a dropdown above it) is set to one of `option_ids` (that option’s values; null: to anything). `null`: always shown.",
                  "nullable": true,
                  "properties": {
                    "field_id": {
                      "type": "string"
                    },
                    "option_ids": {
                      "items": {
                        "type": "string"
                      },
                      "nullable": true,
                      "type": "array"
                    }
                  },
                  "type": "object"
                }
              },
              "required": ["option_id", "shown_when"],
              "type": "object"
            },
            "nullable": true,
            "type": "array"
          }
        },
        "required": ["field_id"],
        "type": "object"
      },
      "BundleOptionEdit": {
        "properties": {
          "offered_option_ids": {
            "description": "The values following templates offer, by `option_id` (`GET /options/{id}`); `null`: all of them; `[]`: none.",
            "items": {
              "type": "string"
            },
            "nullable": true,
            "type": "array"
          },
          "required": {
            "description": "The bundle’s own; `null`: the option’s.",
            "nullable": true,
            "type": "boolean"
          },
          "shown_when": {
            "description": "Show it only when another option of the bundle (`field_id`: an `options[].field_id` of `GET /bundles/{id}`, a dropdown above it) is set to one of `option_ids` (that option’s values; null: to anything). `null`: always shown.",
            "nullable": true,
            "properties": {
              "field_id": {
                "type": "string"
              },
              "option_ids": {
                "items": {
                  "type": "string"
                },
                "nullable": true,
                "type": "array"
              }
            },
            "type": "object"
          },
          "value_rules": {
            "description": "Per value, when it is shown (up to 200): `[{ option_id, shown_when }]`. `null` clears them all.",
            "items": {
              "properties": {
                "option_id": {
                  "description": "A value of this option: a `values[].option_id` of `GET /options/{id}`.",
                  "type": "string"
                },
                "shown_when": {
                  "description": "Show it only when another option of the bundle (`field_id`: an `options[].field_id` of `GET /bundles/{id}`, a dropdown above it) is set to one of `option_ids` (that option’s values; null: to anything). `null`: always shown.",
                  "nullable": true,
                  "properties": {
                    "field_id": {
                      "type": "string"
                    },
                    "option_ids": {
                      "items": {
                        "type": "string"
                      },
                      "nullable": true,
                      "type": "array"
                    }
                  },
                  "type": "object"
                }
              },
              "required": ["option_id", "shown_when"],
              "type": "object"
            },
            "nullable": true,
            "type": "array"
          }
        },
        "type": "object"
      },
      "BundleOptionRemoved": {
        "properties": {
          "bundle": {
            "$ref": "#/components/schemas/Bundle"
          },
          "removed": {
            "description": "What following templates kept and lost.",
            "properties": {
              "deleted": {
                "description": "Options taken off templates.",
                "type": "integer"
              },
              "reassigned": {
                "description": "Options kept, now another bundle’s.",
                "type": "integer"
              },
              "severed": {
                "description": "Options kept as the templates’ own.",
                "type": "integer"
              }
            },
            "type": "object"
          }
        },
        "type": "object"
      },
      "Category": {
        "properties": {
          "additional_terms_html": {
            "description": "Terms printed once on a document under this category’s heading, listing the items they apply to (sanitized HTML). Null when the category adds none.",
            "nullable": true,
            "type": "string"
          },
          "color": {
            "description": "A hex colour, `#1f2a44`.",
            "type": "string"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "deposit_devices": {
            "description": "Where the rule counts: `both`, the `admin` only or the `pos` only (set in Settings › Quotes and orders › Defaults).",
            "enum": ["both", "admin", "pos"],
            "type": "string"
          },
          "description": {
            "description": "Empty when there is none.",
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "label": {
            "description": "The full name from the top, as the pickers show it: “Game Room › Pool Tables”. A template’s Shopify product type is its category’s label.",
            "type": "string"
          },
          "level": {
            "description": "1 at the top, at most 3.",
            "type": "integer"
          },
          "name": {
            "type": "string"
          },
          "parent_id": {
            "description": "Null at the top.",
            "nullable": true,
            "type": "string"
          },
          "required_deposit_percent": {
            "description": "…and at least this deposit, a percentage of the subtotal (0–100). Null or 0: none.",
            "nullable": true,
            "type": "number"
          },
          "requires_signature": {
            "description": "Orders with a product in this category need the customer’s signature before they become Shopify orders (unless the product sets its own).",
            "type": "boolean"
          },
          "signature_devices": {
            "description": "Where the rule counts: `both`, the `admin` only or the `pos` only (set in Settings › Quotes and orders › Defaults).",
            "enum": ["both", "admin", "pos"],
            "type": "string"
          },
          "slug": {
            "description": "The category’s key in the store (unique), as a purchase order’s new-product line takes it in `category_slug`.",
            "type": "string"
          },
          "updated_at": {
            "format": "date-time",
            "type": "string"
          }
        },
        "type": "object"
      },
      "CategoryCreate": {
        "properties": {
          "additional_terms_html": {
            "description": "Terms printed on documents with a product in this category (HTML, sanitized as the editor’s). Null or empty: none.",
            "nullable": true,
            "type": "string"
          },
          "color": {
            "description": "A hex colour, `#1f2a44` or `#fff` (default black).",
            "type": "string"
          },
          "description": {
            "description": "Up to 5,000 characters.",
            "type": "string"
          },
          "name": {
            "description": "Up to 255 characters, unique among the categories under the same parent.",
            "type": "string"
          },
          "parent_id": {
            "description": "The category to put it under, from `GET /categories` (it must be at level 1 or 2).",
            "nullable": true,
            "type": "string"
          },
          "required_deposit_percent": {
            "description": "The deposit needed first, 0–100 (two decimals). Null: none.",
            "nullable": true,
            "type": "number"
          },
          "requires_signature": {
            "description": "Orders with a product in it need the customer’s signature first.",
            "type": "boolean"
          }
        },
        "required": ["name"],
        "type": "object"
      },
      "CategoryDeleted": {
        "properties": {
          "deleted": {
            "type": "boolean"
          },
          "id": {
            "type": "string"
          }
        },
        "required": ["id", "deleted"],
        "type": "object"
      },
      "CategoryEdit": {
        "properties": {
          "additional_terms_html": {
            "description": "Terms printed on documents with a product in this category (HTML, sanitized as the editor’s). Null or empty: none.",
            "nullable": true,
            "type": "string"
          },
          "color": {
            "description": "A hex colour, `#1f2a44` or `#fff` (default black).",
            "type": "string"
          },
          "description": {
            "description": "Up to 5,000 characters.",
            "type": "string"
          },
          "name": {
            "description": "Up to 255 characters, unique among the categories under the same parent.",
            "type": "string"
          },
          "parent_id": {
            "description": "The category to put it under, from `GET /categories` (it must be at level 1 or 2).",
            "nullable": true,
            "type": "string"
          },
          "required_deposit_percent": {
            "description": "The deposit needed first, 0–100 (two decimals). Null: none.",
            "nullable": true,
            "type": "number"
          },
          "requires_signature": {
            "description": "Orders with a product in it need the customer’s signature first.",
            "type": "boolean"
          }
        },
        "type": "object"
      },
      "CategoryList": {
        "properties": {
          "items": {
            "items": {
              "properties": {
                "additional_terms_html": {
                  "description": "Terms printed once on a document under this category’s heading, listing the items they apply to (sanitized HTML). Null when the category adds none.",
                  "nullable": true,
                  "type": "string"
                },
                "color": {
                  "description": "A hex colour, `#1f2a44`.",
                  "type": "string"
                },
                "created_at": {
                  "format": "date-time",
                  "type": "string"
                },
                "deposit_devices": {
                  "description": "Where the rule counts: `both`, the `admin` only or the `pos` only (set in Settings › Quotes and orders › Defaults).",
                  "enum": ["both", "admin", "pos"],
                  "type": "string"
                },
                "description": {
                  "description": "Empty when there is none.",
                  "type": "string"
                },
                "id": {
                  "type": "string"
                },
                "label": {
                  "description": "The full name from the top, as the pickers show it: “Game Room › Pool Tables”. A template’s Shopify product type is its category’s label.",
                  "type": "string"
                },
                "level": {
                  "description": "1 at the top, at most 3.",
                  "type": "integer"
                },
                "name": {
                  "type": "string"
                },
                "parent_id": {
                  "description": "Null at the top.",
                  "nullable": true,
                  "type": "string"
                },
                "required_deposit_percent": {
                  "description": "…and at least this deposit, a percentage of the subtotal (0–100). Null or 0: none.",
                  "nullable": true,
                  "type": "number"
                },
                "requires_signature": {
                  "description": "Orders with a product in this category need the customer’s signature before they become Shopify orders (unless the product sets its own).",
                  "type": "boolean"
                },
                "signature_devices": {
                  "description": "Where the rule counts: `both`, the `admin` only or the `pos` only (set in Settings › Quotes and orders › Defaults).",
                  "enum": ["both", "admin", "pos"],
                  "type": "string"
                },
                "slug": {
                  "description": "The category’s key in the store (unique), as a purchase order’s new-product line takes it in `category_slug`.",
                  "type": "string"
                },
                "updated_at": {
                  "format": "date-time",
                  "type": "string"
                }
              },
              "type": "object"
            },
            "type": "array"
          },
          "next_cursor": {
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "CommentCreate": {
        "properties": {
          "text": {
            "description": "The comment, 1–2000 characters.",
            "type": "string"
          }
        },
        "required": ["text"],
        "type": "object"
      },
      "CommentDeleted": {
        "properties": {
          "deleted": {
            "description": "Always true.",
            "type": "boolean"
          },
          "id": {
            "description": "The deleted comment’s id.",
            "type": "string"
          }
        },
        "type": "object"
      },
      "CompanyList": {
        "properties": {
          "items": {
            "items": {
              "properties": {
                "id": {
                  "type": "string"
                },
                "name": {
                  "type": "string"
                }
              },
              "type": "object"
            },
            "type": "array"
          }
        },
        "type": "object"
      },
      "ConversationAssign": {
        "properties": {
          "staff_id": {
            "description": "A staff id from `GET /conversations/assignees`, or null to unassign.",
            "nullable": true,
            "type": "string"
          }
        },
        "required": ["staff_id"],
        "type": "object"
      },
      "ConversationAssigned": {
        "properties": {
          "assignee_id": {
            "nullable": true,
            "type": "string"
          },
          "changed": {
            "type": "boolean"
          },
          "id": {
            "type": "string"
          }
        },
        "required": ["id", "assignee_id", "changed"],
        "type": "object"
      },
      "ConversationAssignees": {
        "properties": {
          "items": {
            "items": {
              "properties": {
                "answers_customers": {
                  "type": "boolean"
                },
                "answers_vendors": {
                  "type": "boolean"
                },
                "id": {
                  "type": "string"
                },
                "name": {
                  "type": "string"
                }
              },
              "type": "object"
            },
            "type": "array"
          }
        },
        "required": ["items"],
        "type": "object"
      },
      "ConversationAttachment": {
        "properties": {
          "content_type": {
            "type": "string"
          },
          "file_name": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "kind": {
            "enum": ["image", "pdf", "file"],
            "type": "string"
          },
          "size_bytes": {
            "type": "integer"
          }
        },
        "type": "object"
      },
      "ConversationAttachmentDiscarded": {
        "properties": {
          "discarded": {
            "type": "boolean"
          },
          "id": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "ConversationAttachmentUrl": {
        "properties": {
          "filename": {
            "type": "string"
          },
          "url": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "ConversationDetail": {
        "description": "The Inbox’s right panel: `kind` says which of `customer` + `order` or `vendor` + `purchase_order` is filled (the others are null). `thread` holds the messages and notes. Money is in the record’s currency; figures a role without View costs may not see are null.",
        "properties": {
          "conversation": {
            "description": "The conversation’s state; null before the first message.",
            "nullable": true,
            "properties": {
              "assignee": {
                "nullable": true,
                "properties": {
                  "id": {
                    "type": "string"
                  },
                  "name": {
                    "type": "string"
                  }
                },
                "type": "object"
              },
              "first_unanswered_inbound_at": {
                "format": "date-time",
                "nullable": true,
                "type": "string"
              },
              "id": {
                "type": "string"
              },
              "needs_reply": {
                "type": "boolean"
              },
              "overdue_hours": {
                "nullable": true,
                "type": "integer"
              },
              "status": {
                "description": "`waiting` is the app’s Waiting.",
                "enum": ["open", "waiting", "closed"],
                "type": "string"
              }
            },
            "type": "object"
          },
          "customer": {
            "nullable": true,
            "properties": {
              "company": {
                "nullable": true,
                "type": "string"
              },
              "email": {
                "nullable": true,
                "type": "string"
              },
              "id": {
                "description": "OrderPilot’s id for the customer: what a reply’s `customer_id` takes, and `GET /customers/{id}`.",
                "nullable": true,
                "type": "string"
              },
              "location": {
                "nullable": true,
                "type": "string"
              },
              "name": {
                "type": "string"
              },
              "phone": {
                "nullable": true,
                "type": "string"
              },
              "recent_orders": {
                "items": {
                  "properties": {
                    "created_at": {
                      "format": "date-time",
                      "type": "string"
                    },
                    "id": {
                      "type": "string"
                    },
                    "is_quote": {
                      "type": "boolean"
                    },
                    "number": {
                      "type": "string"
                    },
                    "total": {
                      "type": "number"
                    }
                  },
                  "type": "object"
                },
                "type": "array"
              },
              "shopify_customer_id": {
                "nullable": true,
                "type": "string"
              },
              "since_year": {
                "nullable": true,
                "type": "integer"
              },
              "stats": {
                "properties": {
                  "conversations": {
                    "type": "integer"
                  },
                  "currency": {
                    "type": "string"
                  },
                  "orders": {
                    "type": "integer"
                  },
                  "spent": {
                    "type": "number"
                  }
                },
                "type": "object"
              }
            },
            "type": "object"
          },
          "kind": {
            "enum": ["order", "po"],
            "type": "string"
          },
          "order": {
            "nullable": true,
            "properties": {
              "cancelled": {
                "type": "boolean"
              },
              "change_refusal": {
                "description": "Why this person can’t change the order (outside their role’s scope), or null.",
                "nullable": true,
                "type": "string"
              },
              "created_at": {
                "format": "date-time",
                "type": "string"
              },
              "currency": {
                "type": "string"
              },
              "expiry": {
                "description": "A quote’s expiry; null on an order.",
                "nullable": true,
                "properties": {
                  "alert": {
                    "type": "boolean"
                  },
                  "at": {
                    "format": "date-time",
                    "type": "string"
                  },
                  "blocks_customer": {
                    "type": "boolean"
                  },
                  "day": {
                    "description": "The last valid day, YYYY-MM-DD in the shop’s time zone.",
                    "type": "string"
                  },
                  "days_left": {
                    "type": "integer"
                  },
                  "expired": {
                    "type": "boolean"
                  },
                  "open": {
                    "type": "boolean"
                  },
                  "pending": {
                    "description": "No date yet: it starts at the first send.",
                    "type": "boolean"
                  },
                  "signed": {
                    "type": "boolean"
                  },
                  "stored": {
                    "type": "boolean"
                  },
                  "valid_for_days": {
                    "type": "integer"
                  }
                },
                "type": "object"
              },
              "financial_status": {
                "description": "Lowercase, e.g. `paid`, `partially_paid`.",
                "type": "string"
              },
              "fulfillment_status": {
                "description": "Lowercase, e.g. `fulfilled`.",
                "nullable": true,
                "type": "string"
              },
              "id": {
                "type": "string"
              },
              "is_quote": {
                "type": "boolean"
              },
              "lines": {
                "items": {
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "image": {
                      "nullable": true,
                      "type": "string"
                    },
                    "options": {
                      "description": "An order line’s options; empty on a purchase order line.",
                      "items": {
                        "properties": {
                          "definition_id": {
                            "type": "string"
                          },
                          "label": {
                            "type": "string"
                          },
                          "swatch": {
                            "nullable": true,
                            "type": "string"
                          },
                          "value": {
                            "type": "string"
                          }
                        },
                        "type": "object"
                      },
                      "type": "array"
                    },
                    "quantity": {
                      "type": "integer"
                    },
                    "title": {
                      "type": "string"
                    },
                    "unit_price": {
                      "description": "Null when the person may not see it (a purchase order’s costs without View costs).",
                      "nullable": true,
                      "type": "number"
                    },
                    "variant": {
                      "nullable": true,
                      "type": "string"
                    }
                  },
                  "type": "object"
                },
                "type": "array"
              },
              "more_lines": {
                "description": "Lines not listed.",
                "type": "integer"
              },
              "number": {
                "type": "string"
              },
              "paid": {
                "type": "number"
              },
              "real_shopify_order": {
                "type": "boolean"
              },
              "remaining": {
                "type": "number"
              },
              "sent": {
                "description": "When it last went to the customer, and which version.",
                "properties": {
                  "latest_revision": {
                    "type": "integer"
                  },
                  "sent_at": {
                    "format": "date-time",
                    "nullable": true,
                    "type": "string"
                  },
                  "sent_revision": {
                    "nullable": true,
                    "type": "integer"
                  }
                },
                "type": "object"
              },
              "shopify_draft_pending": {
                "type": "boolean"
              },
              "signed": {
                "type": "boolean"
              },
              "status": {
                "description": "The status’s name, as the store set it up.",
                "nullable": true,
                "type": "string"
              },
              "status_color": {
                "nullable": true,
                "type": "string"
              },
              "summary": {
                "description": "The money rows under the lines. `amount_text` and `total_text` are formatted for display; use `total` above for arithmetic.",
                "properties": {
                  "deposit": {
                    "nullable": true,
                    "properties": {
                      "amount": {
                        "type": "number"
                      },
                      "paid": {
                        "type": "boolean"
                      },
                      "percent": {
                        "type": "number"
                      }
                    },
                    "type": "object"
                  },
                  "discount": {
                    "nullable": true,
                    "properties": {
                      "amount_text": {
                        "type": "string"
                      },
                      "label": {
                        "type": "string"
                      }
                    },
                    "type": "object"
                  },
                  "fees": {
                    "items": {
                      "properties": {
                        "amount_text": {
                          "type": "string"
                        },
                        "key": {
                          "type": "string"
                        },
                        "label": {
                          "type": "string"
                        }
                      },
                      "type": "object"
                    },
                    "type": "array"
                  },
                  "shipping": {
                    "nullable": true,
                    "properties": {
                      "amount_text": {
                        "type": "string"
                      },
                      "label": {
                        "type": "string"
                      }
                    },
                    "type": "object"
                  },
                  "total_text": {
                    "type": "string"
                  }
                },
                "type": "object"
              },
              "sync_failed": {
                "type": "boolean"
              },
              "syncing": {
                "type": "boolean"
              },
              "time_zone": {
                "description": "The shop’s IANA time zone.",
                "type": "string"
              },
              "total": {
                "type": "number"
              }
            },
            "type": "object"
          },
          "purchase_order": {
            "nullable": true,
            "properties": {
              "created_at": {
                "format": "date-time",
                "type": "string"
              },
              "id": {
                "type": "string"
              },
              "lines": {
                "items": {
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "image": {
                      "nullable": true,
                      "type": "string"
                    },
                    "options": {
                      "description": "An order line’s options; empty on a purchase order line.",
                      "items": {
                        "properties": {
                          "definition_id": {
                            "type": "string"
                          },
                          "label": {
                            "type": "string"
                          },
                          "swatch": {
                            "nullable": true,
                            "type": "string"
                          },
                          "value": {
                            "type": "string"
                          }
                        },
                        "type": "object"
                      },
                      "type": "array"
                    },
                    "quantity": {
                      "type": "integer"
                    },
                    "title": {
                      "type": "string"
                    },
                    "unit_price": {
                      "description": "Null when the person may not see it (a purchase order’s costs without View costs).",
                      "nullable": true,
                      "type": "number"
                    },
                    "variant": {
                      "nullable": true,
                      "type": "string"
                    }
                  },
                  "type": "object"
                },
                "type": "array"
              },
              "more_lines": {
                "type": "integer"
              },
              "number": {
                "type": "string"
              },
              "status": {
                "description": "Lowercase.",
                "type": "string"
              },
              "total": {
                "description": "Null without View costs.",
                "nullable": true,
                "type": "number"
              }
            },
            "type": "object"
          },
          "thread": {
            "description": "The conversation’s messages (the newest, oldest first), internal notes and reply state.",
            "properties": {
              "earlier_sends": {
                "type": "boolean"
              },
              "kind": {
                "enum": ["order", "po"],
                "type": "string"
              },
              "messages": {
                "items": {
                  "properties": {
                    "ask": {
                      "allOf": [
                        {
                          "$ref": "#/components/schemas/Ask"
                        }
                      ],
                      "description": "The question or change request this customer message raised.",
                      "nullable": true
                    },
                    "attachments": {
                      "items": {
                        "properties": {
                          "available": {
                            "description": "False when the bytes were not stored.",
                            "type": "boolean"
                          },
                          "content_type": {
                            "type": "string"
                          },
                          "file_name": {
                            "type": "string"
                          },
                          "id": {
                            "description": "What `GET /conversations/{key}/messages/{messageId}/attachments/{attachmentId}` takes.",
                            "type": "string"
                          },
                          "preview_url": {
                            "description": "A short-lived signed link for a photo’s thumbnail; null for other files.",
                            "nullable": true,
                            "type": "string"
                          },
                          "size_bytes": {
                            "type": "integer"
                          }
                        },
                        "type": "object"
                      },
                      "type": "array"
                    },
                    "author_name": {
                      "description": "Portal messages: who wrote it.",
                      "nullable": true,
                      "type": "string"
                    },
                    "body_truncated": {
                      "type": "boolean"
                    },
                    "cc_emails": {
                      "items": {
                        "type": "string"
                      },
                      "type": "array"
                    },
                    "channel": {
                      "enum": ["email", "portal"],
                      "type": "string"
                    },
                    "delivery_status": {
                      "description": "Our sends: the strongest thing the recipient’s mail service reported.",
                      "enum": [
                        "clicked",
                        "opened",
                        "bounced",
                        "delivered",
                        "sent",
                        "uncertain",
                        "scheduled",
                        "sending",
                        "failed",
                        "cancelled",
                        null
                      ],
                      "nullable": true,
                      "type": "string"
                    },
                    "direction": {
                      "enum": ["inbound", "outbound"],
                      "type": "string"
                    },
                    "from_email": {
                      "type": "string"
                    },
                    "from_name": {
                      "nullable": true,
                      "type": "string"
                    },
                    "has_html": {
                      "type": "boolean"
                    },
                    "id": {
                      "type": "string"
                    },
                    "occurred_at": {
                      "format": "date-time",
                      "type": "string"
                    },
                    "portal_visible": {
                      "type": "boolean"
                    },
                    "quoted": {
                      "nullable": true,
                      "properties": {
                        "author_name": {
                          "nullable": true,
                          "type": "string"
                        },
                        "excerpt": {
                          "type": "string"
                        },
                        "id": {
                          "type": "string"
                        }
                      },
                      "type": "object"
                    },
                    "quoted_text": {
                      "nullable": true,
                      "type": "string"
                    },
                    "quoted_text_omitted": {
                      "type": "boolean"
                    },
                    "sender_at_vendor_domain": {
                      "description": "Purchase orders: not on file, but at the vendor’s own domain.",
                      "type": "boolean"
                    },
                    "sender_matches_contact": {
                      "description": "Inbound: the sender is the contact on file; true for ours.",
                      "type": "boolean"
                    },
                    "sender_verified": {
                      "description": "Inbound: the reply passed sender authentication; true for ours.",
                      "type": "boolean"
                    },
                    "subject": {
                      "type": "string"
                    },
                    "to_emails": {
                      "items": {
                        "type": "string"
                      },
                      "type": "array"
                    },
                    "visible_text": {
                      "description": "What the sender wrote, with quoted history split off.",
                      "type": "string"
                    },
                    "visible_text_cut": {
                      "description": "An older long email, cut short in this read.",
                      "type": "boolean"
                    }
                  },
                  "type": "object"
                },
                "type": "array"
              },
              "notes": {
                "items": {
                  "properties": {
                    "author_name": {
                      "nullable": true,
                      "type": "string"
                    },
                    "body": {
                      "type": "string"
                    },
                    "created_at": {
                      "format": "date-time",
                      "type": "string"
                    },
                    "id": {
                      "type": "string"
                    }
                  },
                  "type": "object"
                },
                "type": "array"
              },
              "older_count": {
                "description": "Earlier emails on the record that are not in `messages`.",
                "type": "integer"
              },
              "replies_active": {
                "type": "boolean"
              },
              "reply_disabled_reason": {
                "description": "Null when the reply box can be used; otherwise the blocker and the next step.",
                "nullable": true,
                "type": "string"
              },
              "version": {
                "description": "Changes when anything in the conversation does.",
                "nullable": true,
                "type": "string"
              }
            },
            "required": [
              "kind",
              "messages",
              "older_count",
              "replies_active",
              "notes"
            ],
            "type": "object"
          },
          "vendor": {
            "nullable": true,
            "properties": {
              "contact": {
                "nullable": true,
                "type": "string"
              },
              "email": {
                "nullable": true,
                "type": "string"
              },
              "location": {
                "nullable": true,
                "type": "string"
              },
              "name": {
                "type": "string"
              },
              "phone": {
                "nullable": true,
                "type": "string"
              },
              "stats": {
                "properties": {
                  "conversations": {
                    "type": "integer"
                  },
                  "purchase_orders": {
                    "type": "integer"
                  },
                  "spend": {
                    "description": "Null without View costs.",
                    "nullable": true,
                    "type": "number"
                  }
                },
                "type": "object"
              }
            },
            "type": "object"
          }
        },
        "required": ["kind", "thread"],
        "type": "object"
      },
      "ConversationList": {
        "properties": {
          "counts": {
            "description": "With `counts=true`: each tab’s count (capped at 1,000).",
            "nullable": true,
            "properties": {
              "all": {
                "type": "integer"
              },
              "closed": {
                "type": "integer"
              },
              "mine": {
                "type": "integer"
              },
              "needs_reply": {
                "type": "integer"
              },
              "open": {
                "type": "integer"
              },
              "unassigned": {
                "type": "integer"
              },
              "waiting": {
                "type": "integer"
              }
            },
            "type": "object"
          },
          "items": {
            "items": {
              "properties": {
                "assignee": {
                  "nullable": true,
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    }
                  },
                  "type": "object"
                },
                "contact_email": {
                  "nullable": true,
                  "type": "string"
                },
                "contact_name": {
                  "type": "string"
                },
                "conversation_id": {
                  "description": "The conversation’s own id; status and assign take it too.",
                  "type": "string"
                },
                "first_unanswered_inbound_at": {
                  "format": "date-time",
                  "nullable": true,
                  "type": "string"
                },
                "from_stranger": {
                  "description": "The newest email is from someone not on file.",
                  "type": "boolean"
                },
                "from_vendor_domain": {
                  "type": "boolean"
                },
                "key": {
                  "description": "`order:<id>` or `po:<id>`: what `GET /conversations/{key}` takes.",
                  "type": "string"
                },
                "last_activity_at": {
                  "format": "date-time",
                  "type": "string"
                },
                "last_channel": {
                  "description": "Where the newest message was written.",
                  "enum": ["email", "portal", null],
                  "nullable": true,
                  "type": "string"
                },
                "last_direction": {
                  "enum": ["inbound", "outbound", null],
                  "nullable": true,
                  "type": "string"
                },
                "needs_reply": {
                  "type": "boolean"
                },
                "number": {
                  "description": "“#1001”, “#D12” or “PO-0012”.",
                  "type": "string"
                },
                "overdue_hours": {
                  "description": "Whole hours past the reply time goal.",
                  "nullable": true,
                  "type": "integer"
                },
                "preview": {
                  "description": "About 120 characters of the newest message.",
                  "type": "string"
                },
                "record_id": {
                  "type": "string"
                },
                "status": {
                  "description": "`waiting` is the app’s Waiting.",
                  "enum": ["open", "waiting", "closed"],
                  "type": "string"
                },
                "subject": {
                  "type": "string"
                },
                "to_do": {
                  "description": "Open items waiting on the store.",
                  "type": "integer"
                },
                "type": {
                  "enum": ["order", "quote", "po"],
                  "type": "string"
                },
                "unread": {
                  "description": "Replies new to this person.",
                  "type": "integer"
                },
                "waiting": {
                  "description": "Open items waiting on the customer.",
                  "type": "integer"
                }
              },
              "required": [
                "key",
                "conversation_id",
                "type",
                "record_id",
                "number",
                "contact_name",
                "subject",
                "preview",
                "last_activity_at",
                "unread",
                "needs_reply",
                "status",
                "to_do",
                "waiting"
              ],
              "type": "object"
            },
            "type": "array"
          },
          "next_cursor": {
            "description": "Opaque: pass it back as `cursor` for the next page; null on the last page.",
            "nullable": true,
            "type": "string"
          },
          "reply_goal_hours": {
            "type": "integer"
          }
        },
        "required": ["items", "next_cursor", "reply_goal_hours"],
        "type": "object"
      },
      "ConversationNote": {
        "properties": {
          "author_name": {
            "nullable": true,
            "type": "string"
          },
          "body": {
            "type": "string"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "id": {
            "type": "string"
          }
        },
        "required": ["id", "body", "created_at"],
        "type": "object"
      },
      "ConversationNoteCreate": {
        "properties": {
          "body": {
            "description": "Up to 5,000 characters.",
            "type": "string"
          }
        },
        "required": ["body"],
        "type": "object"
      },
      "ConversationReplied": {
        "properties": {
          "channel": {
            "enum": ["portal", "email"],
            "type": "string"
          },
          "duplicate": {
            "description": "True when this was a retry of a reply already stored.",
            "type": "boolean"
          },
          "message_id": {
            "description": "Portal: the stored message. Email: null (it is queued).",
            "nullable": true,
            "type": "string"
          },
          "queued": {
            "description": "True when the reply is queued as an email.",
            "type": "boolean"
          }
        },
        "type": "object"
      },
      "ConversationReply": {
        "properties": {
          "attachment_ids": {
            "description": "Portal only: up to 5 upload ids from POST /conversations/{key}/attachments, each once.",
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "channel": {
            "description": "A customer: `portal` (the default while the portal is on) or `email`. A vendor: `email`.",
            "enum": ["portal", "email"],
            "type": "string"
          },
          "customer_id": {
            "description": "Portal: the order’s customer as you read it, the conversation’s `customer.id` (`GET /conversations/{key}`); refused if the customer changed since.",
            "nullable": true,
            "type": "string"
          },
          "message_id": {
            "description": "Email: the message answered (default: the newest one the app would answer). Portal: the message quoted (`quoted_message_id` is the same).",
            "type": "string"
          },
          "quoted_message_id": {
            "description": "Portal: the message this reply quotes.",
            "type": "string"
          },
          "reply_to": {
            "description": "Email: a Reply-To address, as the app allows.",
            "type": "string"
          },
          "text": {
            "description": "The reply. Portal: up to 4,000 characters, and may be empty when files are attached. Email: required.",
            "type": "string"
          }
        },
        "type": "object"
      },
      "ConversationSeen": {
        "properties": {
          "recorded": {
            "description": "False when nothing could be recorded (for example the person has no staff record).",
            "type": "boolean"
          }
        },
        "required": ["recorded"],
        "type": "object"
      },
      "ConversationSeenBody": {
        "properties": {
          "shown_message_ids": {
            "description": "The newest messages the screen showed (at most the last 200 count). Left out: seen up to now.",
            "items": {
              "type": "string"
            },
            "type": "array"
          }
        },
        "type": "object"
      },
      "ConversationStatus": {
        "properties": {
          "status": {
            "description": "Any case is accepted; answers are lowercase.",
            "enum": ["open", "waiting", "closed"],
            "type": "string"
          }
        },
        "required": ["status"],
        "type": "object"
      },
      "ConversationStatusChanged": {
        "properties": {
          "changed": {
            "type": "boolean"
          },
          "id": {
            "type": "string"
          },
          "status": {
            "description": "`waiting` is the app’s Waiting.",
            "enum": ["open", "waiting", "closed"],
            "type": "string"
          }
        },
        "required": ["id", "status", "changed"],
        "type": "object"
      },
      "ConversationUnread": {
        "properties": {
          "at": {
            "format": "date-time",
            "type": "string"
          },
          "unread": {
            "type": "integer"
          }
        },
        "required": ["unread", "at"],
        "type": "object"
      },
      "CountryList": {
        "properties": {
          "items": {
            "items": {
              "properties": {
                "code": {
                  "description": "Shopify’s country code, such as `US`.",
                  "type": "string"
                },
                "name": {
                  "type": "string"
                },
                "provinces": {
                  "description": "The provinces or states to pick from (Canada and the United States); null where it is typed.",
                  "items": {
                    "properties": {
                      "code": {
                        "type": "string"
                      },
                      "name": {
                        "type": "string"
                      }
                    },
                    "type": "object"
                  },
                  "nullable": true,
                  "type": "array"
                }
              },
              "type": "object"
            },
            "type": "array"
          }
        },
        "type": "object"
      },
      "CustomFieldList": {
        "properties": {
          "items": {
            "items": {
              "properties": {
                "id": {
                  "type": "string"
                },
                "label": {
                  "type": "string"
                },
                "name": {
                  "type": "string"
                },
                "number_max": {
                  "nullable": true,
                  "type": "number"
                },
                "number_min": {
                  "nullable": true,
                  "type": "number"
                },
                "options": {
                  "items": {
                    "properties": {
                      "id": {
                        "type": "string"
                      },
                      "label": {
                        "type": "string"
                      },
                      "value": {
                        "type": "string"
                      }
                    },
                    "type": "object"
                  },
                  "type": "array"
                },
                "required": {
                  "type": "boolean"
                },
                "supported": {
                  "description": "Whether the API sets it: true for every field, each as the admin’s order page sets it (a size as text, a text-and-image field’s picture in `image_url`).",
                  "type": "boolean"
                },
                "type": {
                  "enum": [
                    "multi_line_text_field",
                    "single_line_text_field",
                    "list_single_line_text_field",
                    "text",
                    "number",
                    "dropdown",
                    "textarea",
                    "file",
                    "text_image",
                    "dimensions"
                  ],
                  "type": "string"
                }
              },
              "type": "object"
            },
            "type": "array"
          }
        },
        "type": "object"
      },
      "Customer": {
        "properties": {
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "email": {
            "nullable": true,
            "type": "string"
          },
          "first_name": {
            "nullable": true,
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "last_name": {
            "nullable": true,
            "type": "string"
          },
          "phone": {
            "nullable": true,
            "type": "string"
          },
          "shopify_id": {
            "nullable": true,
            "type": "string"
          },
          "updated_at": {
            "format": "date-time",
            "type": "string"
          }
        },
        "required": [
          "id",
          "first_name",
          "last_name",
          "email",
          "phone",
          "shopify_id",
          "created_at",
          "updated_at"
        ],
        "type": "object"
      },
      "CustomerCreate": {
        "properties": {
          "address": {
            "description": "Optional. Needs address1.",
            "properties": {
              "address1": {
                "type": "string"
              },
              "address2": {
                "type": "string"
              },
              "city": {
                "type": "string"
              },
              "country": {
                "type": "string"
              },
              "province": {
                "type": "string"
              },
              "zip": {
                "type": "string"
              }
            },
            "type": "object"
          },
          "company": {
            "type": "string"
          },
          "email": {
            "description": "Email or phone is required.",
            "type": "string"
          },
          "first_name": {
            "type": "string"
          },
          "last_name": {
            "type": "string"
          },
          "phone": {
            "description": "Email or phone is required.",
            "type": "string"
          }
        },
        "type": "object"
      },
      "CustomerDataExportLink": {
        "properties": {
          "bytes": {
            "nullable": true,
            "type": "integer"
          },
          "expires_at": {
            "format": "date-time",
            "type": "string"
          },
          "file_name": {
            "type": "string"
          },
          "request_id": {
            "type": "string"
          },
          "url": {
            "description": "Downloads the file through the API with no key sent: bound to the key that asked, once, within a minute.",
            "type": "string"
          }
        },
        "type": "object"
      },
      "CustomerDataFile": {
        "description": "A customer’s data, as JSON.",
        "format": "binary",
        "type": "string"
      },
      "CustomerDataRequest": {
        "properties": {
          "customer": {
            "description": "Who asked: their name and email while OrderPilot still holds them.",
            "type": "string"
          },
          "downloaded_at": {
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "export_ready_until": {
            "description": "While `ready`: when the file is deleted.",
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "export_state": {
            "description": "`none` (never prepared, or the ready file was deleted after 7 days), `preparing`, `ready`, `failed` (prepare it again).",
            "enum": ["none", "preparing", "ready", "failed"],
            "type": "string"
          },
          "id": {
            "description": "What `GET /customer-data-requests/{id}/export` takes.",
            "type": "string"
          },
          "order_count": {
            "description": "The orders Shopify listed with the request.",
            "type": "integer"
          },
          "requested_at": {
            "format": "date-time",
            "type": "string"
          }
        },
        "type": "object"
      },
      "CustomerDataRequestList": {
        "properties": {
          "items": {
            "items": {
              "properties": {
                "customer": {
                  "description": "Who asked: their name and email while OrderPilot still holds them.",
                  "type": "string"
                },
                "downloaded_at": {
                  "format": "date-time",
                  "nullable": true,
                  "type": "string"
                },
                "export_ready_until": {
                  "description": "While `ready`: when the file is deleted.",
                  "format": "date-time",
                  "nullable": true,
                  "type": "string"
                },
                "export_state": {
                  "description": "`none` (never prepared, or the ready file was deleted after 7 days), `preparing`, `ready`, `failed` (prepare it again).",
                  "enum": ["none", "preparing", "ready", "failed"],
                  "type": "string"
                },
                "id": {
                  "description": "What `GET /customer-data-requests/{id}/export` takes.",
                  "type": "string"
                },
                "order_count": {
                  "description": "The orders Shopify listed with the request.",
                  "type": "integer"
                },
                "requested_at": {
                  "format": "date-time",
                  "type": "string"
                }
              },
              "type": "object"
            },
            "type": "array"
          }
        },
        "type": "object"
      },
      "CustomerDocumentList": {
        "properties": {
          "counts": {
            "description": "How many quotes, sales orders and drafts the caller can see. First page only, for a caller who reads both quotes and orders; null otherwise.",
            "nullable": true,
            "properties": {
              "drafts": {
                "type": "integer"
              },
              "quotes": {
                "type": "integer"
              },
              "sales_orders": {
                "type": "integer"
              }
            },
            "type": "object"
          },
          "items": {
            "items": {
              "properties": {
                "balance_due": {
                  "description": "What is still owed on a sales order; null for the others.",
                  "nullable": true,
                  "type": "number"
                },
                "created_at": {
                  "format": "date-time",
                  "type": "string"
                },
                "currency": {
                  "type": "string"
                },
                "id": {
                  "description": "OrderPilot’s id (for `GET /quotes/{id}` or `GET /orders/{id}`), or for a Shopify order Shopify’s.",
                  "type": "string"
                },
                "is_quote": {
                  "description": "A quote (a draft can be either).",
                  "type": "boolean"
                },
                "number": {
                  "type": "string"
                },
                "order_id": {
                  "description": "For a Shopify order OrderPilot made: its OrderPilot id; null for one placed elsewhere.",
                  "nullable": true,
                  "type": "string"
                },
                "status": {
                  "type": "string"
                },
                "total": {
                  "description": "Two decimals.",
                  "type": "number"
                },
                "type": {
                  "enum": ["quote", "sales_order", "draft", "shopify_order"],
                  "type": "string"
                }
              },
              "type": "object"
            },
            "type": "array"
          },
          "next_cursor": {
            "nullable": true,
            "type": "string"
          },
          "summary": {
            "description": "The profile’s summary strip (in `currency`): open quotes, sales orders since 1 January (UTC) and what is owed. First page only, for a caller who reads both quotes and orders; null otherwise.",
            "nullable": true,
            "properties": {
              "balance_due": {
                "description": "Two decimals.",
                "type": "number"
              },
              "currency": {
                "type": "string"
              },
              "last_order_at": {
                "format": "date-time",
                "nullable": true,
                "type": "string"
              },
              "open_quotes": {
                "properties": {
                  "count": {
                    "type": "integer"
                  },
                  "total": {
                    "description": "Two decimals.",
                    "type": "number"
                  }
                },
                "type": "object"
              },
              "sales_orders_this_year": {
                "properties": {
                  "count": {
                    "type": "integer"
                  },
                  "total": {
                    "description": "Two decimals.",
                    "type": "number"
                  }
                },
                "type": "object"
              }
            },
            "type": "object"
          }
        },
        "type": "object"
      },
      "CustomerEdit": {
        "properties": {
          "company_id": {
            "description": "Make them a contact of this Shopify B2B company (an `id` from `GET /companies`); null takes them off their company. Shopify allows one company per customer, so they leave the old one. A store without Shopify B2B is `422 CUSTOMER_REFUSED`.",
            "nullable": true,
            "type": "string"
          },
          "email": {
            "description": "Null clears it; a customer keeps an email or a phone.",
            "nullable": true,
            "type": "string"
          },
          "fields": {
            "description": "Customer field values by `key` from `GET /customers/{id}/profile`: text, a number or true/false, a list of texts for a list field, or null to clear it. A choice takes one of its `choices`. A picture field takes the `id` `POST /files` answered for the picture (upload it there first), or null to clear it. Up to 50 at a time; an unknown key is `400 UNKNOWN_FIELD`.",
            "type": "object"
          },
          "first_name": {
            "nullable": true,
            "type": "string"
          },
          "last_name": {
            "nullable": true,
            "type": "string"
          },
          "new_company_name": {
            "description": "Create a Shopify B2B company with this name and make them its main contact (instead of `company_id`).",
            "type": "string"
          },
          "note": {
            "description": "The customer’s note (up to 5,000 characters); null clears it.",
            "nullable": true,
            "type": "string"
          },
          "phone": {
            "description": "Null clears it; a customer keeps an email or a phone.",
            "nullable": true,
            "type": "string"
          },
          "resale": {
            "description": "One state’s resale certificate: `{ state: \"CA\", remove: true }` takes the certificate and the state’s exemption off, `{ state: \"CA\", expires_on: \"2027-06-30\" }` (or null) changes the expiry of the one on file. Adding a certificate needs its file, uploaded in OrderPilot (Customers › Tax & resale).",
            "properties": {
              "expires_on": {
                "description": "YYYY-MM-DD.",
                "nullable": true,
                "type": "string"
              },
              "remove": {
                "type": "boolean"
              },
              "state": {
                "description": "A US state code (`CA`).",
                "type": "string"
              }
            },
            "type": "object"
          },
          "tax_exempt": {
            "description": "Exempt from every tax.",
            "type": "boolean"
          }
        },
        "type": "object"
      },
      "CustomerFieldCreate": {
        "properties": {
          "choices": {
            "description": "A choice list’s values, in order (1–128, each up to 255 characters; repeats and blanks are dropped). Only for `choice` and `multi_choice`.",
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "description": {
            "description": "Up to 255 characters.",
            "type": "string"
          },
          "header_tag": {
            "description": "Make it the header tag (a choice list only); the one that was stops being it. Default false.",
            "type": "boolean"
          },
          "name": {
            "description": "Up to 255 characters; the key is made from it.",
            "type": "string"
          },
          "order_page": {
            "description": "On quotes and orders’ customer card: `hidden` (not shown), `readonly` (shown) or `editable` (shown, and staff can change it there). Default `hidden`.",
            "enum": ["hidden", "readonly", "editable"],
            "type": "string"
          },
          "section": {
            "description": "Where it shows on the customer’s profile: `profile`, `contact`, `social` (Website and social), `classification` or `more` (More details). Default: `classification` for a choice list, `more` for the rest.",
            "enum": ["profile", "contact", "social", "classification", "more"],
            "type": "string"
          },
          "type": {
            "description": "`single_line_text_field`, `multi_line_text_field`, `url`, `number_integer`, `number_decimal`, `date`, `boolean`, `choice` (one of `choices`), `multi_choice` (any of them) or `file_reference` (a picture). It can’t change later.",
            "enum": [
              "single_line_text_field",
              "multi_line_text_field",
              "url",
              "number_integer",
              "number_decimal",
              "date",
              "boolean",
              "choice",
              "multi_choice",
              "file_reference"
            ],
            "type": "string"
          }
        },
        "required": ["name", "type"],
        "type": "object"
      },
      "CustomerFieldOrder": {
        "properties": {
          "ordered_keys": {
            "description": "The fields’ `key`s in the new order (up to 200); ones left out keep their order after them.",
            "items": {
              "type": "string"
            },
            "type": "array"
          }
        },
        "required": ["ordered_keys"],
        "type": "object"
      },
      "CustomerFieldSettings": {
        "properties": {
          "added": {
            "description": "Adding the standard fields: the names of those added.",
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "items": {
            "description": "Every customer field, in the profile’s order.",
            "items": {
              "properties": {
                "choices": {
                  "items": {
                    "type": "string"
                  },
                  "type": "array"
                },
                "description": {
                  "nullable": true,
                  "type": "string"
                },
                "header_tag": {
                  "description": "Its values show as tags beside the customer’s name (one field at most).",
                  "type": "boolean"
                },
                "key": {
                  "description": "`namespace.key`: what `PATCH /settings/customer-fields/{key}` and `fields` on `PATCH /customers/{id}` take.",
                  "type": "string"
                },
                "name": {
                  "type": "string"
                },
                "order_page": {
                  "description": "On quotes and orders’ customer card: `hidden` (not shown), `readonly` (shown) or `editable` (shown, and staff can change it there).",
                  "enum": ["hidden", "readonly", "editable"],
                  "type": "string"
                },
                "position": {
                  "description": "Its place in the list, from 0.",
                  "type": "integer"
                },
                "section": {
                  "description": "Where it shows on the customer’s profile: `profile`, `contact`, `social` (Website and social), `classification` or `more` (More details).",
                  "enum": [
                    "profile",
                    "contact",
                    "social",
                    "classification",
                    "more"
                  ],
                  "type": "string"
                },
                "standard": {
                  "description": "One of OrderPilot’s standard fields (`POST /settings/customer-fields/standard`).",
                  "type": "boolean"
                },
                "type": {
                  "description": "`single_line_text_field`, `multi_line_text_field`, `url`, `number_integer`, `number_decimal`, `date`, `boolean`, `choice` (one of `choices`), `multi_choice` (any of them) or `file_reference` (a picture). `other`: a Shopify type OrderPilot doesn’t edit.",
                  "enum": [
                    "single_line_text_field",
                    "multi_line_text_field",
                    "url",
                    "number_integer",
                    "number_decimal",
                    "date",
                    "boolean",
                    "choice",
                    "multi_choice",
                    "file_reference",
                    "other"
                  ],
                  "type": "string"
                }
              },
              "type": "object"
            },
            "type": "array"
          },
          "saved_key": {
            "description": "A create or change: the field it saved.",
            "type": "string"
          }
        },
        "type": "object"
      },
      "CustomerFieldUpdate": {
        "properties": {
          "choices": {
            "description": "A choice list’s values, in order (1–128, each up to 255 characters; repeats and blanks are dropped). Only for `choice` and `multi_choice`.",
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "description": {
            "description": "Up to 255 characters; empty or null clears it.",
            "nullable": true,
            "type": "string"
          },
          "header_tag": {
            "description": "true makes it the header tag (a choice list only); false on the header field leaves none.",
            "type": "boolean"
          },
          "name": {
            "description": "Up to 255 characters.",
            "type": "string"
          },
          "order_page": {
            "description": "On quotes and orders’ customer card: `hidden` (not shown), `readonly` (shown) or `editable` (shown, and staff can change it there).",
            "enum": ["hidden", "readonly", "editable"],
            "type": "string"
          },
          "section": {
            "description": "Where it shows on the customer’s profile: `profile`, `contact`, `social` (Website and social), `classification` or `more` (More details).",
            "enum": ["profile", "contact", "social", "classification", "more"],
            "type": "string"
          }
        },
        "type": "object"
      },
      "CustomerList": {
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/Customer"
            },
            "type": "array"
          },
          "next_cursor": {
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "CustomerNotes": {
        "properties": {
          "customer_id": {
            "type": "string"
          },
          "notes": {
            "description": "The customer’s notes, newest first, as Lookup lists them from the Shopify note. Text written in Shopify that isn’t a dated line comes last, by `Customer note in Shopify`.",
            "items": {
              "properties": {
                "by": {
                  "description": "Who wrote it and the day, as `Sam Ortiz · Nov 4, 2026`.",
                  "type": "string"
                },
                "text": {
                  "type": "string"
                }
              },
              "type": "object"
            },
            "type": "array"
          }
        },
        "type": "object"
      },
      "CustomerPayment": {
        "properties": {
          "enabled": {
            "description": "Customer payment is turned on for this record.",
            "type": "boolean"
          },
          "enabled_at": {
            "description": "When it was turned on; null while it is off.",
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "enabled_by": {
            "description": "The staff member who turned it on; null while it is off, or when something else turned it on (a payment request, a payment recorded, an API key).",
            "nullable": true,
            "type": "string"
          },
          "store_gates_payment": {
            "description": "The store’s setting “Customers can pay only after payment is enabled on the order” (Settings › Order defaults). While it is false the customer can pay whatever `enabled` says; `enabled` is still kept, so the record stays payable if the setting is turned on later.",
            "type": "boolean"
          }
        },
        "type": "object"
      },
      "CustomerPaymentChange": {
        "properties": {
          "changed": {
            "description": "This call changed it; false when it already was so.",
            "type": "boolean"
          },
          "enabled": {
            "description": "Customer payment is turned on for this record.",
            "type": "boolean"
          },
          "enabled_at": {
            "description": "When it was turned on; null while it is off.",
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "enabled_by": {
            "description": "The staff member who turned it on; null while it is off, or when something else turned it on (a payment request, a payment recorded, an API key).",
            "nullable": true,
            "type": "string"
          },
          "store_gates_payment": {
            "description": "The store’s setting “Customers can pay only after payment is enabled on the order” (Settings › Order defaults). While it is false the customer can pay whatever `enabled` says; `enabled` is still kept, so the record stays payable if the setting is turned on later.",
            "type": "boolean"
          }
        },
        "type": "object"
      },
      "CustomerPaymentSet": {
        "properties": {
          "enabled": {
            "description": "`true` turns customer payment on, `false` off.",
            "type": "boolean"
          }
        },
        "required": ["enabled"],
        "type": "object"
      },
      "CustomerProfile": {
        "properties": {
          "addresses": {
            "description": "The Shopify address book: Main first, then Shipping, Billing and the rest.",
            "items": {
              "properties": {
                "address1": {
                  "type": "string"
                },
                "address2": {
                  "type": "string"
                },
                "city": {
                  "type": "string"
                },
                "company": {
                  "type": "string"
                },
                "country": {
                  "type": "string"
                },
                "country_code": {
                  "type": "string"
                },
                "first_name": {
                  "type": "string"
                },
                "id": {
                  "description": "What `DELETE /customers/{id}/addresses/{addressId}` takes.",
                  "type": "string"
                },
                "last_name": {
                  "type": "string"
                },
                "phone": {
                  "type": "string"
                },
                "province": {
                  "type": "string"
                },
                "province_code": {
                  "type": "string"
                },
                "roles": {
                  "description": "Which roles this entry holds. With no Shipping (or Billing) entry, the Main one is used.",
                  "items": {
                    "enum": ["main", "shipping", "billing"],
                    "type": "string"
                  },
                  "type": "array"
                },
                "zip": {
                  "type": "string"
                }
              },
              "type": "object"
            },
            "type": "array"
          },
          "amount_spent": {
            "description": "Shopify’s lifetime spend; null without Read orders.",
            "nullable": true,
            "properties": {
              "amount": {
                "description": "Two decimals.",
                "type": "number"
              },
              "currency": {
                "type": "string"
              }
            },
            "type": "object"
          },
          "b2b": {
            "description": "The store has Shopify B2B (companies).",
            "type": "boolean"
          },
          "company": {
            "nullable": true,
            "properties": {
              "id": {
                "description": "What `company_id` takes.",
                "type": "string"
              },
              "name": {
                "type": "string"
              },
              "title": {
                "description": "Their job title at the company.",
                "type": "string"
              }
            },
            "type": "object"
          },
          "created_at": {
            "type": "string"
          },
          "display_name": {
            "type": "string"
          },
          "email": {
            "type": "string"
          },
          "fields": {
            "description": "Every customer field the store has, in the profile’s order, with this customer’s value.",
            "items": {
              "properties": {
                "choices": {
                  "description": "For `choice` and `multi_choice`: the values it takes.",
                  "items": {
                    "type": "string"
                  },
                  "type": "array"
                },
                "files": {
                  "description": "For a picture: its Shopify file(s) (`url` null while processing).",
                  "items": {
                    "properties": {
                      "id": {
                        "type": "string"
                      },
                      "url": {
                        "nullable": true,
                        "type": "string"
                      }
                    },
                    "type": "object"
                  },
                  "type": "array"
                },
                "header_tag": {
                  "description": "Its values show as tags beside the customer’s name.",
                  "type": "boolean"
                },
                "key": {
                  "description": "`namespace.key`: what `fields` on `PATCH /customers/{id}` takes.",
                  "type": "string"
                },
                "name": {
                  "type": "string"
                },
                "section": {
                  "type": "string"
                },
                "settable": {
                  "description": "Whether `PATCH /customers/{id}` sets it (a picture takes the `id` `POST /files` answered for it).",
                  "type": "boolean"
                },
                "type": {
                  "description": "`single_line_text_field`, `multi_line_text_field`, `url`, `number_integer`, `number_decimal`, `date`, `boolean`, `choice`, `multi_choice`, `file_reference` (a picture) or `other` (a Shopify type OrderPilot doesn’t edit).",
                  "enum": [
                    "single_line_text_field",
                    "multi_line_text_field",
                    "url",
                    "number_integer",
                    "number_decimal",
                    "date",
                    "boolean",
                    "choice",
                    "multi_choice",
                    "file_reference",
                    "other"
                  ],
                  "type": "string"
                },
                "value": {
                  "description": "The value as text; null when none. For `multi_choice` and list fields see `values`.",
                  "nullable": true,
                  "type": "string"
                },
                "values": {
                  "description": "Every value (one for a plain field, several for a list); empty when none.",
                  "items": {
                    "type": "string"
                  },
                  "type": "array"
                }
              },
              "type": "object"
            },
            "type": "array"
          },
          "first_name": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "last_name": {
            "type": "string"
          },
          "note": {
            "type": "string"
          },
          "orders_count": {
            "description": "Shopify’s count of their orders; null without Read orders.",
            "nullable": true,
            "type": "integer"
          },
          "phone": {
            "type": "string"
          },
          "resale_certificates": {
            "description": "One per state with a certificate on file.",
            "items": {
              "properties": {
                "expires_on": {
                  "description": "YYYY-MM-DD, or null.",
                  "nullable": true,
                  "type": "string"
                },
                "file_name": {
                  "type": "string"
                },
                "state": {
                  "type": "string"
                },
                "uploaded_at": {
                  "type": "string"
                },
                "url": {
                  "description": "The certificate’s Shopify file, as the profile’s Tax & resale tab links it (anyone with the link can open it); null while Shopify processes it.",
                  "nullable": true,
                  "type": "string"
                }
              },
              "type": "object"
            },
            "type": "array"
          },
          "resale_states": {
            "description": "The US states (`CA`) they are exempt in for resale.",
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "shopify_id": {
            "type": "string"
          },
          "tags": {
            "description": "The customer’s Shopify tags, read only (OrderPilot doesn’t change them). The tag OrderPilot shows beside the name is the field marked `header_tag`.",
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "tax_exempt": {
            "description": "Exempt from every tax.",
            "type": "boolean"
          },
          "tax_exemptions": {
            "description": "Shopify’s exemption codes (`US_CA_RESELLER_EXEMPTION`, …).",
            "items": {
              "type": "string"
            },
            "type": "array"
          }
        },
        "type": "object"
      },
      "DefaultRecipientList": {
        "properties": {
          "items": {
            "items": {
              "properties": {
                "bcc": {
                  "items": {
                    "type": "string"
                  },
                  "type": "array"
                },
                "brand_id": {
                  "nullable": true,
                  "type": "string"
                },
                "cc": {
                  "items": {
                    "type": "string"
                  },
                  "type": "array"
                },
                "document_type": {
                  "description": "Customer quote and order emails, or purchase order emails to vendors.",
                  "enum": ["sales_order", "purchase_order"],
                  "type": "string"
                },
                "location_id": {
                  "description": "The location’s Shopify id.",
                  "nullable": true,
                  "type": "string"
                },
                "scope": {
                  "description": "The whole shop, one brand (`brand_id`) or one location (`location_id`).",
                  "enum": ["global", "brand", "location"],
                  "type": "string"
                }
              },
              "required": [
                "document_type",
                "scope",
                "brand_id",
                "location_id",
                "cc",
                "bcc"
              ],
              "type": "object"
            },
            "type": "array"
          }
        },
        "required": ["items"],
        "type": "object"
      },
      "DefaultRecipientSave": {
        "properties": {
          "bcc": {
            "description": "The addresses to blind-copy.",
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "brand_id": {
            "description": "With `scope: brand`: an `id` from `GET /brands`.",
            "type": "string"
          },
          "cc": {
            "description": "The addresses to copy (or one text, as typed). Empty with `bcc` empty: no rule.",
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "document_type": {
            "description": "Customer quote and order emails, or purchase order emails to vendors.",
            "enum": ["sales_order", "purchase_order"],
            "type": "string"
          },
          "location_id": {
            "description": "With `scope: location`: the location’s Shopify id (`GET /locations`).",
            "type": "string"
          },
          "scope": {
            "description": "The whole shop, one brand (`brand_id`) or one location (`location_id`). Default global.",
            "enum": ["global", "brand", "location"],
            "type": "string"
          }
        },
        "required": ["document_type"],
        "type": "object"
      },
      "Deleted": {
        "properties": {
          "ok": {
            "type": "boolean"
          }
        },
        "type": "object"
      },
      "DeliveryList": {
        "properties": {
          "items": {
            "items": {
              "properties": {
                "attempts": {
                  "type": "integer"
                },
                "created_at": {
                  "format": "date-time",
                  "type": "string"
                },
                "delivered_at": {
                  "nullable": true,
                  "type": "string"
                },
                "event_id": {
                  "type": "string"
                },
                "last_error": {
                  "nullable": true,
                  "type": "string"
                },
                "last_status": {
                  "nullable": true,
                  "type": "integer"
                },
                "next_attempt_at": {
                  "format": "date-time",
                  "type": "string"
                },
                "state": {
                  "enum": ["PENDING", "DELIVERED", "FAILED"],
                  "type": "string"
                },
                "type": {
                  "type": "string"
                }
              },
              "type": "object"
            },
            "type": "array"
          }
        },
        "type": "object"
      },
      "DepositMarkPaid": {
        "properties": {
          "note": {
            "description": "How it was paid (“Cash”), up to 200 characters; on the deposit and its activity.",
            "type": "string"
          }
        },
        "type": "object"
      },
      "DepositRecord": {
        "properties": {
          "amount": {
            "description": "The deposit: above 0, two decimals.",
            "type": "number"
          },
          "note": {
            "description": "How it was paid (“Cash”), up to 200 characters; on the deposit and its activity.",
            "type": "string"
          },
          "override_requirements": {
            "description": "On Shopify Plus: place the order with the deposit even though it usually needs a signature or a larger deposit first (`409 REQUIREMENTS_NOT_MET` names them). It needs Prices and exceptions.",
            "type": "boolean"
          },
          "percent": {
            "description": "The deposit as a percentage of the total: above 0 and below 100, two decimals. Send `percent` or `amount`.",
            "type": "number"
          }
        },
        "type": "object"
      },
      "DepositRecorded": {
        "properties": {
          "amount": {
            "description": "The deposit recorded, two decimals.",
            "type": "number"
          },
          "currency": {
            "type": "string"
          },
          "payment_request_id": {
            "description": "The deposit’s payment request; null on Shopify Plus.",
            "nullable": true,
            "type": "string"
          },
          "placed": {
            "description": "On Shopify Plus: the order is placed in Shopify with the deposit recorded on it.",
            "type": "boolean"
          },
          "queued": {
            "description": "Without Shopify Plus: its deposit order is completed as paid on the queue (`status` turns `paid` in the payment requests once it has run).",
            "type": "boolean"
          },
          "shopify_order_number": {
            "description": "On Shopify Plus: the Shopify order the deposit placed.",
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "DepositState": {
        "properties": {
          "blocked_reason": {
            "description": "Why a deposit can’t be asked for now (not on in the store, nothing due, the order split, still syncing, an unpaid request waiting, …), with what to do; null when it can.",
            "nullable": true,
            "type": "string"
          },
          "deposits_on": {
            "description": "Deposits can be asked for in this store: Settings › Deposit orders is on, or the store is on Shopify Plus (whose deposit goes on the order itself).",
            "type": "boolean"
          },
          "shopify_plus": {
            "description": "The store is on Shopify Plus: a deposit is a percentage on the draft’s payment terms. Without Plus it is a deposit order with its own checkout. Null when Shopify didn’t say just now.",
            "nullable": true,
            "type": "boolean"
          }
        },
        "type": "object"
      },
      "EmailActivityList": {
        "properties": {
          "engagement": {
            "description": "The last 30 days of real (not test) sends: how many reached each state.",
            "properties": {
              "bounced": {
                "type": "integer"
              },
              "clicked": {
                "type": "integer"
              },
              "delivered": {
                "type": "integer"
              },
              "opened": {
                "type": "integer"
              },
              "sent": {
                "type": "integer"
              },
              "spam_reports": {
                "type": "integer"
              }
            },
            "type": "object"
          },
          "groups": {
            "description": "The email groups `group_id` filters by.",
            "items": {
              "properties": {
                "id": {
                  "type": "string"
                },
                "name": {
                  "type": "string"
                }
              },
              "type": "object"
            },
            "type": "array"
          },
          "items": {
            "items": {
              "$ref": "#/components/schemas/EmailActivitySend"
            },
            "type": "array"
          },
          "next_cursor": {
            "nullable": true,
            "type": "string"
          },
          "page": {
            "type": "integer"
          },
          "page_size": {
            "type": "integer"
          },
          "search_truncated": {
            "description": "The search hit its cap: older sends for a customer with very many orders may be missing.",
            "type": "boolean"
          },
          "total": {
            "type": "integer"
          }
        },
        "type": "object"
      },
      "EmailActivitySend": {
        "properties": {
          "attachment": {
            "nullable": true,
            "properties": {
              "attached": {
                "description": "False while it waits, or when it didn’t go.",
                "type": "boolean"
              },
              "name": {
                "type": "string"
              }
            },
            "type": "object"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "display_status": {
            "description": "What the tab shows: the strongest report of the mail service, else `status`.",
            "enum": [
              "clicked",
              "opened",
              "bounced",
              "delivered",
              "sent",
              "uncertain",
              "scheduled",
              "sending",
              "failed",
              "cancelled"
            ],
            "type": "string"
          },
          "error": {
            "nullable": true,
            "type": "string"
          },
          "id": {
            "description": "What `GET /settings/email-sending/activity/{sendId}` takes.",
            "type": "string"
          },
          "is_test": {
            "type": "boolean"
          },
          "opens": {
            "description": "Opens counted by OrderPilot’s own pixel; null when it saw none.",
            "nullable": true,
            "properties": {
              "automated_count": {
                "description": "Views that said they were a machine.",
                "type": "integer"
              },
              "count": {
                "description": "Views believed to be a person.",
                "type": "integer"
              },
              "first_at": {
                "format": "date-time",
                "nullable": true,
                "type": "string"
              },
              "last_at": {
                "format": "date-time",
                "nullable": true,
                "type": "string"
              }
            },
            "type": "object"
          },
          "order_id": {
            "description": "The quote or order the email was about (for a purchase order email, the record its send names).",
            "type": "string"
          },
          "order_label": {
            "description": "Its number as staff see it.",
            "nullable": true,
            "type": "string"
          },
          "scheduled_at": {
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "sent_at": {
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "status": {
            "description": "Where the send is in OrderPilot.",
            "enum": [
              "queued",
              "scheduled",
              "pending",
              "sending",
              "sent",
              "failed",
              "cancelled",
              "uncertain"
            ],
            "type": "string"
          },
          "subject": {
            "type": "string"
          },
          "template_key": {
            "type": "string"
          },
          "template_name": {
            "type": "string"
          },
          "to": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "trigger": {
            "description": "How it was started: `manual`, `scheduled`, `status_change`, `purchase_order`, …",
            "type": "string"
          }
        },
        "type": "object"
      },
      "EmailCompose": {
        "description": "The composer’s email. Every field is optional with a template; with none, `subject` and `message` are required.",
        "properties": {
          "attach_document": {
            "description": "Attach the PDF where the template does (default true); false sends none.",
            "type": "boolean"
          },
          "bcc": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "cc": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "include_what_changed": {
            "description": "False leaves out the list of the quote’s changes an email that delivers the quote shows. Default true.",
            "type": "boolean"
          },
          "message": {
            "description": "Your message, up to 50,000 characters, with merge fields (blank lines start paragraphs). Left out: the template’s own.",
            "type": "string"
          },
          "plain_text": {
            "description": "True: this one email as plain text; false: designed. Left out: the template’s own setting.",
            "type": "boolean"
          },
          "subject": {
            "description": "Your subject, up to 200 characters, with merge fields. Left out: the template’s own.",
            "type": "string"
          },
          "template_key": {
            "description": "A customer template’s `key` from `GET /email-templates`. Left out: your own email, `subject` and `message` as typed, with no template.",
            "type": "string"
          },
          "to": {
            "description": "Up to 5 addresses; the customer’s own address when left out.",
            "items": {
              "type": "string"
            },
            "type": "array"
          }
        },
        "type": "object"
      },
      "EmailDefaultThemeSaved": {
        "properties": {
          "failed": {
            "description": "Published templates that couldn’t be compiled in it: they keep their own.",
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "name": {
            "type": "string"
          },
          "restyled": {
            "description": "Templates now on the theme.",
            "type": "integer"
          },
          "theme_key": {
            "enum": [
              "ledger",
              "gallery",
              "summary",
              "paper",
              "statement",
              "minimal"
            ],
            "type": "string"
          }
        },
        "type": "object"
      },
      "EmailDefaultThemeSet": {
        "properties": {
          "theme_key": {
            "description": "A theme’s `key`, from `GET /email-themes`.",
            "enum": [
              "ledger",
              "gallery",
              "summary",
              "paper",
              "statement",
              "minimal"
            ],
            "type": "string"
          }
        },
        "required": ["theme_key"],
        "type": "object"
      },
      "EmailLook": {
        "properties": {
          "body_fonts": {
            "description": "The Body font choices: `key` is what `POST /email-look/apply` takes.",
            "items": {
              "properties": {
                "key": {
                  "type": "string"
                },
                "label": {
                  "type": "string"
                },
                "stack": {
                  "description": "The CSS font stack.",
                  "type": "string"
                }
              },
              "type": "object"
            },
            "type": "array"
          },
          "corners": {
            "items": {
              "enum": ["square", "rounded", "pill"],
              "type": "string"
            },
            "type": "array"
          },
          "items": {
            "items": {
              "properties": {
                "body_font": {
                  "description": "Its body font: a `body_fonts[].key`, or `custom` for a font none of them is.",
                  "enum": [
                    "arial",
                    "helvetica",
                    "georgia",
                    "times_new_roman",
                    "trebuchet_ms",
                    "verdana",
                    "system",
                    "custom"
                  ],
                  "type": "string"
                },
                "corners": {
                  "enum": ["square", "rounded", "pill"],
                  "type": "string"
                },
                "key": {
                  "description": "The template’s key.",
                  "type": "string"
                }
              },
              "type": "object"
            },
            "type": "array"
          }
        },
        "type": "object"
      },
      "EmailLookApplied": {
        "properties": {
          "changed": {
            "description": "Drafts written.",
            "type": "integer"
          },
          "items": {
            "items": {
              "properties": {
                "body_font": {
                  "description": "Its body font: a `body_fonts[].key`, or `custom` for a font none of them is.",
                  "enum": [
                    "arial",
                    "helvetica",
                    "georgia",
                    "times_new_roman",
                    "trebuchet_ms",
                    "verdana",
                    "system",
                    "custom"
                  ],
                  "type": "string"
                },
                "corners": {
                  "enum": ["square", "rounded", "pill"],
                  "type": "string"
                },
                "key": {
                  "description": "The template’s key.",
                  "type": "string"
                }
              },
              "type": "object"
            },
            "type": "array"
          }
        },
        "type": "object"
      },
      "EmailLookApply": {
        "properties": {
          "body_font": {
            "description": "A `body_fonts[].key` from `GET /email-look`.",
            "enum": [
              "arial",
              "helvetica",
              "georgia",
              "times_new_roman",
              "trebuchet_ms",
              "verdana",
              "system"
            ],
            "type": "string"
          },
          "button_corners": {
            "enum": ["square", "rounded", "pill"],
            "type": "string"
          }
        },
        "type": "object"
      },
      "EmailOriginal": {
        "properties": {
          "html": {
            "description": "The email’s HTML after the allow-list: show it in a sandboxed frame.",
            "type": "string"
          }
        },
        "type": "object"
      },
      "EmailPlaceholders": {
        "properties": {
          "items": {
            "items": {
              "properties": {
                "description": {
                  "type": "string"
                },
                "group": {
                  "type": "string"
                },
                "token": {
                  "description": "What to write, such as `{{customer.name}}`.",
                  "type": "string"
                },
                "value": {
                  "description": "This record’s value.",
                  "nullable": true,
                  "type": "string"
                }
              },
              "type": "object"
            },
            "type": "array"
          },
          "values": {
            "description": "Every merge field by its path (`customer.name`, and the editor’s names such as `documentNumber`), with this record’s value.",
            "type": "object"
          }
        },
        "type": "object"
      },
      "EmailPreview": {
        "properties": {
          "html": {
            "description": "The email’s HTML, as the customer receives it.",
            "type": "string"
          },
          "subject": {
            "type": "string"
          },
          "text": {
            "description": "The plain text version.",
            "type": "string"
          },
          "view_document_label": {
            "description": "The button’s words.",
            "nullable": true,
            "type": "string"
          },
          "view_document_url": {
            "description": "Where the email’s button leads: the customer’s sign page or portal page. Null when it has none.",
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "EmailQueued": {
        "properties": {
          "queued": {
            "type": "boolean"
          },
          "schedule_id": {
            "description": "A scheduled email’s id, for `DELETE /orders/{id}/scheduled-emails/{scheduleId}`; null when it went now.",
            "nullable": true,
            "type": "string"
          },
          "scheduled_at": {
            "description": "When a scheduled email goes; null when it went now.",
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "to": {
            "items": {
              "type": "string"
            },
            "type": "array"
          }
        },
        "type": "object"
      },
      "EmailSendDetail": {
        "properties": {
          "bcc": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "body_text": {
            "description": "The text as it went; null where the bodies don’t show.",
            "nullable": true,
            "type": "string"
          },
          "cc": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "compare": {
            "description": "With `compare=true`: the same email as it would go out now.",
            "nullable": true,
            "properties": {
              "current": {
                "nullable": true,
                "properties": {
                  "html": {
                    "type": "string"
                  },
                  "subject": {
                    "type": "string"
                  },
                  "version_number": {
                    "nullable": true,
                    "type": "integer"
                  }
                },
                "type": "object"
              },
              "unavailable_reason": {
                "nullable": true,
                "type": "string"
              }
            },
            "type": "object"
          },
          "compare_unavailable_reason": {
            "nullable": true,
            "type": "string"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "error": {
            "nullable": true,
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "is_test": {
            "type": "boolean"
          },
          "scheduled_at": {
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "sent": {
            "properties": {
              "html": {
                "nullable": true,
                "type": "string"
              },
              "source": {
                "description": "`stored`: the HTML the provider was given. `rebuilt`: the same template version rendered again with the record as it is now (it may differ). `none`: neither.",
                "enum": ["stored", "rebuilt", "none"],
                "type": "string"
              },
              "unavailable_reason": {
                "nullable": true,
                "type": "string"
              },
              "version_number": {
                "nullable": true,
                "type": "integer"
              }
            },
            "type": "object"
          },
          "sent_at": {
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "status": {
            "enum": [
              "queued",
              "scheduled",
              "pending",
              "sending",
              "sent",
              "failed",
              "cancelled",
              "uncertain"
            ],
            "type": "string"
          },
          "subject": {
            "type": "string"
          },
          "template_key": {
            "type": "string"
          },
          "template_name": {
            "type": "string"
          },
          "to": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "trigger": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "EmailSendingAccount": {
        "properties": {
          "bounce_rate_24h": {
            "type": "number"
          },
          "branded_links": {
            "description": "Branded links once set up; null otherwise.",
            "nullable": true,
            "properties": {
              "checked_at": {
                "format": "date-time",
                "nullable": true,
                "type": "string"
              },
              "records": {
                "items": {
                  "properties": {
                    "data": {
                      "description": "What the record points to (its value).",
                      "type": "string"
                    },
                    "host": {
                      "description": "The record’s name at the domain provider.",
                      "type": "string"
                    },
                    "type": {
                      "description": "The record type, such as `CNAME` or `TXT`.",
                      "type": "string"
                    },
                    "valid": {
                      "description": "Whether the last check found it; null before the first check.",
                      "nullable": true,
                      "type": "boolean"
                    }
                  },
                  "type": "object"
                },
                "type": "array"
              },
              "status": {
                "enum": ["dns_pending", "ssl_pending", "active"],
                "type": "string"
              }
            },
            "type": "object"
          },
          "dmarc": {
            "description": "DMARC on the sending domain as last looked up; null before.",
            "nullable": true,
            "properties": {
              "checked_at": {
                "format": "date-time",
                "nullable": true,
                "type": "string"
              },
              "policy": {
                "enum": ["none", "quarantine", "reject", null],
                "nullable": true,
                "type": "string"
              },
              "policy_since": {
                "format": "date-time",
                "nullable": true,
                "type": "string"
              },
              "record_domain": {
                "nullable": true,
                "type": "string"
              },
              "status": {
                "enum": ["found", "missing", "invalid", "multiple", "unknown"],
                "type": "string"
              }
            },
            "type": "object"
          },
          "dns_records": {
            "items": {
              "properties": {
                "data": {
                  "description": "What the record points to (its value).",
                  "type": "string"
                },
                "host": {
                  "description": "The record’s name at the domain provider.",
                  "type": "string"
                },
                "type": {
                  "description": "The record type, such as `CNAME` or `TXT`.",
                  "type": "string"
                },
                "valid": {
                  "description": "Whether the last check found it; null before the first check.",
                  "nullable": true,
                  "type": "boolean"
                }
              },
              "type": "object"
            },
            "type": "array"
          },
          "domain": {
            "nullable": true,
            "type": "string"
          },
          "domain_status": {
            "description": "`none` (no domain yet), `dns_pending` (add the records), `verified`, `failed`.",
            "enum": ["none", "dns_pending", "verified", "failed"],
            "type": "string"
          },
          "from_email": {
            "nullable": true,
            "type": "string"
          },
          "last_validated_at": {
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "provisioned": {
            "description": "Whether the sending account is made.",
            "type": "boolean"
          },
          "reply_to_emails": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "sender_name": {
            "nullable": true,
            "type": "string"
          },
          "setup_problem": {
            "description": "Why setup needs attention, when it does.",
            "nullable": true,
            "type": "string"
          },
          "spam_rate_24h": {
            "type": "number"
          },
          "status": {
            "description": "`pending` while setting up, `active`, `suspended` (sending paused, see `suspended_reason`), `disabled` (removed).",
            "enum": ["pending", "active", "suspended", "disabled"],
            "type": "string"
          },
          "suspended_at": {
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "suspended_reason": {
            "nullable": true,
            "type": "string"
          },
          "vendor_replies": {
            "properties": {
              "available": {
                "description": "False when Receive replies isn’t offered here yet.",
                "type": "boolean"
              },
              "error": {
                "nullable": true,
                "type": "string"
              },
              "hostname": {
                "nullable": true,
                "type": "string"
              },
              "last_checked_at": {
                "format": "date-time",
                "nullable": true,
                "type": "string"
              },
              "record": {
                "description": "The MX record to add for it.",
                "nullable": true,
                "properties": {
                  "host": {
                    "type": "string"
                  },
                  "priority": {
                    "type": "integer"
                  },
                  "type": {
                    "description": "The record type (MX).",
                    "enum": ["mx"],
                    "type": "string"
                  },
                  "value": {
                    "type": "string"
                  }
                },
                "type": "object"
              },
              "record_found": {
                "nullable": true,
                "type": "boolean"
              },
              "status": {
                "enum": ["off", "waiting", "active", "error"],
                "type": "string"
              }
            },
            "type": "object"
          }
        },
        "type": "object"
      },
      "EmailSendingDomain": {
        "properties": {
          "domain": {
            "description": "The domain, such as `example.com`.",
            "type": "string"
          },
          "from_local": {
            "description": "The From address’s part before the @. Default `orders`.",
            "type": "string"
          },
          "replace_domain": {
            "description": "True to replace a different domain already set up (its pending emails are cancelled).",
            "type": "boolean"
          },
          "reply_to_emails": {
            "description": "Up to 10 Reply-to addresses. Left out: none.",
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "sender_name": {
            "description": "The name customers see, up to 120 characters.",
            "type": "string"
          }
        },
        "required": ["domain", "sender_name"],
        "type": "object"
      },
      "EmailSendingRemove": {
        "properties": {
          "confirm": {
            "description": "True: every email of the store stops until setup is done again.",
            "type": "boolean"
          }
        },
        "required": ["confirm"],
        "type": "object"
      },
      "EmailSendingSaved": {
        "properties": {
          "account": {
            "allOf": [
              {
                "$ref": "#/components/schemas/EmailSendingAccount"
              }
            ],
            "nullable": true
          },
          "cancelled_pending_emails": {
            "description": "A domain change: how many pending emails it cancelled. Null otherwise.",
            "nullable": true,
            "type": "integer"
          },
          "message": {
            "description": "What Sending settings says after it.",
            "type": "string"
          },
          "verified": {
            "description": "A domain check: whether the domain is verified. Null otherwise.",
            "nullable": true,
            "type": "boolean"
          }
        },
        "type": "object"
      },
      "EmailSendingSender": {
        "properties": {
          "reply_to_emails": {
            "description": "Up to 10 Reply-to addresses; an empty list clears them. Left out: unchanged.",
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "sender_name": {
            "description": "The name customers see, up to 120 characters.",
            "type": "string"
          }
        },
        "required": ["sender_name"],
        "type": "object"
      },
      "EmailSendingSetup": {
        "properties": {
          "account": {
            "allOf": [
              {
                "$ref": "#/components/schemas/EmailSendingAccount"
              }
            ],
            "nullable": true
          },
          "branded_links_available": {
            "type": "boolean"
          },
          "delivery_message": {
            "nullable": true,
            "type": "string"
          },
          "delivery_ready": {
            "type": "boolean"
          },
          "usage": {
            "properties": {
              "included_allowance": {
                "type": "integer"
              },
              "overage_count": {
                "type": "integer"
              },
              "period_end": {
                "format": "date-time",
                "type": "string"
              },
              "period_start": {
                "format": "date-time",
                "type": "string"
              },
              "sent_count": {
                "type": "integer"
              }
            },
            "type": "object"
          }
        },
        "type": "object"
      },
      "EmailTemplateCheck": {
        "properties": {
          "document_findings": {
            "description": "What in the whole design may look like spam (links, images, words).",
            "items": {
              "properties": {
                "clients": {
                  "items": {
                    "type": "string"
                  },
                  "type": "array"
                },
                "message": {
                  "type": "string"
                },
                "rule": {
                  "type": "string"
                },
                "severity": {
                  "enum": ["warning", "info"],
                  "type": "string"
                }
              },
              "type": "object"
            },
            "type": "array"
          },
          "findings": {
            "description": "A block’s markup some email clients show differently.",
            "items": {
              "properties": {
                "block_id": {
                  "type": "string"
                },
                "clients": {
                  "items": {
                    "type": "string"
                  },
                  "type": "array"
                },
                "message": {
                  "type": "string"
                },
                "rule": {
                  "type": "string"
                },
                "severity": {
                  "enum": ["warning", "info"],
                  "type": "string"
                }
              },
              "type": "object"
            },
            "type": "array"
          },
          "issues": {
            "items": {
              "properties": {
                "message": {
                  "type": "string"
                },
                "path": {
                  "type": "string"
                }
              },
              "type": "object"
            },
            "type": "array"
          },
          "valid": {
            "description": "False: the design can’t be saved as it is (`issues`).",
            "type": "boolean"
          }
        },
        "type": "object"
      },
      "EmailTemplateCheckBody": {
        "properties": {
          "document": {
            "description": "Preview: the editor’s own format; it may change inside v1. The design: `{ width, themeKey, theme, blocks }`, as `document` of `GET /email-templates/{key}` (keys as the editor names them; each block’s `props` as `block_defaults`). Left out: the saved draft.",
            "type": "object",
            "x-stability": "preview"
          }
        },
        "type": "object"
      },
      "EmailTemplateCreate": {
        "properties": {
          "from_key": {
            "description": "Copy this template’s draft instead (a `key` from `GET /email-template-groups`); a purchase order template only into a purchase order group.",
            "type": "string"
          },
          "name": {
            "description": "Up to 120 characters.",
            "type": "string"
          },
          "theme_key": {
            "description": "A theme’s `key`, from `GET /email-themes`. Left out: the store’s default.",
            "enum": [
              "ledger",
              "gallery",
              "summary",
              "paper",
              "statement",
              "minimal"
            ],
            "type": "string"
          }
        },
        "required": ["name"],
        "type": "object"
      },
      "EmailTemplateCreated": {
        "properties": {
          "group_id": {
            "type": "string"
          },
          "key": {
            "description": "The new template’s key.",
            "type": "string"
          },
          "name": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "EmailTemplateDeleted": {
        "properties": {
          "deleted": {
            "type": "boolean"
          },
          "key": {
            "type": "string"
          }
        },
        "required": ["key", "deleted"],
        "type": "object"
      },
      "EmailTemplateDetail": {
        "properties": {
          "block_defaults": {
            "description": "Preview: the editor’s own format; it may change inside v1. Every block a design can hold, by its `type` as `document.blocks[].type` names it, with its props’ defaults.",
            "type": "object",
            "x-stability": "preview"
          },
          "brand_ids": {
            "description": "The brands this version goes to (`GET /brands`); empty for a default.",
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "can_send_as_plain_text": {
            "description": "Only Request signature and Request payment can send as plain text.",
            "type": "boolean"
          },
          "document": {
            "description": "Preview: the editor’s own format; it may change inside v1. The design: `{ width, themeKey, theme, blocks }` (keys as the editor names them; each block’s `props` as `block_defaults`). Send it back changed.",
            "type": "object",
            "x-stability": "preview"
          },
          "group": {
            "description": "The email group it sits in.",
            "nullable": true,
            "properties": {
              "id": {
                "type": "string"
              },
              "name": {
                "type": "string"
              }
            },
            "type": "object"
          },
          "has_published_version": {
            "description": "A published version is live.",
            "type": "boolean"
          },
          "has_unpublished_changes": {
            "description": "The draft differs from what customers receive now.",
            "type": "boolean"
          },
          "is_default": {
            "description": "Its group’s default (what every brand without its own gets).",
            "type": "boolean"
          },
          "key": {
            "type": "string"
          },
          "live_misses_brand_color": {
            "description": "The live version was published before buttons took the brand colour: publish again to use it.",
            "type": "boolean"
          },
          "live_misses_paid_label": {
            "description": "The live version was published before a paid balance could read “Paid”: publish again to show it.",
            "type": "boolean"
          },
          "live_version": {
            "description": "The version customers receive. Null until the first publish.",
            "nullable": true,
            "properties": {
              "published_at": {
                "format": "date-time",
                "type": "string"
              },
              "version": {
                "type": "integer"
              }
            },
            "type": "object"
          },
          "name": {
            "type": "string"
          },
          "preset_send_fallback": {
            "description": "Never published: true sends the shipped block design, false the original shipped layout.",
            "type": "boolean"
          },
          "send_as_plain_text": {
            "type": "boolean"
          },
          "subject": {
            "description": "The draft’s subject (published with it).",
            "type": "string"
          },
          "system": {
            "description": "Shipped with the app: it can be changed, never deleted.",
            "type": "boolean"
          },
          "variables": {
            "description": "The merge fields a subject or text may use, with a sample value.",
            "items": {
              "properties": {
                "group": {
                  "description": "The section the editor lists it under.",
                  "enum": [
                    "document",
                    "customer",
                    "store",
                    "totals",
                    "purchase_order"
                  ],
                  "type": "string"
                },
                "label": {
                  "type": "string"
                },
                "merge_field": {
                  "description": "As it is written: `{{documentNumber}}`.",
                  "type": "string"
                },
                "sample": {
                  "nullable": true,
                  "type": "string"
                }
              },
              "type": "object"
            },
            "type": "array"
          },
          "vendor": {
            "description": "A purchase order template (to a vendor).",
            "type": "boolean"
          }
        },
        "required": ["key", "name", "subject", "document"],
        "type": "object"
      },
      "EmailTemplateDraftReset": {
        "properties": {
          "document": {
            "description": "Preview: the editor’s own format; it may change inside v1. The design: `{ width, themeKey, theme, blocks }` (keys as the editor names them; each block’s `props` as `block_defaults`). Send it back changed.",
            "type": "object",
            "x-stability": "preview"
          },
          "has_published_version": {
            "description": "A published version is live.",
            "type": "boolean"
          },
          "has_unpublished_changes": {
            "description": "The draft differs from what customers receive now.",
            "type": "boolean"
          },
          "key": {
            "type": "string"
          },
          "live_misses_brand_color": {
            "description": "The live version was published before buttons took the brand colour: publish again to use it.",
            "type": "boolean"
          },
          "live_misses_paid_label": {
            "description": "The live version was published before a paid balance could read “Paid”: publish again to show it.",
            "type": "boolean"
          },
          "live_version": {
            "description": "The version customers receive. Null until the first publish.",
            "nullable": true,
            "properties": {
              "published_at": {
                "format": "date-time",
                "type": "string"
              },
              "version": {
                "type": "integer"
              }
            },
            "type": "object"
          },
          "preset_send_fallback": {
            "description": "Never published: true sends the shipped block design, false the original shipped layout.",
            "type": "boolean"
          },
          "subject": {
            "description": "The draft’s subject now.",
            "type": "string"
          }
        },
        "type": "object"
      },
      "EmailTemplateDraftSave": {
        "properties": {
          "document": {
            "description": "Preview: the editor’s own format; it may change inside v1. The design: `{ width, themeKey, theme, blocks }`, as `document` of `GET /email-templates/{key}` (keys as the editor names them; each block’s `props` as `block_defaults`).",
            "type": "object",
            "x-stability": "preview"
          },
          "name": {
            "description": "Up to 120 characters.",
            "type": "string"
          },
          "subject": {
            "description": "Up to 200 characters, with merge fields (`variables[].merge_field` of `GET /email-templates/{key}`).",
            "type": "string"
          }
        },
        "required": ["document"],
        "type": "object"
      },
      "EmailTemplateDraftSaved": {
        "properties": {
          "has_published_version": {
            "description": "A published version is live.",
            "type": "boolean"
          },
          "has_unpublished_changes": {
            "description": "The draft differs from what customers receive now.",
            "type": "boolean"
          },
          "key": {
            "type": "string"
          },
          "live_misses_brand_color": {
            "description": "The live version was published before buttons took the brand colour: publish again to use it.",
            "type": "boolean"
          },
          "live_misses_paid_label": {
            "description": "The live version was published before a paid balance could read “Paid”: publish again to show it.",
            "type": "boolean"
          },
          "live_version": {
            "description": "The version customers receive. Null until the first publish.",
            "nullable": true,
            "properties": {
              "published_at": {
                "format": "date-time",
                "type": "string"
              },
              "version": {
                "type": "integer"
              }
            },
            "type": "object"
          },
          "preset_send_fallback": {
            "description": "Never published: true sends the shipped block design, false the original shipped layout.",
            "type": "boolean"
          },
          "saved_at": {
            "format": "date-time",
            "type": "string"
          }
        },
        "type": "object"
      },
      "EmailTemplateDuplicate": {
        "properties": {
          "name": {
            "description": "The copy’s name, up to 120 characters.",
            "type": "string"
          }
        },
        "required": ["name"],
        "type": "object"
      },
      "EmailTemplateGroup": {
        "properties": {
          "id": {
            "type": "string"
          },
          "key": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "statuses": {
            "description": "The status that sends this group’s email (at most one).",
            "items": {
              "properties": {
                "id": {
                  "type": "string"
                },
                "is_active": {
                  "type": "boolean"
                },
                "name": {
                  "type": "string"
                },
                "notify_on_create": {
                  "description": "It also emails a quote or order created in that status.",
                  "type": "boolean"
                }
              },
              "type": "object"
            },
            "type": "array"
          },
          "system": {
            "description": "Built in: it can be renamed, never deleted.",
            "type": "boolean"
          },
          "templates": {
            "items": {
              "$ref": "#/components/schemas/EmailTemplateSummary"
            },
            "type": "array"
          }
        },
        "type": "object"
      },
      "EmailTemplateGroupCreate": {
        "properties": {
          "confirmed_moves": {
            "description": "A status another group sends now, moved here on purpose: its `id` and that group (`group_id` of `statuses` in `GET /email-template-groups`).",
            "items": {
              "properties": {
                "from_group_id": {
                  "type": "string"
                },
                "status_id": {
                  "type": "string"
                }
              },
              "required": ["status_id", "from_group_id"],
              "type": "object"
            },
            "type": "array"
          },
          "name": {
            "description": "Up to 120 characters.",
            "type": "string"
          },
          "status_ids": {
            "description": "The status that sends it (at most one): an `id` of `statuses` in `GET /email-template-groups`.",
            "items": {
              "type": "string"
            },
            "type": "array"
          }
        },
        "required": ["name"],
        "type": "object"
      },
      "EmailTemplateGroupDeleted": {
        "properties": {
          "deleted": {
            "type": "boolean"
          },
          "id": {
            "type": "string"
          }
        },
        "required": ["id", "deleted"],
        "type": "object"
      },
      "EmailTemplateGroupList": {
        "properties": {
          "brands_module_enabled": {
            "description": "Brands are on: a template can be a brand’s own version.",
            "type": "boolean"
          },
          "default_theme_key": {
            "enum": [
              "ledger",
              "gallery",
              "summary",
              "paper",
              "statement",
              "minimal"
            ],
            "type": "string"
          },
          "items": {
            "items": {
              "$ref": "#/components/schemas/EmailTemplateGroup"
            },
            "type": "array"
          },
          "statuses": {
            "description": "Every active status, and the email group that sends on it now (`group_id`).",
            "items": {
              "properties": {
                "group_id": {
                  "description": "The email group it sends now, or null.",
                  "nullable": true,
                  "type": "string"
                },
                "id": {
                  "type": "string"
                },
                "is_draft": {
                  "description": "Draft never sends an automatic email.",
                  "type": "boolean"
                },
                "name": {
                  "type": "string"
                },
                "notify_on_create": {
                  "type": "boolean"
                }
              },
              "type": "object"
            },
            "type": "array"
          }
        },
        "type": "object"
      },
      "EmailTemplateGroupUpdate": {
        "description": "Only what changes.",
        "properties": {
          "confirmed_moves": {
            "description": "A status another group sends now, moved here on purpose: its `id` and that group (`group_id` of `statuses` in `GET /email-template-groups`).",
            "items": {
              "properties": {
                "from_group_id": {
                  "type": "string"
                },
                "status_id": {
                  "type": "string"
                }
              },
              "required": ["status_id", "from_group_id"],
              "type": "object"
            },
            "type": "array"
          },
          "name": {
            "description": "Up to 120 characters.",
            "type": "string"
          },
          "status_ids": {
            "description": "The status that sends it (at most one; empty clears it): an `id` of `statuses` in `GET /email-template-groups`.",
            "items": {
              "type": "string"
            },
            "type": "array"
          }
        },
        "type": "object"
      },
      "EmailTemplateGroupsReorder": {
        "properties": {
          "group_ids": {
            "description": "Group `id`s from `GET /email-template-groups`, in the new order.",
            "items": {
              "type": "string"
            },
            "type": "array"
          }
        },
        "required": ["group_ids"],
        "type": "object"
      },
      "EmailTemplateList": {
        "properties": {
          "items": {
            "items": {
              "properties": {
                "audience": {
                  "description": "Who it is written for, as `audience` asked.",
                  "enum": ["customer", "vendor"],
                  "type": "string"
                },
                "key": {
                  "description": "What `template_key` takes.",
                  "type": "string"
                },
                "name": {
                  "type": "string"
                },
                "preset": {
                  "description": "The shipped template it is shaped like: its own `key` for a shipped one, the one it was copied from for a copy or brand version. `request-payment` is Request payment (`POST /orders/{id}/payment-requests`), `request-signature` Request signature, `vendor-purchase-order` a purchase order to its vendor. Treat it as open: a new kind may be added.",
                  "type": "string"
                }
              },
              "type": "object"
            },
            "type": "array"
          }
        },
        "type": "object"
      },
      "EmailTemplatePreview": {
        "properties": {
          "bytes": {
            "type": "integer"
          },
          "exceeds_gmail_clip_warning": {
            "description": "Near the size at which Gmail cuts an email short.",
            "type": "boolean"
          },
          "html": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "EmailTemplatePreviewBody": {
        "properties": {
          "apply_theme": {
            "description": "Restyle the design in a theme first, as Change theme would (nothing is saved).",
            "properties": {
              "mode": {
                "description": "`keep`: the template’s blocks, restyled in the theme. `defaults`: the theme’s own block set (a purchase order template keeps its purchase order blocks).",
                "enum": ["keep", "defaults"],
                "type": "string"
              },
              "theme_key": {
                "description": "A theme’s `key`, from `GET /email-themes`.",
                "enum": [
                  "ledger",
                  "gallery",
                  "summary",
                  "paper",
                  "statement",
                  "minimal"
                ],
                "type": "string"
              }
            },
            "required": ["theme_key", "mode"],
            "type": "object"
          },
          "dark": {
            "description": "Render as a dark-mode mail app would.",
            "type": "boolean"
          },
          "document": {
            "description": "Preview: the editor’s own format; it may change inside v1. The design: `{ width, themeKey, theme, blocks }`, as `document` of `GET /email-templates/{key}` (keys as the editor names them; each block’s `props` as `block_defaults`). Left out: `version_id`, else what `published` says, else the draft.",
            "type": "object",
            "x-stability": "preview"
          },
          "message": {
            "description": "Words to show in the message slot, as a composer would send them.",
            "type": "string"
          },
          "order_id": {
            "description": "A quote or order to render with: its `id` (this needs Read quotes or Read orders as well). Left out: sample data.",
            "type": "string"
          },
          "published": {
            "description": "Without `document` or `version_id`: true renders what customers receive (the live version, else the shipped design), never the draft.",
            "type": "boolean"
          },
          "version_id": {
            "description": "A stored version to render: an `id` from `GET /email-templates/{key}/versions`.",
            "type": "string"
          }
        },
        "type": "object"
      },
      "EmailTemplatePublish": {
        "properties": {
          "document": {
            "description": "Preview: the editor’s own format; it may change inside v1. The design: `{ width, themeKey, theme, blocks }`, as `document` of `GET /email-templates/{key}` (keys as the editor names them; each block’s `props` as `block_defaults`). Left out: the saved draft.",
            "type": "object",
            "x-stability": "preview"
          },
          "name": {
            "description": "Up to 120 characters.",
            "type": "string"
          },
          "subject": {
            "description": "Up to 200 characters, with merge fields (`variables[].merge_field` of `GET /email-templates/{key}`). Left out: the draft’s.",
            "type": "string"
          }
        },
        "type": "object"
      },
      "EmailTemplatePublished": {
        "properties": {
          "bytes": {
            "description": "The compiled email’s size.",
            "type": "integer"
          },
          "has_published_version": {
            "description": "A published version is live.",
            "type": "boolean"
          },
          "has_unpublished_changes": {
            "description": "The draft differs from what customers receive now.",
            "type": "boolean"
          },
          "key": {
            "type": "string"
          },
          "live_misses_brand_color": {
            "description": "The live version was published before buttons took the brand colour: publish again to use it.",
            "type": "boolean"
          },
          "live_misses_paid_label": {
            "description": "The live version was published before a paid balance could read “Paid”: publish again to show it.",
            "type": "boolean"
          },
          "live_version": {
            "description": "The version customers receive. Null until the first publish.",
            "nullable": true,
            "properties": {
              "published_at": {
                "format": "date-time",
                "type": "string"
              },
              "version": {
                "type": "integer"
              }
            },
            "type": "object"
          },
          "preset_send_fallback": {
            "description": "Never published: true sends the shipped block design, false the original shipped layout.",
            "type": "boolean"
          },
          "version": {
            "description": "The new version’s number.",
            "type": "integer"
          },
          "version_id": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "EmailTemplateRestore": {
        "properties": {
          "version_id": {
            "description": "An `id` from `GET /email-templates/{key}/versions`.",
            "type": "string"
          }
        },
        "required": ["version_id"],
        "type": "object"
      },
      "EmailTemplateSummary": {
        "properties": {
          "brands": {
            "items": {
              "properties": {
                "id": {
                  "type": "string"
                },
                "name": {
                  "type": "string"
                }
              },
              "type": "object"
            },
            "type": "array"
          },
          "can_send_as_plain_text": {
            "type": "boolean"
          },
          "group_id": {
            "type": "string"
          },
          "has_published_version": {
            "description": "A published version is live.",
            "type": "boolean"
          },
          "has_unpublished_changes": {
            "description": "The draft differs from what customers receive now.",
            "type": "boolean"
          },
          "is_default": {
            "type": "boolean"
          },
          "key": {
            "type": "string"
          },
          "live_misses_brand_color": {
            "description": "The live version was published before buttons took the brand colour: publish again to use it.",
            "type": "boolean"
          },
          "live_misses_paid_label": {
            "description": "The live version was published before a paid balance could read “Paid”: publish again to show it.",
            "type": "boolean"
          },
          "live_version": {
            "description": "The version customers receive. Null until the first publish.",
            "nullable": true,
            "properties": {
              "published_at": {
                "format": "date-time",
                "type": "string"
              },
              "version": {
                "type": "integer"
              }
            },
            "type": "object"
          },
          "name": {
            "type": "string"
          },
          "preset_send_fallback": {
            "description": "Never published: true sends the shipped block design, false the original shipped layout.",
            "type": "boolean"
          },
          "send_as_plain_text": {
            "type": "boolean"
          },
          "subject": {
            "type": "string"
          },
          "system": {
            "type": "boolean"
          },
          "theme_key": {
            "enum": [
              "ledger",
              "gallery",
              "summary",
              "paper",
              "statement",
              "minimal"
            ],
            "type": "string"
          },
          "updated_at": {
            "format": "date-time",
            "type": "string"
          }
        },
        "type": "object"
      },
      "EmailTemplateTest": {
        "properties": {
          "document": {
            "description": "Preview: the editor’s own format; it may change inside v1. The design: `{ width, themeKey, theme, blocks }`, as `document` of `GET /email-templates/{key}` (keys as the editor names them; each block’s `props` as `block_defaults`). Sent instead of `source`.",
            "type": "object",
            "x-stability": "preview"
          },
          "source": {
            "description": "Without `document`: `published` (the default) sends what customers receive, `draft` the saved draft.",
            "enum": ["published", "draft"],
            "type": "string"
          },
          "subject": {
            "description": "Up to 200 characters, with merge fields (`variables[].merge_field` of `GET /email-templates/{key}`).",
            "type": "string"
          },
          "to": {
            "description": "One email address.",
            "type": "string"
          }
        },
        "required": ["to"],
        "type": "object"
      },
      "EmailTemplateTestSent": {
        "properties": {
          "sent": {
            "type": "boolean"
          },
          "to": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "EmailTemplateThemeApply": {
        "properties": {
          "document": {
            "description": "Preview: the editor’s own format; it may change inside v1. The design: `{ width, themeKey, theme, blocks }`, as `document` of `GET /email-templates/{key}` (keys as the editor names them; each block’s `props` as `block_defaults`). Left out: the saved draft.",
            "type": "object",
            "x-stability": "preview"
          },
          "mode": {
            "description": "`keep`: the template’s blocks, restyled in the theme. `defaults`: the theme’s own block set (a purchase order template keeps its purchase order blocks).",
            "enum": ["keep", "defaults"],
            "type": "string"
          },
          "theme_key": {
            "description": "A theme’s `key`, from `GET /email-themes`.",
            "enum": [
              "ledger",
              "gallery",
              "summary",
              "paper",
              "statement",
              "minimal"
            ],
            "type": "string"
          }
        },
        "required": ["theme_key", "mode"],
        "type": "object"
      },
      "EmailTemplateThemed": {
        "properties": {
          "document": {
            "description": "Preview: the editor’s own format; it may change inside v1. The design: `{ width, themeKey, theme, blocks }` (keys as the editor names them; each block’s `props` as `block_defaults`). Send it back changed.",
            "type": "object",
            "x-stability": "preview"
          },
          "key": {
            "type": "string"
          },
          "theme": {
            "properties": {
              "key": {
                "enum": [
                  "ledger",
                  "gallery",
                  "summary",
                  "paper",
                  "statement",
                  "minimal"
                ],
                "type": "string"
              },
              "name": {
                "type": "string"
              }
            },
            "type": "object"
          }
        },
        "type": "object"
      },
      "EmailTemplateUpdate": {
        "description": "Only what changes.",
        "properties": {
          "brand_ids": {
            "description": "The brands this version goes to: `id`s from `GET /brands` (each leaves the version it had in this group). Not for a default.",
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "group_id": {
            "description": "Move it to this email group (an `id` from `GET /email-template-groups`), at its end. Brands another template there has are dropped.",
            "type": "string"
          },
          "is_default": {
            "description": "true: make it its group’s default (it gives up its brands). To stop being the default, make another template the default.",
            "type": "boolean"
          },
          "name": {
            "description": "Up to 120 characters.",
            "type": "string"
          },
          "send_as_plain_text": {
            "description": "Send the message and its link without the design: Request signature and Request payment only.",
            "type": "boolean"
          }
        },
        "type": "object"
      },
      "EmailTemplateVersionList": {
        "properties": {
          "items": {
            "items": {
              "properties": {
                "bytes": {
                  "type": "integer"
                },
                "created_at": {
                  "format": "date-time",
                  "type": "string"
                },
                "id": {
                  "type": "string"
                },
                "is_live": {
                  "type": "boolean"
                },
                "version": {
                  "type": "integer"
                }
              },
              "type": "object"
            },
            "type": "array"
          }
        },
        "type": "object"
      },
      "EmailTemplatesReorder": {
        "properties": {
          "template_keys": {
            "description": "The group’s template `key`s (from `GET /email-template-groups`), in the new order.",
            "items": {
              "type": "string"
            },
            "type": "array"
          }
        },
        "required": ["template_keys"],
        "type": "object"
      },
      "EmailTest": {
        "properties": {
          "attach_document": {
            "description": "Attach the PDF where the template does (default true); false sends none.",
            "type": "boolean"
          },
          "bcc": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "cc": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "include_what_changed": {
            "description": "False leaves out the list of the quote’s changes an email that delivers the quote shows. Default true.",
            "type": "boolean"
          },
          "message": {
            "description": "Your message, up to 50,000 characters, with merge fields (blank lines start paragraphs). Left out: the template’s own.",
            "type": "string"
          },
          "plain_text": {
            "description": "True: this one email as plain text; false: designed. Left out: the template’s own setting.",
            "type": "boolean"
          },
          "subject": {
            "description": "Your subject, up to 200 characters, with merge fields. Left out: the template’s own.",
            "type": "string"
          },
          "template_key": {
            "description": "A customer template’s `key` from `GET /email-templates`. Left out: your own email, `subject` and `message` as typed, with no template.",
            "type": "string"
          },
          "test_to": {
            "description": "The one address the test goes to (yours, or the person’s you work for).",
            "type": "string"
          },
          "to": {
            "description": "Up to 5 addresses; the customer’s own address when left out.",
            "items": {
              "type": "string"
            },
            "type": "array"
          }
        },
        "required": ["test_to"],
        "type": "object"
      },
      "EmailTestSent": {
        "properties": {
          "queued": {
            "description": "True when it carries the PDF: queued, and its result is in the store’s email activity.",
            "type": "boolean"
          },
          "sent": {
            "type": "boolean"
          },
          "to": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "EmailThemeList": {
        "properties": {
          "default_theme_key": {
            "enum": [
              "ledger",
              "gallery",
              "summary",
              "paper",
              "statement",
              "minimal"
            ],
            "type": "string"
          },
          "items": {
            "items": {
              "properties": {
                "default_block_count": {
                  "description": "Blocks in the theme’s own design.",
                  "type": "integer"
                },
                "description": {
                  "type": "string"
                },
                "key": {
                  "enum": [
                    "ledger",
                    "gallery",
                    "summary",
                    "paper",
                    "statement",
                    "minimal"
                  ],
                  "type": "string"
                },
                "name": {
                  "type": "string"
                },
                "palette": {
                  "description": "The theme’s colours and fonts.",
                  "type": "object"
                }
              },
              "type": "object"
            },
            "type": "array"
          }
        },
        "type": "object"
      },
      "EmailVendorReplies": {
        "properties": {
          "enabled": {
            "type": "boolean"
          }
        },
        "required": ["enabled"],
        "type": "object"
      },
      "Empty": {
        "type": "object"
      },
      "Error": {
        "description": "Every failure has this shape (frozen in v1).",
        "properties": {
          "error": {
            "properties": {
              "any_of_scopes": {
                "description": "With SCOPE_MISSING, when one of several scopes would do and the key has none: any one of these ids, on top of `required_scopes`.",
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              "changed": {
                "description": "With that 409: the answer’s fields that changed since the `version` sent (or the old fields, such as `updated_at`, when one of those was sent instead).",
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              "code": {
                "$ref": "#/components/schemas/ErrorCode"
              },
              "message": {
                "description": "For people. It can change at any time.",
                "type": "string"
              },
              "min_version": {
                "description": "With CLIENT_TOO_OLD: the oldest app version still served.",
                "type": "string"
              },
              "problems": {
                "description": "With INVALID_BODY: every missing, unknown or mistyped field the operation’s request schema finds in the body (at most 50), so one retry can fix them all; `message` still names the one the endpoint checked first. With INVALID_PARAMETER for a query parameter the operation doesn’t take: each one sent. With the status map’s VALIDATION: each problem the editor finds, by the connection’s or card’s key, with `connection_key` and `node_key`.",
                "items": {
                  "properties": {
                    "allowed": {
                      "description": "With `value`: the values. With the first `unknown` of each object (or of the query): the names allowed there.",
                      "items": {
                        "type": "string"
                      },
                      "type": "array"
                    },
                    "closest": {
                      "description": "With `unknown`: the allowed name the one sent is a slip of (another case, a letter or two off), or a query synonym (`search` → `q`). Never another real field.",
                      "type": "string"
                    },
                    "connection_key": {
                      "description": "With the status map’s VALIDATION: the connection’s key, or null.",
                      "nullable": true,
                      "type": "string"
                    },
                    "expected": {
                      "description": "With `missing` and `type`: what it takes (`integer`, `array of objects`).",
                      "type": "string"
                    },
                    "field": {
                      "description": "Where: a body path (`lines[0].quantity`) or a query parameter’s name. The status map names its connections and cards by key: `connections[<key>]`, `nodes[<key>]`, or `document` for the whole map.",
                      "type": "string"
                    },
                    "message": {
                      "description": "For people. It can change at any time.",
                      "type": "string"
                    },
                    "node_key": {
                      "description": "With the status map’s VALIDATION: the card’s key, or null.",
                      "nullable": true,
                      "type": "string"
                    },
                    "problem": {
                      "description": "`missing`: required and not sent. `unknown`: no such field or parameter. `type`: the wrong kind of value. `value`: not one of `allowed`.",
                      "enum": ["missing", "unknown", "type", "value"],
                      "type": "string"
                    }
                  },
                  "required": ["field", "problem", "message"],
                  "type": "object"
                },
                "type": "array"
              },
              "reason": {
                "description": "A finer, documented cause, present only where PUBLIC_API.md lists it.",
                "type": "string"
              },
              "required_scopes": {
                "description": "With SCOPE_MISSING: scope ids the API key lacks, every one of them needed (see `any_of_scopes` for a choice). Scopes are chosen when a key is made: a Store administrator makes a key with them in Settings › API and integrations.",
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              "supported": {
                "description": "With UNSUPPORTED_VERSION: the versions this server answers.",
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              "upgrade_url": {
                "description": "With CLIENT_TOO_OLD: where to get the new version.",
                "nullable": true,
                "type": "string"
              },
              "version": {
                "description": "With a stale-version 409 of a write that takes `version` (`STALE_VERSION`, `PURCHASE_ORDER_STALE`, `STALE`, a change request’s decision; `CONFLICT` for a serial number): the record’s version now, as its read answers it (a string; an object for a change request). Check `changed`, then send the change again with it."
              }
            },
            "required": ["code", "message"],
            "type": "object"
          }
        },
        "required": ["error"],
        "type": "object"
      },
      "ErrorCode": {
        "description": "A stable, machine-readable code. Treat the set as open: a code you don’t know is a generic failure of the status’s kind. Match on `code`, never on `message`.",
        "enum": [
          "API_UNAVAILABLE",
          "BUSY",
          "RATE_LIMITED",
          "METHOD_NOT_ALLOWED",
          "UNKNOWN_ENDPOINT",
          "UNSUPPORTED_VERSION",
          "CLIENT_TOO_OLD",
          "ENDPOINT_RETIRED",
          "UNAUTHORIZED",
          "NO_ACCESS",
          "API_NOT_ENABLED",
          "SUBSCRIPTION_REQUIRED",
          "PLAN_REQUIRED",
          "BILLING_UNVERIFIED",
          "NOT_CONFIGURED",
          "SCOPE_MISSING",
          "STAFF_ONLY",
          "IMPORT_ONLY",
          "IMPORT_MODE",
          "INTERNAL",
          "CAP_REACHED",
          "CAP_EXCEEDED",
          "KEY_REQUIRED",
          "ORIGIN_NOT_ALLOWED",
          "ACCESS_DENIED",
          "NOT_FOUND",
          "REFUSED",
          "CONFLICT",
          "VALIDATION",
          "RULE_REFUSED",
          "INVALID_BODY",
          "INVALID_REQUEST",
          "INVALID_ID",
          "INVALID_KEY",
          "INVALID_FIELD_VALUE",
          "INVALID_OPTION_VALUE",
          "INVALID_MAX",
          "INVALID_IDLE",
          "INVALID_EXPIRY",
          "INVALID_CURSOR",
          "INVALID_LIMIT",
          "INVALID_PAGE",
          "INVALID_PARAMETER",
          "INVALID_UPDATED_SINCE",
          "INVALID_RANGE",
          "INVALID_UPLOAD_TOKEN",
          "BODY_TOO_LARGE",
          "URI_TOO_LONG",
          "LENGTH_REQUIRED",
          "REQUEST_TIMEOUT",
          "UNSUPPORTED_MEDIA_TYPE",
          "IDEMPOTENCY_KEY_REQUIRED",
          "INVALID_IDEMPOTENCY_KEY",
          "IDEMPOTENCY_KEY_REUSED",
          "REQUEST_IN_PROGRESS",
          "OUTCOME_UNKNOWN",
          "REQUEST_COMPLETED_NOT_STORED",
          "INVALID_GRANT",
          "EXPIRED_CODE",
          "UNSUPPORTED_GRANT_TYPE",
          "AUTHORIZATION_PENDING",
          "ALREADY_SCANNED",
          "PAIRING_NOT_WAITING",
          "PAIRING_CLAIMED",
          "NO_SCOPES",
          "STAFF_NOT_LINKED",
          "STALE_VERSION",
          "STATUS_CONFLICT",
          "ORDER_LOCKED",
          "QUOTE_SIGNED",
          "LOCATION_LOCKED",
          "LOCATION_REQUIRED",
          "LIST_OUT_OF_DATE",
          "SAVE_IN_PROGRESS",
          "SAVE_LOCK_UNAVAILABLE",
          "SYNC_IN_PROGRESS",
          "SPLIT_PENDING",
          "CONVERSION_IN_PROGRESS",
          "BULK_STATUS_LOCKED",
          "UNKNOWN_STATUS",
          "STATUS_NOT_ALLOWED",
          "UNKNOWN_LINE",
          "UNKNOWN_TEMPLATE",
          "UNKNOWN_OPTION",
          "UNKNOWN_FIELD",
          "UNKNOWN_FEE_TEMPLATE",
          "UNKNOWN_FEE",
          "UNKNOWN_INTENT",
          "LOCATION_NOT_FOUND",
          "CUSTOMER_NOT_FOUND",
          "ADDRESS_NOT_FOUND",
          "ATTACHMENT_NOT_FOUND",
          "TERMS_NOT_FOUND",
          "LINE_NOT_FOUND",
          "LINE_UNAVAILABLE",
          "LINE_EXCLUDED",
          "LINE_VENDOR_MISMATCH",
          "SKU_NOT_FOUND",
          "SKU_AMBIGUOUS",
          "CUSTOMER_AMBIGUOUS",
          "OPTION_AMBIGUOUS",
          "SKU_EXISTS",
          "UNKNOWN_CATEGORY",
          "CUSTOMER_INCOMPLETE",
          "CUSTOMER_REFUSED",
          "NO_CUSTOMER",
          "NO_RECIPIENT",
          "NO_THREAD_YET",
          "NOTHING_TO_ANSWER",
          "NO_FILES_ON_VENDOR_REPLIES",
          "REPLY_REFUSED",
          "REPLY_REQUIRED",
          "NOT_APPLICABLE",
          "ADDRESS_REFUSED",
          "CONVERSION_REFUSED",
          "DELETE_REFUSED",
          "DROPSHIP_REFUSED",
          "CHARGE_ALLOCATION_REFUSED",
          "BULK_STATUS_KIND_REFUSED",
          "TEMPLATE_REFUSED",
          "TEMPLATE_UNPRICED",
          "OPTION_UNSUPPORTED",
          "FIELD_UNSUPPORTED",
          "TERMS_UNSUPPORTED",
          "REQUIREMENTS_NOT_MET",
          "CURRENCY_MISMATCH",
          "SHOP_CURRENCY_UNKNOWN",
          "DELIVERY_NOT_READY",
          "DUPLICATE_VENDOR",
          "VENDOR_MINIMUM",
          "PURCHASE_ORDER_STALE",
          "PURCHASE_ORDER_REFUSED",
          "FEATURE_DISABLED",
          "BRANDS_OFF",
          "WEBHOOK_OFF",
          "WEBHOOKS_UNAVAILABLE",
          "PLUS_REQUIRED",
          "PAYMENT_REFUSED",
          "PAYMENT_REQUEST_OPEN",
          "PAYMENT_PROVIDER_MISSING",
          "PAYMENT_REQUEST_REFUSED",
          "LINK_REFUSED",
          "REFUND_FAILED",
          "REFUND_REFUSED",
          "REFUND_NOT_SENT",
          "REFUND_PARTIAL",
          "SETTLE_FAILED",
          "RETURN_REFUSED",
          "FILE_TOO_BIG",
          "FILE_TOO_LARGE",
          "FILE_TYPE",
          "FILE_IN_USE",
          "FILE_UNAVAILABLE",
          "NO_FILE",
          "NOT_AN_IMAGE",
          "NOT_STORED",
          "UPLOAD_FAILED",
          "STORAGE_FAILED",
          "CLEANUP_FAILED",
          "PDF_UNAVAILABLE",
          "REPORT_TIMEOUT",
          "UPLOAD_NOT_FOUND",
          "NOT_VALIDATED",
          "IMPORT_IN_PROGRESS",
          "IMPORT_ENDED",
          "IMPORT_NEEDS_REVIEW",
          "ROWS_OUT_OF_ORDER",
          "STALE",
          "LINE_GONE",
          "NO_CHANGE",
          "VALIDATION_ERROR",
          "DUPLICATE_OPERATION",
          "OPEN_TO_APPLY",
          "SAVED_STILL_OPEN",
          "NOT_ACCEPTABLE",
          "LEGS_REQUIRED",
          "SEND_REFUSED",
          "VALUE_NOT_OFFERED",
          "SAVE_REFUSED",
          "SHOPIFY_UNAVAILABLE",
          "QUICKBOOKS_UNAVAILABLE",
          "QUEUE_FAILED",
          "DELETE_FAILED",
          "NUMBERING_PREFIX_CONFLICT",
          "IN_USE",
          "FIELD_REFUSED",
          "FIELD_NOT_PLACED",
          "NOTES_FULL",
          "PDF_NOT_READY",
          "SIGNATURE_PURGED",
          "SCAN_REFUSED",
          "SCAN_EXISTS",
          "SCHEDULE_CONFLICT",
          "SCHEDULE_REFUSED",
          "SIGNED_COPY_REFUSED",
          "ORIGINAL_TOO_LARGE",
          "SETUP_REFUSED",
          "EMAIL_NOT_SET_UP",
          "DOMAIN_REPLACE_REQUIRED",
          "CONFIRMATION_REQUIRED"
        ],
        "type": "string"
      },
      "FeeTemplateList": {
        "properties": {
          "items": {
            "items": {
              "properties": {
                "id": {
                  "type": "string"
                },
                "name": {
                  "type": "string"
                },
                "physical": {
                  "type": "boolean"
                },
                "taxable": {
                  "type": "boolean"
                },
                "type": {
                  "enum": [
                    "fixed_amount",
                    "percent_of_discounted_price",
                    "percent_of_total",
                    "percent_of_retail_price"
                  ],
                  "type": "string"
                },
                "value": {
                  "type": "number"
                }
              },
              "type": "object"
            },
            "type": "array"
          }
        },
        "type": "object"
      },
      "File": {
        "properties": {
          "id": {
            "description": "This API’s id for the file: what `GET /files/{id}` takes.",
            "type": "string"
          },
          "shopify_file_id": {
            "description": "The Shopify file id (a `MediaImage` gid).",
            "type": "string"
          },
          "status": {
            "description": "`processing` while Shopify works on the file (`url` is null), `ready` with its `url`, `failed` when Shopify couldn’t process it (upload it again, or another picture).",
            "enum": ["processing", "ready", "failed"],
            "type": "string"
          },
          "url": {
            "description": "The file’s Shopify Files URL (https://cdn.shopify.com/…) once `ready`: what a template’s images take.",
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "FileFromUrl": {
        "description": "A file sent as its address instead of multipart form data: fetched from a public https address (a private or local one is refused, and so is one that redirects there; up to three redirects), a photo (JPEG, PNG, WebP or GIF) or a PDF by its bytes, within the upload’s own size limit.",
        "properties": {
          "file_name": {
            "description": "The name to keep it under (up to 255 characters; its extension becomes the one its bytes are). Default: the address’s last part.",
            "nullable": true,
            "type": "string"
          },
          "url": {
            "description": "Where the file is: a public https address (up to 2,048 characters). A key fetches at most 50 files from web addresses a day, each counted before it is fetched (`403 CAP_EXCEEDED`, `reason` `daily_url_fetches`).",
            "type": "string"
          }
        },
        "required": ["url"],
        "type": "object"
      },
      "FileUpload": {
        "properties": {
          "alt": {
            "description": "The picture’s alt text in Shopify (up to 512 characters).",
            "nullable": true,
            "type": "string"
          },
          "url": {
            "description": "Where the picture is: a public https address (up to 2,048 characters). Up to three redirects are followed. A key fetches at most 50 files from web addresses a day, each counted before it is fetched (`403 CAP_EXCEEDED`, `reason` `daily_url_fetches`).",
            "type": "string"
          }
        },
        "required": ["url"],
        "type": "object"
      },
      "FileUploaded": {
        "properties": {
          "alt": {
            "nullable": true,
            "type": "string"
          },
          "filename": {
            "description": "The file’s name in Shopify, from the address’s last part.",
            "type": "string"
          },
          "format": {
            "description": "The picture’s format, read from its bytes.",
            "enum": ["jpeg", "png", "webp", "gif"],
            "type": "string"
          },
          "id": {
            "description": "This API’s id for the file: what `GET /files/{id}` takes.",
            "type": "string"
          },
          "shopify_file_id": {
            "description": "The Shopify file id (a `MediaImage` gid).",
            "type": "string"
          },
          "size_bytes": {
            "type": "integer"
          },
          "source_url": {
            "description": "The address the picture was fetched from, after any redirects.",
            "type": "string"
          },
          "status": {
            "description": "`processing` while Shopify works on the file (`url` is null), `ready` with its `url`, `failed` when Shopify couldn’t process it (upload it again, or another picture).",
            "enum": ["processing", "ready", "failed"],
            "type": "string"
          },
          "url": {
            "description": "The file’s Shopify Files URL (https://cdn.shopify.com/…) once `ready`: what a template’s images take.",
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "ForceConvert": {
        "properties": {
          "already_converted": {
            "description": "True when an earlier Force Convert had placed it already: nothing new was done.",
            "type": "boolean"
          },
          "id": {
            "type": "string"
          },
          "message": {
            "type": "string"
          },
          "state": {
            "description": "`converting`: on the queue (read `GET /orders/{id}/force-convert`). `placed`: done already.",
            "enum": ["converting", "placed"],
            "type": "string"
          }
        },
        "type": "object"
      },
      "ForceConvertStatus": {
        "properties": {
          "id": {
            "type": "string"
          },
          "message": {
            "description": "Why it failed (`failed` only).",
            "nullable": true,
            "type": "string"
          },
          "state": {
            "enum": ["placed", "converting", "failed", "idle"],
            "type": "string"
          }
        },
        "type": "object"
      },
      "FulfillmentList": {
        "properties": {
          "items": {
            "items": {
              "properties": {
                "delivered": {
                  "description": "Units handed over to the customer.",
                  "type": "integer"
                },
                "delivered_at": {
                  "description": "When each delivered unit was handed over.",
                  "items": {
                    "format": "date-time",
                    "type": "string"
                  },
                  "type": "array"
                },
                "fulfilled": {
                  "description": "Units in a Shopify fulfilment.",
                  "type": "integer"
                },
                "line_id": {
                  "description": "A line id from the order read.",
                  "type": "string"
                },
                "ordered": {
                  "type": "integer"
                }
              },
              "type": "object"
            },
            "type": "array"
          }
        },
        "type": "object"
      },
      "HandoverCreate": {
        "properties": {
          "lines": {
            "description": "The lines that leave (up to 100), each once. Left out: every waiting unit of the order.",
            "items": {
              "properties": {
                "line_id": {
                  "description": "A line id from the order read.",
                  "type": "string"
                },
                "quantity": {
                  "description": "How many of its waiting units leave (1 or more). Left out: all.",
                  "type": "integer"
                }
              },
              "required": ["line_id"],
              "type": "object"
            },
            "type": "array"
          },
          "method": {
            "description": "How the units left: collected at the store, or delivered.",
            "enum": ["collected", "delivered"],
            "type": "string"
          }
        },
        "required": ["method"],
        "type": "object"
      },
      "HandoverCreated": {
        "properties": {
          "handover_ids": {
            "description": "The hand-overs recorded: one, or one per part of an order split in two for tax. Each is in `marks.applying` of `GET /orders/{id}/handovers` until Shopify has it.",
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "message": {
            "description": "“Marked delivered”.",
            "type": "string"
          },
          "method": {
            "enum": ["collected", "delivered"],
            "type": "string"
          }
        },
        "type": "object"
      },
      "HandoverView": {
        "properties": {
          "hold_reason": {
            "description": "Why units that would be waiting are `held` (the order isn’t a Shopify order yet, or Shopify fulfilled part of it before OrderPilot counted units). Null when nothing holds them.",
            "nullable": true,
            "type": "string"
          },
          "lines": {
            "items": {
              "properties": {
                "held": {
                  "description": "Would be waiting, but can’t leave from OrderPilot (`hold_reason`).",
                  "type": "integer"
                },
                "last_left_at": {
                  "format": "date-time",
                  "nullable": true,
                  "type": "string"
                },
                "line_id": {
                  "description": "A line id from the order read.",
                  "type": "string"
                },
                "not_started": {
                  "description": "Nothing has happened to them yet: unpaid stock, or not on a PO.",
                  "type": "integer"
                },
                "on_order": {
                  "description": "On a purchase order that hasn’t brought them in yet.",
                  "type": "integer"
                },
                "quantity": {
                  "type": "integer"
                },
                "taken": {
                  "description": "Left the store: fulfilled, collected or delivered.",
                  "type": "integer"
                },
                "title": {
                  "description": "With the variant (“Accent Chair · Moss”).",
                  "type": "string"
                },
                "waiting": {
                  "description": "Ready and paid for (or arrived), not collected or delivered yet.",
                  "type": "integer"
                },
                "waiting_since": {
                  "format": "date-time",
                  "nullable": true,
                  "type": "string"
                }
              },
              "type": "object"
            },
            "type": "array"
          },
          "marks": {
            "properties": {
              "applying": {
                "description": "Hand-overs still being sent to Shopify, by id (`handover_ids`).",
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              "failed": {
                "description": "Hand-overs Shopify refused, by id: staff look at them in OrderPilot.",
                "items": {
                  "type": "string"
                },
                "type": "array"
              }
            },
            "type": "object"
          }
        },
        "type": "object"
      },
      "ImportDraft": {
        "properties": {
          "batch_id": {
            "description": "The send this draft is part of.",
            "type": "string"
          },
          "counts": {
            "description": "Records are what the rows make (a template spans many rows). `new`, `updates`, `unchanged` and `needs_fix` are known once it is checked: `updates` and `unchanged` are records already in the store (in OrderPilot, or in Shopify after an earlier migration). `imported`, `failed` and `skipped` (already in the store, left as they are by the merchant’s choice) once the merchant imports it.",
            "properties": {
              "failed": {
                "type": "integer"
              },
              "imported": {
                "type": "integer"
              },
              "needs_fix": {
                "type": "integer"
              },
              "new": {
                "type": "integer"
              },
              "records": {
                "type": "integer"
              },
              "rows": {
                "type": "integer"
              },
              "skipped": {
                "type": "integer"
              },
              "unchanged": {
                "type": "integer"
              },
              "updates": {
                "type": "integer"
              }
            },
            "required": [
              "rows",
              "records",
              "new",
              "updates",
              "unchanged",
              "needs_fix",
              "imported",
              "failed",
              "skipped"
            ],
            "type": "object"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "created_by": {
            "description": "The person who uploaded it, to a key that may read the staff (`GET /staff`); null for an assistant’s draft, and to any other key.",
            "nullable": true,
            "type": "string"
          },
          "existing_choice": {
            "description": "The merchant’s sign-off on the review page for records already in the store: `update` (write the new information into them) or `skip` (leave them as they are). Null until the merchant chooses; a key can’t choose it.",
            "enum": ["update", "skip", null],
            "nullable": true,
            "type": "string"
          },
          "expires_at": {
            "description": "When a draft nobody imports or discards closes by itself.",
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "failure": {
            "description": "Why the import stopped (`failed`), with the next step.",
            "nullable": true,
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "import_mode": {
            "$ref": "#/components/schemas/ImportModeNote"
          },
          "imported_at": {
            "description": "When the merchant clicked Import.",
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "imported_by": {
            "description": "The person who clicked Import, to a key that may read the staff (`GET /staff`); null until then, and to any other key.",
            "nullable": true,
            "type": "string"
          },
          "kind": {
            "description": "The kind of data: `products` (Shopify products), `product_templates`, `options`, `categories`, `customers`, `vendors`, `stock` (stock on hand), `quotes`, `orders`, `purchase_orders` or `warranty_claims`.",
            "enum": [
              "products",
              "product_templates",
              "options",
              "categories",
              "customers",
              "vendors",
              "stock",
              "quotes",
              "orders",
              "purchase_orders",
              "warranty_claims"
            ],
            "type": "string"
          },
          "mine": {
            "description": "Only on `GET /imports` and `GET /imports/{id}`: this key made it (its own draft). Only its own drafts take rows, checks and sends.",
            "type": "boolean"
          },
          "next_start": {
            "description": "The `start` of the next `POST /imports/{id}/rows`: one past the last row stored (a draft’s rows are numbered from 2 with no gap, CSV ones too). Null for a person’s upload.",
            "nullable": true,
            "type": "integer"
          },
          "records": {
            "allOf": [
              {
                "$ref": "#/components/schemas/ImportedRecordList"
              }
            ],
            "description": "Only on `GET /imports/{id}`, once the merchant clicked Import (`importing`, `imported`, `failed`): the records it made or updated, in row order, a page at a time."
          },
          "review_url": {
            "description": "The review page in the store’s Shopify admin, once the draft is sent (`ready` or later). Give it to the merchant written out in full.",
            "nullable": true,
            "type": "string"
          },
          "sent_at": {
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "source": {
            "description": "Where it came from: a person’s file uploaded on Settings › Import data (`upload`), or an assistant’s draft (`assistant`).",
            "enum": ["upload", "assistant"],
            "type": "string"
          },
          "source_name": {
            "description": "The name the review page shows it came from: this key’s name.",
            "type": "string"
          },
          "status": {
            "description": "`drafting` (taking rows), `checking`, `checked` (ready to send), `ready` (sent: Ready to review), `importing`, `imported`, `failed` (the import stopped part way; `failure` says why), `discarded` or `expired`.",
            "enum": [
              "uploading",
              "drafting",
              "checking",
              "checked",
              "ready",
              "importing",
              "imported",
              "failed",
              "discarded",
              "expired"
            ],
            "type": "string"
          }
        },
        "required": [
          "id",
          "kind",
          "status",
          "batch_id",
          "source_name",
          "counts",
          "review_url",
          "created_at",
          "sent_at",
          "expires_at",
          "failure",
          "existing_choice",
          "source",
          "created_by",
          "imported_at",
          "imported_by",
          "next_start"
        ],
        "type": "object"
      },
      "ImportDraftCreate": {
        "properties": {
          "batch_id": {
            "description": "The `batch_id` of one of this key’s sends, to add these drafts to it (the merchant reviews them together). Left out: a new send.",
            "type": "string"
          },
          "check": {
            "description": "`true`: check each draft with rows once they are in (it answers `checking`). Left out: check it later with `POST /imports/{id}/check`.",
            "type": "boolean"
          },
          "csv": {
            "description": "The rows as CSV text, in place of `rows`: the file’s header row, then its rows (commas, semicolons or tabs). A header names a column by its header, `key` or alias, ignoring case and spaces, as an upload does; a column the kind doesn’t use is named in a note. 500 rows a call in all.",
            "type": "string"
          },
          "kind": {
            "description": "The kind of data: `products` (Shopify products), `product_templates`, `options`, `categories`, `customers`, `vendors`, `stock` (stock on hand), `quotes`, `orders`, `purchase_orders` or `warranty_claims`. One kind’s draft; for several at once, send `kinds` instead.",
            "enum": [
              "products",
              "product_templates",
              "options",
              "categories",
              "customers",
              "vendors",
              "stock",
              "quotes",
              "orders",
              "purchase_orders",
              "warranty_claims"
            ],
            "type": "string"
          },
          "kinds": {
            "description": "Several kinds at once, in place of `kind`: by kind, each with the `rows` or `csv`, `last`, `settled` and `open` a one-kind create takes (`{ \"vendors\": { \"rows\": [...] }, \"categories\": { \"csv\": \"...\" } }`). They are one send: there is no `batch_id` to pass on. The answer is the first draft in review order, and `drafts` lists each.",
            "type": "object"
          },
          "last": {
            "description": "As on `POST /imports/{id}/rows`: these are all the rows. A new draft has no rows after them, so it changes nothing here.",
            "type": "boolean"
          },
          "open": {
            "description": "What you still ask the merchant about this data, as `POST /imports/{id}/questions` takes it: each `{ text, rows }`, the rows it is about (left out: the whole file).",
            "items": {
              "properties": {
                "rows": {
                  "description": "The rows it is about (the first is 2).",
                  "items": {
                    "type": "integer"
                  },
                  "type": "array"
                },
                "text": {
                  "description": "The question as you ask it in the chat.",
                  "type": "string"
                }
              },
              "required": ["text"],
              "type": "object"
            },
            "type": "array"
          },
          "rows": {
            "description": "Rows, in order: row 2 first (row 1 is the header). 500 rows a call in all.",
            "items": {
              "description": "One row: each cell by its column `key` (the guide’s columns), a string, number, true or false. A blank cell (or null) keeps what is in OrderPilot; exactly `CLEAR` empties the field.",
              "type": "object"
            },
            "type": "array"
          },
          "settled": {
            "description": "What you and the merchant settled in the chat about this data, up to 50 points, each title and answer up to 1,000 characters. The review page lists them read-only by title, so the merchant isn’t asked again.",
            "items": {
              "properties": {
                "answer": {
                  "description": "What was settled, as one plain sentence: “Leave the 16 missing line prices blank for the merchant to fill in.”",
                  "type": "string"
                },
                "question": {
                  "description": "A short title for the point, a few words: “Missing prices”, “Currency”. Settling the same title again replaces its answer.",
                  "type": "string"
                }
              },
              "required": ["question", "answer"],
              "type": "object"
            },
            "type": "array"
          }
        },
        "type": "object"
      },
      "ImportGuide": {
        "properties": {
          "guide": {
            "description": "The import guide, as Markdown.",
            "type": "string"
          },
          "kinds": {
            "description": "The kinds asked for (`kinds`), in the order the merchant reviews them; none without `kinds`.",
            "items": {
              "$ref": "#/components/schemas/ImportGuideKind"
            },
            "type": "array"
          }
        },
        "required": ["guide", "kinds"],
        "type": "object"
      },
      "ImportGuideColumn": {
        "properties": {
          "aliases": {
            "description": "Other headers a CSV may use for it.",
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "cost": {
            "description": "A cost: it may be sent; the preview shows it back only to a key with See costs or Enter and correct costs, and no problem shows its value.",
            "type": "boolean"
          },
          "example": {
            "type": "string"
          },
          "header": {
            "description": "The CSV template’s header.",
            "type": "string"
          },
          "help": {
            "type": "string"
          },
          "key": {
            "description": "What a row’s cell is keyed by.",
            "type": "string"
          },
          "need": {
            "description": "`one_of`: at least one of the columns sharing its `one_of` group is needed.",
            "enum": ["required", "optional", "one_of"],
            "type": "string"
          },
          "one_of": {
            "description": "The group, with `need` `one_of` (`Email or phone`).",
            "nullable": true,
            "type": "string"
          }
        },
        "required": [
          "key",
          "header",
          "aliases",
          "need",
          "one_of",
          "help",
          "example",
          "cost"
        ],
        "type": "object"
      },
      "ImportGuideKind": {
        "properties": {
          "columns": {
            "items": {
              "$ref": "#/components/schemas/ImportGuideColumn"
            },
            "type": "array"
          },
          "kind": {
            "description": "The kind of data: `products` (Shopify products), `product_templates`, `options`, `categories`, `customers`, `vendors`, `stock` (stock on hand), `quotes`, `orders`, `purchase_orders` or `warranty_claims`.",
            "enum": [
              "products",
              "product_templates",
              "options",
              "categories",
              "customers",
              "vendors",
              "stock",
              "quotes",
              "orders",
              "purchase_orders",
              "warranty_claims"
            ],
            "type": "string"
          },
          "label": {
            "type": "string"
          },
          "links_to": {
            "description": "The kinds this kind’s records link to.",
            "items": {
              "description": "The kind of data: `products` (Shopify products), `product_templates`, `options`, `categories`, `customers`, `vendors`, `stock` (stock on hand), `quotes`, `orders`, `purchase_orders` or `warranty_claims`.",
              "enum": [
                "products",
                "product_templates",
                "options",
                "categories",
                "customers",
                "vendors",
                "stock",
                "quotes",
                "orders",
                "purchase_orders",
                "warranty_claims"
              ],
              "type": "string"
            },
            "type": "array"
          },
          "match_rule": {
            "description": "How a row finds the record it updates.",
            "type": "string"
          },
          "multi_row": {
            "description": "How more rows add to one record, when they can.",
            "nullable": true,
            "type": "string"
          }
        },
        "required": [
          "kind",
          "label",
          "match_rule",
          "multi_row",
          "links_to",
          "columns"
        ],
        "type": "object"
      },
      "ImportList": {
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/ImportDraft"
            },
            "type": "array"
          },
          "limit": {
            "type": "integer"
          },
          "next_offset": {
            "nullable": true,
            "type": "integer"
          },
          "offset": {
            "type": "integer"
          },
          "total": {
            "type": "integer"
          }
        },
        "required": ["items", "total", "offset", "limit", "next_offset"],
        "type": "object"
      },
      "ImportMode": {
        "description": "This connection’s import mode: while it is on, its writes other than the import calls are refused (`409 IMPORT_MODE`), so every change goes in an import draft.",
        "properties": {
          "message": {
            "description": "What it means for your next calls.",
            "type": "string"
          },
          "on": {
            "description": "Whether import mode is on for this connection.",
            "type": "boolean"
          },
          "since": {
            "description": "When it was turned on; null while it is off.",
            "format": "date-time",
            "nullable": true,
            "type": "string"
          }
        },
        "required": ["on", "since", "message"],
        "type": "object"
      },
      "ImportModeNote": {
        "description": "Only while this connection’s import mode is on (`POST /imports/mode/start`): since when, and a one-line reminder that its direct changes are refused until it is ended. On the answer that turned it on, `message` says so.",
        "properties": {
          "message": {
            "description": "The reminder, to follow.",
            "type": "string"
          },
          "since": {
            "format": "date-time",
            "type": "string"
          }
        },
        "required": ["since", "message"],
        "type": "object"
      },
      "ImportPreview": {
        "properties": {
          "batch_id": {
            "description": "The send these drafts are part of.",
            "type": "string"
          },
          "filter": {
            "description": "The filter the records were picked by.",
            "enum": ["all", "create", "update", "needs_fix", "questions"],
            "type": "string"
          },
          "import_mode": {
            "$ref": "#/components/schemas/ImportModeNote"
          },
          "kinds": {
            "description": "One per kind, in the order the merchant reviews them (products first: they bring the photos).",
            "items": {
              "$ref": "#/components/schemas/ImportPreviewKind"
            },
            "type": "array"
          },
          "message": {
            "description": "What to show the merchant, word for word, when the chat draws no card: the counts of each kind and (before the drafts are sent) “Anything to change? Say go and I’ll send them.”",
            "type": "string"
          },
          "preview_url": {
            "description": "Always null: OrderPilot has no admin page for the preview. Kept so callers that read it don’t break. Without the card, show `message`; once the drafts are sent, give each draft’s `review_url`.",
            "nullable": true,
            "type": "string"
          }
        },
        "required": ["batch_id", "filter", "kinds", "preview_url", "message"],
        "type": "object"
      },
      "ImportPreviewField": {
        "properties": {
          "change": {
            "enum": ["added", "changed", "cleared", "same"],
            "type": "string"
          },
          "key": {
            "description": "The column `key`.",
            "type": "string"
          },
          "label": {
            "type": "string"
          },
          "new": {
            "description": "What it will be, ready to show; null when emptied.",
            "nullable": true,
            "type": "string"
          },
          "old": {
            "description": "What is there now, ready to show; null when empty or new.",
            "nullable": true,
            "type": "string"
          },
          "section": {
            "description": "A heading the field sits under (`Contact`, `Address`), when the kind groups them.",
            "nullable": true,
            "type": "string"
          }
        },
        "required": ["key", "label", "section", "old", "new", "change"],
        "type": "object"
      },
      "ImportPreviewKind": {
        "properties": {
          "draft": {
            "$ref": "#/components/schemas/ImportDraft"
          },
          "kind": {
            "description": "The kind of data: `products` (Shopify products), `product_templates`, `options`, `categories`, `customers`, `vendors`, `stock`, `quotes`, `orders`, `purchase_orders` or `warranty_claims`.",
            "enum": [
              "products",
              "product_templates",
              "options",
              "categories",
              "customers",
              "vendors",
              "stock",
              "quotes",
              "orders",
              "purchase_orders",
              "warranty_claims"
            ],
            "type": "string"
          },
          "label": {
            "description": "Plural, title case: `Product templates`.",
            "type": "string"
          },
          "many": {
            "description": "Plural, lower case: `product templates`.",
            "type": "string"
          },
          "next_offset": {
            "description": "The `offset` of the next page; null on the last.",
            "nullable": true,
            "type": "integer"
          },
          "offset": {
            "type": "integer"
          },
          "one": {
            "description": "Singular, lower case: `product template`.",
            "type": "string"
          },
          "questions": {
            "description": "Your open questions about this kind’s data, as last set.",
            "items": {
              "$ref": "#/components/schemas/ImportPreviewQuestion"
            },
            "type": "array"
          },
          "records": {
            "description": "This page of the kind’s records matching `filter`, in row order.",
            "items": {
              "$ref": "#/components/schemas/ImportPreviewRecord"
            },
            "type": "array"
          },
          "total": {
            "description": "Records matching `filter`.",
            "type": "integer"
          }
        },
        "required": [
          "kind",
          "label",
          "one",
          "many",
          "draft",
          "questions",
          "records",
          "offset",
          "total",
          "next_offset"
        ],
        "type": "object"
      },
      "ImportPreviewLink": {
        "properties": {
          "label": {
            "description": "Its name as the record has it: `Fabric`, `Hannah Brooks`.",
            "type": "string"
          },
          "state": {
            "description": "`linked`: found in OrderPilot. `in_this_send`: arrives with another kind of this send. `missing`: not in OrderPilot yet; the link is made when it arrives.",
            "enum": ["linked", "in_this_send", "missing"],
            "type": "string"
          },
          "to": {
            "description": "What it points at: an import kind, or `staff`, `location`, `shopify_product` or `status`.",
            "type": "string"
          }
        },
        "required": ["to", "label", "state"],
        "type": "object"
      },
      "ImportPreviewProblem": {
        "properties": {
          "code": {
            "description": "A stable snake_case code for the kind of problem. Treat the set as open.",
            "type": "string"
          },
          "column": {
            "description": "The column `key` it is about, when it is about one.",
            "nullable": true,
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "message": {
            "description": "What is wrong, one plain sentence.",
            "type": "string"
          },
          "next_step": {
            "description": "How to fix it.",
            "type": "string"
          },
          "severity": {
            "description": "`fix` holds the record back until it is fixed; `note` imports anyway.",
            "enum": ["fix", "note"],
            "type": "string"
          }
        },
        "required": [
          "id",
          "column",
          "code",
          "message",
          "next_step",
          "severity"
        ],
        "type": "object"
      },
      "ImportPreviewQuestion": {
        "properties": {
          "id": {
            "type": "string"
          },
          "record_ids": {
            "description": "The records it is about; empty for a question about the whole file.",
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "record_ids_more": {
            "description": "Only in the MCP tool’s card data when it was cut to fit about 200 KB: the record ids left out (`record_ids` keeps those of the records shown, or one).",
            "type": "integer"
          },
          "rows": {
            "description": "Spreadsheet row numbers: the header is row 1, the first data row 2.",
            "items": {
              "type": "integer"
            },
            "type": "array"
          },
          "rows_more": {
            "description": "The same: the rows left out (`rows` keeps the first 20, or none when the card holds only the counts).",
            "type": "integer"
          },
          "text": {
            "type": "string"
          }
        },
        "required": ["id", "text", "record_ids", "rows"],
        "type": "object"
      },
      "ImportPreviewRecord": {
        "properties": {
          "action": {
            "description": "What Import does: makes it, updates the record it matched, or nothing.",
            "enum": ["create", "update", "unchanged"],
            "type": "string"
          },
          "existing_in": {
            "description": "Where the record already is, when it is: an update says where it was found (an earlier migration may have put it in Shopify only). The merchant decides on the review page whether existing records are updated or left as they are.",
            "enum": ["orderpilot", "shopify", "both", null],
            "nullable": true,
            "type": "string"
          },
          "fields": {
            "description": "Each field as it is now and as it will be. A cost field only for a key with See costs or Enter and correct costs. An option’s values are in `values_table`, not repeated here; a value past the table’s cap keeps its fields.",
            "items": {
              "$ref": "#/components/schemas/ImportPreviewField"
            },
            "type": "array"
          },
          "id": {
            "type": "string"
          },
          "image_url": {
            "description": "A picture: the photo link from the row, or the existing record’s.",
            "nullable": true,
            "type": "string"
          },
          "links": {
            "items": {
              "$ref": "#/components/schemas/ImportPreviewLink"
            },
            "type": "array"
          },
          "position": {
            "description": "1-based place in the draft, in row order.",
            "type": "integer"
          },
          "problem_count": {
            "type": "integer"
          },
          "problems": {
            "items": {
              "$ref": "#/components/schemas/ImportPreviewProblem"
            },
            "type": "array"
          },
          "rows": {
            "description": "Spreadsheet row numbers: the header is row 1, the first data row 2.",
            "items": {
              "type": "integer"
            },
            "type": "array"
          },
          "status": {
            "enum": [
              "pending",
              "ready",
              "unchanged",
              "needs_fix",
              "imported",
              "failed",
              "skipped"
            ],
            "type": "string"
          },
          "subtitle": {
            "description": "A second line: an email, a handle, a path.",
            "nullable": true,
            "type": "string"
          },
          "title": {
            "description": "The record’s name: `Olivia Martin`, `Calder Sectional`.",
            "type": "string"
          },
          "values_table": {
            "description": "An option’s values as a table, one row per value and a column per field the file fills; null for any other record.",
            "nullable": true,
            "properties": {
              "columns": {
                "description": "The columns after the value’s name, as the review page heads them: `label` (Customer label), `description`, `price` (Default price), `cost` (Default cost, only for a key that may see costs), `lead_time`.",
                "items": {
                  "properties": {
                    "key": {
                      "type": "string"
                    },
                    "label": {
                      "type": "string"
                    },
                    "num": {
                      "type": "boolean"
                    }
                  },
                  "required": ["key", "label", "num"],
                  "type": "object"
                },
                "type": "array"
              },
              "counts": {
                "properties": {
                  "changed": {
                    "type": "integer"
                  },
                  "new": {
                    "type": "integer"
                  }
                },
                "required": ["new", "changed"],
                "type": "object"
              },
              "more": {
                "description": "Values the table leaves out of a very long list.",
                "type": "integer"
              },
              "picture": {
                "description": "A value has a picture or a swatch: the table shows them first.",
                "type": "boolean"
              },
              "price_range": {
                "description": "The lowest and highest default price: `Included`, `Included to +CA$8`.",
                "type": "string"
              },
              "rows": {
                "items": {
                  "properties": {
                    "cells": {
                      "description": "By column key, each `{ old, new }`, ready to show; `old` only when the import changes it. An empty cell is left out.",
                      "type": "object"
                    },
                    "image_url": {
                      "nullable": true,
                      "type": "string"
                    },
                    "key": {
                      "type": "string"
                    },
                    "mark": {
                      "enum": ["new", "updated", "same"],
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    },
                    "swatch": {
                      "description": "`#rrggbb`.",
                      "nullable": true,
                      "type": "string"
                    }
                  },
                  "required": [
                    "key",
                    "name",
                    "mark",
                    "swatch",
                    "image_url",
                    "cells"
                  ],
                  "type": "object"
                },
                "type": "array"
              },
              "status": {
                "description": "The rows differ (new, changed, as they are): each row says which.",
                "type": "boolean"
              },
              "total": {
                "description": "The option’s values after the import.",
                "type": "integer"
              }
            },
            "required": [
              "picture",
              "columns",
              "status",
              "total",
              "more",
              "counts",
              "price_range",
              "rows"
            ],
            "type": "object"
          }
        },
        "required": [
          "id",
          "position",
          "rows",
          "title",
          "subtitle",
          "image_url",
          "action",
          "status",
          "problem_count",
          "existing_in",
          "fields",
          "links",
          "problems",
          "values_table"
        ],
        "type": "object"
      },
      "ImportProblem": {
        "properties": {
          "code": {
            "description": "A stable snake_case code for the kind of problem (`option_value_unknown`). Treat the set as open.",
            "type": "string"
          },
          "column": {
            "description": "The column `key` it is about, when it is about one.",
            "nullable": true,
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "message": {
            "description": "What is wrong, one plain sentence.",
            "type": "string"
          },
          "next_step": {
            "description": "How to fix it.",
            "type": "string"
          },
          "record_title": {
            "description": "The record’s name (`Olivia Martin`); null for a note about the whole draft.",
            "nullable": true,
            "type": "string"
          },
          "rows": {
            "description": "The record’s rows; empty for a note about the whole draft.",
            "items": {
              "type": "integer"
            },
            "type": "array"
          },
          "severity": {
            "description": "`fix` holds the record back until it is fixed; `note` imports anyway.",
            "enum": ["fix", "note"],
            "type": "string"
          }
        },
        "required": [
          "id",
          "rows",
          "record_title",
          "column",
          "code",
          "message",
          "next_step",
          "severity"
        ],
        "type": "object"
      },
      "ImportProblemList": {
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/ImportProblem"
            },
            "type": "array"
          },
          "limit": {
            "type": "integer"
          },
          "next_offset": {
            "nullable": true,
            "type": "integer"
          },
          "offset": {
            "type": "integer"
          },
          "total": {
            "type": "integer"
          }
        },
        "required": ["items", "total", "offset", "limit", "next_offset"],
        "type": "object"
      },
      "ImportQuestionsSet": {
        "properties": {
          "kinds": {
            "description": "Only by a send’s `batch_id`, in place of `open` and `settled`: by kind, each kind’s `{ open, settled }` as above for that kind’s draft (`{ \"vendors\": { \"open\": [] }, \"customers\": { \"settled\": [...] } }`). A kind left out keeps its questions.",
            "type": "object"
          },
          "open": {
            "description": "What you still ask the merchant about this draft’s data, up to 50; it replaces the open questions there were. An empty list: none left. Left out: they stay as they are.",
            "items": {
              "properties": {
                "rows": {
                  "description": "The rows it is about, up to 500 (as you sent them: the first data row is 2). Left out: the whole file.",
                  "items": {
                    "type": "integer"
                  },
                  "type": "array"
                },
                "text": {
                  "description": "The question as you ask it in the chat, up to 1,000 characters.",
                  "type": "string"
                }
              },
              "required": ["text"],
              "type": "object"
            },
            "type": "array"
          },
          "settled": {
            "description": "What the merchant answered in the chat, up to 50 points, each title and answer up to 1,000 characters. Added to what the review page shows read-only, one row per title.",
            "items": {
              "properties": {
                "answer": {
                  "description": "What was settled, as one plain sentence: “Leave the 16 missing line prices blank for the merchant to fill in.”",
                  "type": "string"
                },
                "question": {
                  "description": "A short title for the point, a few words: “Missing prices”, “Currency”. Settling the same title again replaces its answer.",
                  "type": "string"
                }
              },
              "required": ["question", "answer"],
              "type": "object"
            },
            "type": "array"
          }
        },
        "type": "object"
      },
      "ImportRowsAdd": {
        "properties": {
          "check": {
            "description": "`true`, with `last: true`: check the draft once these rows are in (it answers `checking`). Left out: check it with `POST /imports/{id}/check`.",
            "type": "boolean"
          },
          "csv": {
            "description": "The rows as CSV text, in place of `rows`: a header row, then up to 500 rows. Each call’s text starts with the header again. Headers match as on an upload (header, `key` or alias, ignoring case and spaces); a column the kind doesn’t use is named in a note.",
            "type": "string"
          },
          "last": {
            "description": "`true`: these are all the draft’s rows from `start` on, and every row stored after them is dropped (with no `rows`, every row from `start`). Left out or `false`: the rows after them stay.",
            "type": "boolean"
          },
          "rows": {
            "description": "1–500 rows, in order (none only with `last: true`). Send this or `csv`.",
            "items": {
              "description": "One row: each cell by its column `key` (the guide’s columns), a string, number, true or false. A blank cell (or null) keeps what is in OrderPilot; exactly `CLEAR` empties the field.",
              "type": "object"
            },
            "type": "array"
          },
          "start": {
            "description": "The row number of the first row: 2 on the first call (row 1 is the header), then one past the last row sent. The same `start` again replaces those rows. With `csv`, the text’s first line under its header is this row.",
            "type": "integer"
          }
        },
        "required": ["start"],
        "type": "object"
      },
      "ImportSend": {
        "description": "A draft, as `ImportDraft`. A call by a send’s `batch_id`, or a create with `kinds`, answers the first draft in review order and lists every draft in `drafts`.",
        "properties": {
          "batch_id": {
            "description": "The send this draft is part of.",
            "type": "string"
          },
          "counts": {
            "description": "Records are what the rows make (a template spans many rows). `new`, `updates`, `unchanged` and `needs_fix` are known once it is checked: `updates` and `unchanged` are records already in the store (in OrderPilot, or in Shopify after an earlier migration). `imported`, `failed` and `skipped` (already in the store, left as they are by the merchant’s choice) once the merchant imports it.",
            "properties": {
              "failed": {
                "type": "integer"
              },
              "imported": {
                "type": "integer"
              },
              "needs_fix": {
                "type": "integer"
              },
              "new": {
                "type": "integer"
              },
              "records": {
                "type": "integer"
              },
              "rows": {
                "type": "integer"
              },
              "skipped": {
                "type": "integer"
              },
              "unchanged": {
                "type": "integer"
              },
              "updates": {
                "type": "integer"
              }
            },
            "required": [
              "rows",
              "records",
              "new",
              "updates",
              "unchanged",
              "needs_fix",
              "imported",
              "failed",
              "skipped"
            ],
            "type": "object"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "created_by": {
            "description": "The person who uploaded it, to a key that may read the staff (`GET /staff`); null for an assistant’s draft, and to any other key.",
            "nullable": true,
            "type": "string"
          },
          "drafts": {
            "description": "Every draft of the send (of the create, with `kinds`; those named, for questions), in the order the merchant reviews them, each with its `review_url` once sent. Only by a `batch_id` or with `kinds`.",
            "items": {
              "$ref": "#/components/schemas/ImportDraft"
            },
            "type": "array"
          },
          "existing_choice": {
            "description": "The merchant’s sign-off on the review page for records already in the store: `update` (write the new information into them) or `skip` (leave them as they are). Null until the merchant chooses; a key can’t choose it.",
            "enum": ["update", "skip", null],
            "nullable": true,
            "type": "string"
          },
          "expires_at": {
            "description": "When a draft nobody imports or discards closes by itself.",
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "failure": {
            "description": "Why the import stopped (`failed`), with the next step.",
            "nullable": true,
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "import_mode": {
            "$ref": "#/components/schemas/ImportModeNote"
          },
          "imported_at": {
            "description": "When the merchant clicked Import.",
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "imported_by": {
            "description": "The person who clicked Import, to a key that may read the staff (`GET /staff`); null until then, and to any other key.",
            "nullable": true,
            "type": "string"
          },
          "kind": {
            "description": "The kind of data: `products` (Shopify products), `product_templates`, `options`, `categories`, `customers`, `vendors`, `stock` (stock on hand), `quotes`, `orders`, `purchase_orders` or `warranty_claims`.",
            "enum": [
              "products",
              "product_templates",
              "options",
              "categories",
              "customers",
              "vendors",
              "stock",
              "quotes",
              "orders",
              "purchase_orders",
              "warranty_claims"
            ],
            "type": "string"
          },
          "mine": {
            "description": "Only on `GET /imports` and `GET /imports/{id}`: this key made it (its own draft). Only its own drafts take rows, checks and sends.",
            "type": "boolean"
          },
          "next_start": {
            "description": "The `start` of the next `POST /imports/{id}/rows`: one past the last row stored (a draft’s rows are numbered from 2 with no gap, CSV ones too). Null for a person’s upload.",
            "nullable": true,
            "type": "integer"
          },
          "records": {
            "allOf": [
              {
                "$ref": "#/components/schemas/ImportedRecordList"
              }
            ],
            "description": "Only on `GET /imports/{id}`, once the merchant clicked Import (`importing`, `imported`, `failed`): the records it made or updated, in row order, a page at a time."
          },
          "review_url": {
            "description": "The review page in the store’s Shopify admin, once the draft is sent (`ready` or later). Give it to the merchant written out in full.",
            "nullable": true,
            "type": "string"
          },
          "sent_at": {
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "source": {
            "description": "Where it came from: a person’s file uploaded on Settings › Import data (`upload`), or an assistant’s draft (`assistant`).",
            "enum": ["upload", "assistant"],
            "type": "string"
          },
          "source_name": {
            "description": "The name the review page shows it came from: this key’s name.",
            "type": "string"
          },
          "status": {
            "description": "`drafting` (taking rows), `checking`, `checked` (ready to send), `ready` (sent: Ready to review), `importing`, `imported`, `failed` (the import stopped part way; `failure` says why), `discarded` or `expired`.",
            "enum": [
              "uploading",
              "drafting",
              "checking",
              "checked",
              "ready",
              "importing",
              "imported",
              "failed",
              "discarded",
              "expired"
            ],
            "type": "string"
          }
        },
        "required": [
          "id",
          "kind",
          "status",
          "batch_id",
          "source_name",
          "counts",
          "review_url",
          "created_at",
          "sent_at",
          "expires_at",
          "failure",
          "existing_choice",
          "source",
          "created_by",
          "imported_at",
          "imported_by",
          "next_start"
        ],
        "type": "object"
      },
      "ImportedRecord": {
        "properties": {
          "action": {
            "description": "Import made it (`create`) or updated a record already there.",
            "enum": ["create", "update"],
            "type": "string"
          },
          "id": {
            "description": "Its id, as the API’s reads take it (a Shopify product’s is its GID); null where nothing is read by id (stock).",
            "nullable": true,
            "type": "string"
          },
          "kind": {
            "description": "What it is in the store: the draft’s kind (a product templates draft’s shared options are `options`).",
            "enum": [
              "products",
              "product_templates",
              "options",
              "categories",
              "customers",
              "vendors",
              "stock",
              "quotes",
              "orders",
              "purchase_orders",
              "warranty_claims"
            ],
            "type": "string"
          },
          "row": {
            "description": "Its first row in the draft.",
            "type": "integer"
          },
          "rows": {
            "description": "Every row it came from.",
            "items": {
              "type": "integer"
            },
            "type": "array"
          },
          "title": {
            "description": "Its name or number as the review page shows it: `PO-10040`, `Olivia Martin`.",
            "type": "string"
          }
        },
        "required": ["row", "rows", "kind", "id", "title", "action"],
        "type": "object"
      },
      "ImportedRecordList": {
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/ImportedRecord"
            },
            "type": "array"
          },
          "limit": {
            "type": "integer"
          },
          "next_offset": {
            "nullable": true,
            "type": "integer"
          },
          "offset": {
            "type": "integer"
          },
          "total": {
            "description": "Records the import wrote.",
            "type": "integer"
          }
        },
        "required": ["items", "total", "offset", "limit", "next_offset"],
        "type": "object"
      },
      "IncomingStock": {
        "properties": {
          "hidden_reason": {
            "description": "Why there are no rows when the caller can’t see purchase orders (a key: the scope it needs); null otherwise.",
            "nullable": true,
            "type": "string"
          },
          "lines": {
            "description": "The lines with something incoming, in the request’s order; a line with nothing incoming (a custom item always) is left out.",
            "items": {
              "properties": {
                "also_wanted_by": {
                  "description": "Other open orders whose lines want the same item (`#1042`).",
                  "items": {
                    "type": "string"
                  },
                  "type": "array"
                },
                "choices": {
                  "description": "The rows it could take units from, or that already promised them, earliest first.",
                  "items": {
                    "properties": {
                      "arrives_at": {
                        "description": "Where the units arrive: the row’s location, else the purchase order’s.",
                        "nullable": true,
                        "type": "string"
                      },
                      "changes": {
                        "description": "Another configuration: what taking it changes on the line, with its price (`Changes Fabric to Stone (same price)`).",
                        "nullable": true,
                        "type": "string"
                      },
                      "configuration_name": {
                        "description": "Another configuration: its name (`Walnut · Stone`).",
                        "nullable": true,
                        "type": "string"
                      },
                      "eta": {
                        "description": "The delivery date asked of the vendor, when set.",
                        "format": "date-time",
                        "nullable": true,
                        "type": "string"
                      },
                      "free": {
                        "description": "Of those, units no order line has.",
                        "type": "integer"
                      },
                      "incoming": {
                        "description": "Units on the row still to arrive.",
                        "type": "integer"
                      },
                      "options": {
                        "description": "Another configuration: its options, which taking it sets on the line.",
                        "items": {
                          "properties": {
                            "field_id": {
                              "type": "string"
                            },
                            "name": {
                              "type": "string"
                            },
                            "option_id": {
                              "nullable": true,
                              "type": "string"
                            },
                            "value": {
                              "type": "string"
                            }
                          },
                          "type": "object"
                        },
                        "type": "array"
                      },
                      "price_change": {
                        "description": "Another configuration: what taking it does to the line’s price each; null when not known.",
                        "nullable": true,
                        "properties": {
                          "delta": {
                            "description": "Its price less the line’s, two decimals.",
                            "nullable": true,
                            "type": "number"
                          },
                          "same": {
                            "type": "boolean"
                          }
                        },
                        "type": "object"
                      },
                      "promised_to": {
                        "description": "When none are free: the order they are promised to (`#1042`).",
                        "nullable": true,
                        "type": "string"
                      },
                      "purchase_order_id": {
                        "description": "Opens with `GET /purchase-orders/{id}`.",
                        "type": "string"
                      },
                      "purchase_order_line_id": {
                        "description": "The purchase order’s line (`lines[].id` of `GET /purchase-orders/{id}`).",
                        "type": "string"
                      },
                      "purchase_order_number": {
                        "nullable": true,
                        "type": "string"
                      },
                      "same": {
                        "description": "The line’s own variant or configuration; false: another configuration.",
                        "type": "boolean"
                      },
                      "stock_configuration_id": {
                        "description": "A template row: the configuration it buys.",
                        "nullable": true,
                        "type": "string"
                      },
                      "vendor_name": {
                        "nullable": true,
                        "type": "string"
                      }
                    },
                    "type": "object"
                  },
                  "type": "array"
                },
                "earliest_eta": {
                  "description": "The earliest ETA among the rows with free units of its own item.",
                  "format": "date-time",
                  "nullable": true,
                  "type": "string"
                },
                "free": {
                  "description": "Units of the line’s own item no order line has yet: what it could reserve.",
                  "type": "integer"
                },
                "key": {
                  "description": "The line’s `key`, as sent.",
                  "type": "string"
                },
                "needed": {
                  "description": "A saved line: units it still needs from a purchase order (its quantity less what purchase orders hold for it; 0: nothing to take). Null for a line not saved: its quantity.",
                  "nullable": true,
                  "type": "integer"
                },
                "on_order": {
                  "description": "A saved line: the purchase orders already holding units for it, earliest first.",
                  "items": {
                    "properties": {
                      "eta": {
                        "description": "The delivery date asked of the vendor, when set.",
                        "format": "date-time",
                        "nullable": true,
                        "type": "string"
                      },
                      "purchase_order_id": {
                        "description": "Opens with `GET /purchase-orders/{id}`.",
                        "type": "string"
                      },
                      "purchase_order_number": {
                        "nullable": true,
                        "type": "string"
                      },
                      "units": {
                        "type": "integer"
                      }
                    },
                    "type": "object"
                  },
                  "type": "array"
                },
                "option_offers": {
                  "description": "A saved template line: each tracked option still short of units, with its earliest open purchase order row that has free units, in the option’s own units.",
                  "items": {
                    "properties": {
                      "also_wanted_by": {
                        "items": {
                          "type": "string"
                        },
                        "type": "array"
                      },
                      "available": {
                        "description": "Units on the row no order line has.",
                        "type": "integer"
                      },
                      "component_key": {
                        "type": "string"
                      },
                      "eta": {
                        "description": "The delivery date asked of the vendor, when set.",
                        "format": "date-time",
                        "nullable": true,
                        "type": "string"
                      },
                      "option_name": {
                        "type": "string"
                      },
                      "purchase_order_id": {
                        "description": "Opens with `GET /purchase-orders/{id}`.",
                        "type": "string"
                      },
                      "purchase_order_line_id": {
                        "description": "The purchase order’s line (`lines[].id` of `GET /purchase-orders/{id}`).",
                        "type": "string"
                      },
                      "purchase_order_number": {
                        "nullable": true,
                        "type": "string"
                      },
                      "unit": {
                        "nullable": true,
                        "type": "string"
                      },
                      "units": {
                        "description": "What reserving gives the line, up to its need.",
                        "type": "integer"
                      },
                      "value": {
                        "type": "string"
                      },
                      "vendor_name": {
                        "nullable": true,
                        "type": "string"
                      }
                    },
                    "type": "object"
                  },
                  "type": "array"
                },
                "other_free": {
                  "description": "A template line: free units of its other configurations.",
                  "type": "integer"
                },
                "purchase_order_count": {
                  "description": "Purchase orders with free units of its own item.",
                  "type": "integer"
                }
              },
              "type": "object"
            },
            "type": "array"
          }
        },
        "required": ["lines", "hidden_reason"],
        "type": "object"
      },
      "IncomingStockInput": {
        "properties": {
          "currency": {
            "description": "The quote’s or order’s currency (three letters). Another configuration’s price change is said only when it is the store’s. Left out: the store’s.",
            "type": "string"
          },
          "lines": {
            "description": "1–60 lines, each with its own `key`.",
            "items": {
              "description": "A line as `POST /quotes` takes it (`template_id` with `options` and `price`, `shopify_variant_id`, its `sku`, or a custom item’s `title` and `price`), plus `key`.",
              "properties": {
                "key": {
                  "description": "A saved line’s `id` (the quote’s or order’s `lines[].id`), so what purchase orders hold for it counts; or any text up to 120 characters for a line not saved yet. Each line its own; the answer names the line by it.",
                  "type": "string"
                },
                "note": {
                  "description": "Taken as `POST /quotes` takes it; ignored here.",
                  "type": "string"
                },
                "options": {
                  "description": "A template line’s option values, as `POST /quotes` takes them: `[{ field_id, value }]`. Rows of the same configuration are its own; others are another configuration’s.",
                  "items": {
                    "properties": {
                      "field_id": {
                        "type": "string"
                      },
                      "image_file_id": {
                        "description": "The picture’s Shopify file id, with `image_url`.",
                        "type": "string"
                      },
                      "image_url": {
                        "description": "A text-and-image option’s picture (its Shopify Files URL).",
                        "type": "string"
                      },
                      "value": {
                        "type": "string"
                      }
                    },
                    "type": "object"
                  },
                  "type": "array"
                },
                "price": {
                  "description": "The line’s price each: a template line’s is compared with another configuration’s price.",
                  "type": "number"
                },
                "quantity": {
                  "description": "1–9999 (default 1): what the line still needs from purchase orders.",
                  "type": "integer"
                },
                "shopify_product_id": {
                  "description": "That variant’s product `id`, as `POST /quotes` takes it.",
                  "type": "string"
                },
                "shopify_variant_id": {
                  "description": "A Shopify product’s variant `id` (`GET /products`).",
                  "type": "string"
                },
                "sku": {
                  "description": "A Shopify product named by its SKU alone.",
                  "type": "string"
                },
                "template_id": {
                  "description": "A product template’s `id` (`GET /product-templates`).",
                  "type": "string"
                },
                "title": {
                  "description": "A custom item’s name: it has nothing incoming.",
                  "type": "string"
                }
              },
              "required": ["key"],
              "type": "object"
            },
            "type": "array"
          },
          "order_id": {
            "description": "The saved quote or order the lines are on (its `id`, from the quotes or orders list): what purchase orders already hold for its lines counts, and its own rows aren’t offered back. Left out: lines not saved yet.",
            "type": "string"
          }
        },
        "required": ["lines"],
        "type": "object"
      },
      "Inventory": {
        "properties": {
          "items": {
            "items": {
              "properties": {
                "available": {
                  "description": "At `location_id`, or every active location together without one.",
                  "type": "integer"
                },
                "committed": {
                  "description": "Held for unfulfilled orders at `location_id`; null without one.",
                  "nullable": true,
                  "type": "integer"
                },
                "inventory_item_id": {
                  "type": "string"
                },
                "location_count": {
                  "description": "Active locations stocking it.",
                  "type": "integer"
                },
                "locations": {
                  "description": "The active locations holding it: `location_id` first, then most stock first.",
                  "items": {
                    "properties": {
                      "available": {
                        "type": "integer"
                      },
                      "location_id": {
                        "type": "string"
                      },
                      "name": {
                        "type": "string"
                      }
                    },
                    "type": "object"
                  },
                  "type": "array"
                },
                "stocked_at": {
                  "description": "Whether the item is stocked at `location_id`; null without one.",
                  "nullable": true,
                  "type": "boolean"
                },
                "total": {
                  "description": "Every active location together.",
                  "type": "integer"
                },
                "tracked": {
                  "type": "boolean"
                }
              },
              "type": "object"
            },
            "type": "array"
          },
          "location_id": {
            "nullable": true,
            "type": "string"
          },
          "not_found": {
            "description": "Ids sent that are no inventory item of this store.",
            "items": {
              "type": "string"
            },
            "type": "array"
          }
        },
        "type": "object"
      },
      "KeyCaps": {
        "description": "Limits set when the key was made; null: none. Enforced: a payment, refund, email or delete over one is refused with `403 CAP_EXCEEDED` (`error.reason` names the cap). Money is in the store’s currency; a day is a UTC day (00:00 to 24:00 UTC).",
        "properties": {
          "daily_deletes": {
            "description": "Deletes a day.",
            "nullable": true,
            "type": "integer"
          },
          "daily_emails": {
            "description": "Emails a day.",
            "nullable": true,
            "type": "integer"
          },
          "daily_money": {
            "description": "What payments and refunds may add up to in a day, two decimals.",
            "nullable": true,
            "type": "number"
          },
          "enforced": {
            "description": "Whether the caps apply. True since caps were enforced.",
            "type": "boolean"
          },
          "max_payment": {
            "description": "The largest single payment, two decimals.",
            "nullable": true,
            "type": "number"
          },
          "max_refund": {
            "description": "The largest single refund, two decimals.",
            "nullable": true,
            "type": "number"
          }
        },
        "type": "object"
      },
      "KeyLocation": {
        "properties": {
          "id": {
            "description": "OrderPilot’s id for the location.",
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "shopify_id": {
            "description": "The Shopify location id (as `GET /locations`).",
            "type": "string"
          }
        },
        "required": ["id", "shopify_id", "name"],
        "type": "object"
      },
      "LegalHold": {
        "properties": {
          "change_where": {
            "description": "Where a person places or lifts it: the order page’s ⋯ menu.",
            "type": "string"
          },
          "hold": {
            "description": "Null when the record isn’t on hold.",
            "nullable": true,
            "properties": {
              "document_number": {
                "type": "string"
              },
              "id": {
                "type": "string"
              },
              "order_id": {
                "nullable": true,
                "type": "string"
              },
              "placed_at": {
                "format": "date-time",
                "type": "string"
              },
              "placed_by": {
                "nullable": true,
                "type": "string"
              },
              "reason": {
                "type": "string"
              }
            },
            "type": "object"
          }
        },
        "type": "object"
      },
      "LineAttributeSyncQueued": {
        "properties": {
          "job_id": {
            "description": "What `GET /line-attribute-syncs/{jobId}` takes.",
            "type": "string"
          },
          "line_id": {
            "type": "string"
          },
          "order_id": {
            "type": "string"
          },
          "state": {
            "enum": ["queued"],
            "type": "string"
          }
        },
        "type": "object"
      },
      "LineAttributeSyncStatus": {
        "properties": {
          "job_id": {
            "type": "string"
          },
          "line_id": {
            "nullable": true,
            "type": "string"
          },
          "message": {
            "description": "Why it was refused or failed, or what it did.",
            "nullable": true,
            "type": "string"
          },
          "order_id": {
            "nullable": true,
            "type": "string"
          },
          "state": {
            "enum": [
              "queued",
              "running",
              "synced",
              "refused",
              "failed",
              "unknown"
            ],
            "type": "string"
          }
        },
        "type": "object"
      },
      "LocationList": {
        "properties": {
          "items": {
            "items": {
              "properties": {
                "address": {
                  "description": "Its street and city as Shopify has them (the address a purchase order delivered to the location prints, `delivery_address`); null when Shopify has none.",
                  "nullable": true,
                  "type": "string"
                },
                "id": {
                  "description": "The Shopify location id: what `location_id`, `store_location_id` and the other location fields take.",
                  "type": "string"
                },
                "name": {
                  "type": "string"
                }
              },
              "type": "object"
            },
            "type": "array"
          }
        },
        "type": "object"
      },
      "Me": {
        "properties": {
          "access": {
            "description": "A signed-in person only. What their role allows: `owner`, `role`, `permissions` (every permission held, lowercase), `denied` (the app’s own reason for each permission not held, by key), `record_scope` (`see`, `change`, `purchase_orders`) and the locations they are limited to (`all_locations`, `location_ids`).",
            "type": "object"
          },
          "caller": {
            "$ref": "#/components/schemas/MeCaller"
          },
          "can": {
            "description": "What this caller may read: read_quotes, read_orders, read_customers, read_product_templates.",
            "type": "object"
          },
          "client": {
            "description": "The app that asked, from its `OrderPilot-Client` header (platform, version, min_supported_version, upgrade_url); null without the header.",
            "nullable": true,
            "type": "object"
          },
          "shop": {
            "type": "string"
          }
        },
        "required": ["shop", "caller", "can", "client"],
        "type": "object"
      },
      "MeCaller": {
        "description": "Who is calling: a `device` (a linked phone, with its staff member) or an `api_key` (with its scopes, locations and caps).",
        "properties": {
          "all_locations": {
            "description": "API key only. True: every location. False: only the records at `locations`, and those with no single location (a storefront quote request).",
            "type": "boolean"
          },
          "caps": {
            "allOf": [
              {
                "$ref": "#/components/schemas/KeyCaps"
              }
            ],
            "description": "API key only."
          },
          "id": {
            "type": "string"
          },
          "import_mode_since": {
            "description": "API key only. When this connection turned import mode on (`POST /imports/mode/start`, or its first `POST /imports`); null while it is off. While it is on, every write but the import calls answers `409 IMPORT_MODE`: end it with `POST /imports/mode/end` once the merchant has imported or discarded the drafts.",
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "import_only": {
            "description": "API key only. True: a connection for importing data only (`scope=import`). It can read the store and prepare imports; every other write answers `403 IMPORT_ONLY`. Its `scopes` still name the write scopes each kind’s import draft needs.",
            "type": "boolean"
          },
          "last_four": {
            "description": "API key only: its last four characters.",
            "nullable": true,
            "type": "string"
          },
          "locations": {
            "description": "API key only: the locations it is limited to. Empty with `all_locations`.",
            "items": {
              "$ref": "#/components/schemas/KeyLocation"
            },
            "type": "array"
          },
          "name": {
            "nullable": true,
            "type": "string"
          },
          "platform": {
            "description": "Device only: `ios` or `android`.",
            "nullable": true,
            "type": "string"
          },
          "scopes": {
            "description": "API key only: what it may do, in the scope catalog’s order (PUBLIC_API.md, “Scopes”).",
            "items": {
              "enum": [
                "QUOTES_READ",
                "QUOTES_WRITE",
                "ORDERS_READ",
                "ORDERS_WRITE",
                "CUSTOMERS_READ",
                "CUSTOMERS_WRITE",
                "CATALOG_READ",
                "PURCHASING_READ",
                "PURCHASING_WRITE",
                "INBOX_READ",
                "INBOX_WRITE",
                "WARRANTY_READ",
                "WARRANTY_WRITE",
                "REPORTS_READ",
                "WEBHOOKS_MANAGE",
                "PAYMENTS_WRITE",
                "REFUNDS_WRITE",
                "EMAILS_SEND",
                "DELETE",
                "PRICING_WRITE",
                "COSTS_READ",
                "COSTS_WRITE",
                "COMMISSION_READ",
                "COMMISSION_WRITE",
                "CATALOG_WRITE",
                "SETTINGS_READ",
                "SETTINGS_WRITE",
                "STAFF_MANAGE",
                "CONTRACTS_EXPORT",
                "CUSTOMER_DATA_EXPORT"
              ],
              "type": "string"
            },
            "type": "array"
          },
          "staff": {
            "description": "Device only: the staff member it signs in as.",
            "properties": {
              "email": {
                "nullable": true,
                "type": "string"
              },
              "id": {
                "type": "string"
              },
              "name": {
                "type": "string"
              },
              "role": {
                "nullable": true,
                "type": "string"
              }
            },
            "type": "object"
          },
          "type": {
            "enum": ["device", "api_key"],
            "type": "string"
          }
        },
        "required": ["type", "id"],
        "type": "object"
      },
      "NextStatus": {
        "description": "A status the store’s status map leads to from the record’s status (a staff button or an automatic move, “Any status” included). `POST …/status` refuses any other with `422 STATUS_NOT_ALLOWED`.",
        "properties": {
          "allowed": {
            "description": "Whether this caller may make the move now with `POST …/status`.",
            "type": "boolean"
          },
          "id": {
            "description": "The status id, as `GET /statuses`.",
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "reason": {
            "description": "Why not, with the next step (a scope or right it needs, vendors to assign, a quote that is turned into an order with `POST /quotes/{id}/convert`). Null when allowed.",
            "nullable": true,
            "type": "string"
          },
          "status_group": {
            "enum": [
              "quote",
              "confirmed",
              "in_production",
              "ready",
              "on_its_way",
              "complete",
              "cancelled",
              null
            ],
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "NextStep": {
        "properties": {
          "next_step": {
            "description": "Null when the store has no published status map (the app then shows no button).",
            "nullable": true,
            "properties": {
              "current_status": {
                "nullable": true,
                "properties": {
                  "id": {
                    "type": "string"
                  },
                  "name": {
                    "type": "string"
                  }
                },
                "type": "object"
              },
              "email_ready": {
                "description": "Whether the store can email customers yet. False: signature and payment are links staff copy and send themselves (`copy_sign_link`, `copy_pay_link`). Null: not known.",
                "nullable": true,
                "type": "boolean"
              },
              "label": {
                "description": "The button’s words: who the first row waits on (“Waiting on Olivia”), else its action, or “Nothing left to do”.",
                "type": "string"
              },
              "primary_key": {
                "description": "The `key` of the row the black button does; null when none is.",
                "nullable": true,
                "type": "string"
              },
              "rows": {
                "items": {
                  "properties": {
                    "action": {
                      "description": "The button’s words; null when nothing can be done (a wait).",
                      "nullable": true,
                      "type": "string"
                    },
                    "api_action": {
                      "description": "How this caller does the step through the API now: the call, with this record’s ids in `path` (after `/connect/v1`). Null when the API has no endpoint for the step yet (fulfill, review, resolve_changes, assign_vendors, create_record, wait; extend_quote on an order). `payment` is Request payment for the balance (`POST …/payment-requests`), `copy_pay_link` and `copy_sign_link` the links to send yourself. Also null when this caller can’t make the call: a staff-only step with an API key, or a right the key or role doesn’t hold. The record itself can still refuse the call.",
                      "nullable": true,
                      "properties": {
                        "body_field": {
                          "description": "The body field the step sets: `status_id` (the row’s `to`), `location_id`, `note`, `tags`, `salesperson_ids`, or `method` (`delivered` for mark_delivered, `collected` for mark_collected). Null when the call takes its own body.",
                          "nullable": true,
                          "type": "string"
                        },
                        "method": {
                          "enum": ["GET", "POST", "PATCH", "DELETE"],
                          "type": "string"
                        },
                        "path": {
                          "type": "string"
                        }
                      },
                      "type": "object"
                    },
                    "ask": {
                      "description": "The customer’s open item the row opens.",
                      "nullable": true,
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "kind": {
                          "enum": ["question", "change_request"],
                          "type": "string"
                        },
                        "message_id": {
                          "type": "string"
                        }
                      },
                      "type": "object"
                    },
                    "detail": {
                      "nullable": true,
                      "type": "string"
                    },
                    "follow_up": {
                      "description": "For a `follow_up` row: what it sends (see `GET …/attention`).",
                      "nullable": true,
                      "properties": {
                        "hint": {
                          "type": "string"
                        },
                        "label": {
                          "type": "string"
                        },
                        "via": {
                          "type": "string"
                        }
                      },
                      "type": "object"
                    },
                    "from": {
                      "nullable": true,
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "name": {
                          "type": "string"
                        }
                      },
                      "type": "object"
                    },
                    "hover": {
                      "nullable": true,
                      "type": "string"
                    },
                    "key": {
                      "type": "string"
                    },
                    "kind": {
                      "description": "The kind of step: reply, review_changes, extend_quote, follow_up, copy_sign_link, copy_pay_link, or a step of the shop’s map (change_status, request_signature, payment, create_po, send_po, receive_po, fulfill, mark_delivered, mark_collected, review, resolve_changes, select_location, add_salesperson, add_note, add_tag, assign_vendors, refund, wait).",
                      "type": "string"
                    },
                    "sent_at": {
                      "description": "When the current version went to the customer, for a row that asks them.",
                      "nullable": true,
                      "type": "string"
                    },
                    "title": {
                      "type": "string"
                    },
                    "to": {
                      "nullable": true,
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "name": {
                          "type": "string"
                        }
                      },
                      "type": "object"
                    },
                    "waiting_on": {
                      "description": "Set when the row waits on someone else (“Waiting on Olivia”).",
                      "nullable": true,
                      "type": "string"
                    }
                  },
                  "type": "object"
                },
                "type": "array"
              },
              "waiting_on": {
                "description": "Who the first row waits on, when it does.",
                "nullable": true,
                "type": "string"
              }
            },
            "type": "object"
          }
        },
        "type": "object"
      },
      "NoteCreate": {
        "properties": {
          "text": {
            "description": "The note, 1–500 characters (spaces are tidied).",
            "type": "string"
          }
        },
        "required": ["text"],
        "type": "object"
      },
      "Object": {
        "type": "object"
      },
      "OpenApi": {
        "description": "An OpenAPI 3.0.3 document: the whole API, or the part one lookup asked for (`operation`, `path`). With `index=true`: `{ items }`, each `{ operation_id, method, path, summary }`.",
        "type": "object"
      },
      "Option": {
        "properties": {
          "allow_other": {
            "description": "A value can be typed in (Other…).",
            "type": "boolean"
          },
          "applies_to": {
            "description": "Which Shopify catalog lines offer it: every one (`all`, at `location_ids`), the products in `product_ids`, or those in the categories `category_ids`. A template offers it only when it is attached.",
            "enum": ["all", "products", "categories"],
            "type": "string"
          },
          "category_ids": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "default_value": {
            "description": "A typed option’s Starts as; a dropdown’s is its value with `is_default`.",
            "nullable": true,
            "type": "string"
          },
          "description": {
            "description": "Help text under it.",
            "nullable": true,
            "type": "string"
          },
          "disabled": {
            "description": "Turned off: not offered on new lines.",
            "type": "boolean"
          },
          "exclude_from_sku": {
            "description": "Left out of generated SKUs.",
            "type": "boolean"
          },
          "id": {
            "type": "string"
          },
          "label": {
            "description": "What customers see, when it differs.",
            "nullable": true,
            "type": "string"
          },
          "location_ids": {
            "description": "The locations it is offered at; null: every location.",
            "items": {
              "type": "string"
            },
            "nullable": true,
            "type": "array"
          },
          "look": {
            "description": "Its default look online; null: automatic.",
            "enum": [
              "dropdown",
              "buttons",
              "segmented",
              "radio_list",
              "colour_swatches",
              "image_swatches",
              "image_cards",
              "add_on_checkbox",
              "number_box",
              "stepper",
              "slider",
              "text_box",
              "text_area",
              "info_block",
              null
            ],
            "nullable": true,
            "type": "string"
          },
          "max_length": {
            "nullable": true,
            "type": "integer"
          },
          "name": {
            "description": "The name staff see in the library.",
            "type": "string"
          },
          "number_max": {
            "nullable": true,
            "type": "number"
          },
          "number_min": {
            "nullable": true,
            "type": "number"
          },
          "number_step": {
            "nullable": true,
            "type": "number"
          },
          "placeholder": {
            "nullable": true,
            "type": "string"
          },
          "price_in_item": {
            "description": "Its values’ prices read as part of the item’s price.",
            "type": "boolean"
          },
          "product_ids": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "required": {
            "type": "boolean"
          },
          "size_parts": {
            "description": "A size’s measurements in order (null for other types).",
            "items": {
              "properties": {
                "key": {
                  "type": "string"
                },
                "label": {
                  "type": "string"
                },
                "max": {
                  "nullable": true,
                  "type": "number"
                },
                "min": {
                  "nullable": true,
                  "type": "number"
                },
                "step": {
                  "nullable": true,
                  "type": "number"
                }
              },
              "type": "object"
            },
            "nullable": true,
            "type": "array"
          },
          "swatches": {
            "description": "A dropdown whose values show as colours.",
            "type": "boolean"
          },
          "track_stock": {
            "type": "boolean"
          },
          "type": {
            "enum": [
              "text",
              "number",
              "dropdown",
              "textarea",
              "text_image",
              "dimensions"
            ],
            "type": "string"
          },
          "unit": {
            "nullable": true,
            "type": "string"
          },
          "updated_at": {
            "format": "date-time",
            "type": "string"
          },
          "values": {
            "items": {
              "properties": {
                "description": {
                  "description": "The sentence shown online.",
                  "nullable": true,
                  "type": "string"
                },
                "image_url": {
                  "nullable": true,
                  "type": "string"
                },
                "is_default": {
                  "type": "boolean"
                },
                "label": {
                  "type": "string"
                },
                "lead_time_days": {
                  "description": "Days it adds to the lead time (0 is Same day); null: none.",
                  "nullable": true,
                  "type": "integer"
                },
                "option_id": {
                  "description": "What a template line takes as an option `value` for a dropdown.",
                  "type": "string"
                },
                "position": {
                  "type": "integer"
                },
                "price": {
                  "description": "The base price; a template can set its own.",
                  "type": "number"
                },
                "sku": {
                  "description": "Its SKU code, for a value kept in stock; null: none.",
                  "nullable": true,
                  "type": "string"
                },
                "swatch_color": {
                  "nullable": true,
                  "type": "string"
                },
                "value": {
                  "type": "string"
                }
              },
              "type": "object"
            },
            "type": "array"
          },
          "values_count": {
            "type": "integer"
          },
          "values_truncated": {
            "type": "boolean"
          },
          "version": {
            "description": "Send it back as `version` with a change to this option (`PATCH /options/{id}`).",
            "type": "string"
          }
        },
        "type": "object"
      },
      "OptionCreate": {
        "properties": {
          "allow_other": {
            "description": "A dropdown also takes a value typed in (Other…).",
            "type": "boolean"
          },
          "applies_to": {
            "description": "Which Shopify catalog lines offer it: every one (`all`, at `location_ids`), the products in `product_ids`, or those in `category_ids`. A template offers it only when it is attached.",
            "enum": ["all", "products", "categories"],
            "type": "string"
          },
          "category_ids": {
            "description": "Categories, ids from `GET /categories` (up to 100); `null` or `[]`: none.",
            "items": {
              "type": "string"
            },
            "nullable": true,
            "type": "array"
          },
          "default_value": {
            "description": "Starts as: a dropdown’s value by name (one of its values), or a typed option’s text or number as text.",
            "nullable": true,
            "type": "string"
          },
          "description": {
            "description": "Help text under it.",
            "nullable": true,
            "type": "string"
          },
          "exclude_from_sku": {
            "description": "Leave it out of generated SKUs.",
            "type": "boolean"
          },
          "label": {
            "description": "What customers see, when it differs from the name.",
            "nullable": true,
            "type": "string"
          },
          "location_ids": {
            "description": "The locations it is offered at, ids from `GET /locations` (up to 250); `null` or `[]`: every location.",
            "items": {
              "type": "string"
            },
            "nullable": true,
            "type": "array"
          },
          "look": {
            "description": "Its default look online; `null`: automatic.",
            "enum": [
              "dropdown",
              "buttons",
              "segmented",
              "radio_list",
              "colour_swatches",
              "image_swatches",
              "image_cards",
              "add_on_checkbox",
              "number_box",
              "stepper",
              "slider",
              "text_box",
              "text_area",
              "info_block",
              null
            ],
            "nullable": true,
            "type": "string"
          },
          "look_settings": {
            "description": "The online look’s settings, by key: `columns` (2–6), `shape` (`square`, `round`), `show_value_names` (`always`, `selected`), `show_prices`. `null` drops one.",
            "properties": {
              "columns": {
                "nullable": true,
                "type": "integer"
              },
              "shape": {
                "enum": ["square", "round", null],
                "nullable": true,
                "type": "string"
              },
              "show_prices": {
                "nullable": true,
                "type": "boolean"
              },
              "show_value_names": {
                "enum": ["always", "selected", null],
                "nullable": true,
                "type": "string"
              }
            },
            "type": "object"
          },
          "max_length": {
            "description": "A text’s most characters.",
            "nullable": true,
            "type": "integer"
          },
          "name": {
            "description": "The name staff see, unique in the library (up to 255 characters).",
            "type": "string"
          },
          "number_max": {
            "nullable": true,
            "type": "number"
          },
          "number_min": {
            "nullable": true,
            "type": "number"
          },
          "number_step": {
            "nullable": true,
            "type": "number"
          },
          "placeholder": {
            "nullable": true,
            "type": "string"
          },
          "price_in_item": {
            "description": "Its values’ prices read as part of the item’s price, never as “+$”.",
            "type": "boolean"
          },
          "product_ids": {
            "description": "Shopify products, ids from `GET /products` (up to 500).",
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "required": {
            "type": "boolean"
          },
          "size_parts": {
            "description": "A size’s 2 or 3 measurements in order, as its editor sets them: `label` (up to 40 characters), `key` (made from the label when left out), `min`, `max`, `step`. A new size without them measures Length × Width × Height.",
            "items": {
              "properties": {
                "key": {
                  "description": "Lower-case letters, digits and `_`; an edit keeps a part by its `key` from `GET /options/{id}`.",
                  "type": "string"
                },
                "label": {
                  "type": "string"
                },
                "max": {
                  "nullable": true,
                  "type": "number"
                },
                "min": {
                  "nullable": true,
                  "type": "number"
                },
                "step": {
                  "nullable": true,
                  "type": "number"
                }
              },
              "required": ["label"],
              "type": "object"
            },
            "type": "array"
          },
          "track_stock": {
            "description": "Track each value’s stock in Shopify (not for a size).",
            "type": "boolean"
          },
          "type": {
            "description": "`dropdown` (a list), `swatch` (a list shown as colours), `number`, `dimensions` (a size), `text`, `textarea` or `text_image` (text with a picture; no values).",
            "enum": [
              "dropdown",
              "swatch",
              "number",
              "dimensions",
              "text",
              "textarea",
              "text_image"
            ],
            "type": "string"
          },
          "unit": {
            "description": "A number’s or a size’s unit (`in`, `cm`, …).",
            "nullable": true,
            "type": "string"
          },
          "values": {
            "description": "A dropdown’s values (up to 500, the most an option holds). A typed option takes at most one: its price, cost and lead time.",
            "items": {
              "properties": {
                "cost": {
                  "description": "Its cost; null: unknown. Needs costs.",
                  "nullable": true,
                  "type": "number"
                },
                "description": {
                  "description": "One sentence shown online, up to 160 characters.",
                  "nullable": true,
                  "type": "string"
                },
                "image_file_id": {
                  "description": "The picture’s `shopify_file_id` from `POST /files`: required with `image_url`, `null` with it.",
                  "nullable": true,
                  "type": "string"
                },
                "image_url": {
                  "description": "Its picture: the `url` `POST /files` answered (a Shopify Files address); `null` removes it.",
                  "nullable": true,
                  "type": "string"
                },
                "label": {
                  "description": "What customers see, when it differs.",
                  "nullable": true,
                  "type": "string"
                },
                "lead_time_days": {
                  "description": "Days it adds to the lead time (0 is Same day); null: none.",
                  "nullable": true,
                  "type": "integer"
                },
                "position": {
                  "description": "Its place in the list, from 0.",
                  "type": "integer"
                },
                "price": {
                  "description": "Its price, 0 or more (0 is Included).",
                  "type": "number"
                },
                "swatch_color": {
                  "description": "`#rrggbb`, for a swatches option.",
                  "nullable": true,
                  "type": "string"
                },
                "value": {
                  "description": "Its name, up to 255 characters: required for a dropdown’s value (a typed option’s one row is named after the option).",
                  "type": "string"
                }
              },
              "type": "object"
            },
            "type": "array"
          }
        },
        "required": ["name", "type"],
        "type": "object"
      },
      "OptionEdit": {
        "properties": {
          "allow_other": {
            "description": "A dropdown also takes a value typed in (Other…).",
            "type": "boolean"
          },
          "applies_to": {
            "description": "Which Shopify catalog lines offer it: every one (`all`, at `location_ids`), the products in `product_ids`, or those in `category_ids`. A template offers it only when it is attached.",
            "enum": ["all", "products", "categories"],
            "type": "string"
          },
          "category_ids": {
            "description": "Categories, ids from `GET /categories` (up to 100); `null` or `[]`: none.",
            "items": {
              "type": "string"
            },
            "nullable": true,
            "type": "array"
          },
          "default_value": {
            "description": "Starts as: a dropdown’s value by name (one of its values), or a typed option’s text or number as text.",
            "nullable": true,
            "type": "string"
          },
          "description": {
            "description": "Help text under it.",
            "nullable": true,
            "type": "string"
          },
          "disabled": {
            "description": "`true` turns it off: it leaves every template’s new lines, past orders keep it. `false` turns it on again.",
            "type": "boolean"
          },
          "exclude_from_sku": {
            "description": "Leave it out of generated SKUs.",
            "type": "boolean"
          },
          "expected_updated_at": {
            "description": "The option’s `updated_at` from `GET /options/{id}`, when you don’t send `version`.",
            "type": "string"
          },
          "label": {
            "description": "What customers see, when it differs from the name.",
            "nullable": true,
            "type": "string"
          },
          "location_ids": {
            "description": "The locations it is offered at, ids from `GET /locations` (up to 250); `null` or `[]`: every location.",
            "items": {
              "type": "string"
            },
            "nullable": true,
            "type": "array"
          },
          "look": {
            "description": "Its default look online; `null`: automatic.",
            "enum": [
              "dropdown",
              "buttons",
              "segmented",
              "radio_list",
              "colour_swatches",
              "image_swatches",
              "image_cards",
              "add_on_checkbox",
              "number_box",
              "stepper",
              "slider",
              "text_box",
              "text_area",
              "info_block",
              null
            ],
            "nullable": true,
            "type": "string"
          },
          "look_settings": {
            "description": "The online look’s settings, by key: `columns` (2–6), `shape` (`square`, `round`), `show_value_names` (`always`, `selected`), `show_prices`. `null` drops one.",
            "properties": {
              "columns": {
                "nullable": true,
                "type": "integer"
              },
              "shape": {
                "enum": ["square", "round", null],
                "nullable": true,
                "type": "string"
              },
              "show_prices": {
                "nullable": true,
                "type": "boolean"
              },
              "show_value_names": {
                "enum": ["always", "selected", null],
                "nullable": true,
                "type": "string"
              }
            },
            "type": "object"
          },
          "max_length": {
            "description": "A text’s most characters.",
            "nullable": true,
            "type": "integer"
          },
          "name": {
            "description": "Unique in the library.",
            "type": "string"
          },
          "number_max": {
            "nullable": true,
            "type": "number"
          },
          "number_min": {
            "nullable": true,
            "type": "number"
          },
          "number_step": {
            "nullable": true,
            "type": "number"
          },
          "placeholder": {
            "nullable": true,
            "type": "string"
          },
          "price_in_item": {
            "description": "Its values’ prices read as part of the item’s price, never as “+$”.",
            "type": "boolean"
          },
          "product_ids": {
            "description": "Shopify products, ids from `GET /products` (up to 500).",
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "remove_option_ids": {
            "description": "Dropdown values to delete, by `option_id` (`GET /options/{id}`): every template’s price, cost and lead time for them go too; past orders keep their lines. Up to 500.",
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "required": {
            "type": "boolean"
          },
          "size_parts": {
            "description": "A size’s 2 or 3 measurements in order, as its editor sets them: `label` (up to 40 characters), `key` (made from the label when left out), `min`, `max`, `step`. A new size without them measures Length × Width × Height.",
            "items": {
              "properties": {
                "key": {
                  "description": "Lower-case letters, digits and `_`; an edit keeps a part by its `key` from `GET /options/{id}`.",
                  "type": "string"
                },
                "label": {
                  "type": "string"
                },
                "max": {
                  "nullable": true,
                  "type": "number"
                },
                "min": {
                  "nullable": true,
                  "type": "number"
                },
                "step": {
                  "nullable": true,
                  "type": "number"
                }
              },
              "required": ["label"],
              "type": "object"
            },
            "type": "array"
          },
          "track_stock": {
            "description": "Track each value’s stock in Shopify (not for a size).",
            "type": "boolean"
          },
          "type": {
            "description": "A dropdown shown as a list (`dropdown`) or as colours (`swatch`).",
            "enum": ["dropdown", "swatch"],
            "type": "string"
          },
          "unit": {
            "description": "A number’s or a size’s unit (`in`, `cm`, …).",
            "nullable": true,
            "type": "string"
          },
          "values": {
            "description": "A dropdown’s values (up to 500, the most an option holds). A typed option takes at most one: its price, cost and lead time.",
            "items": {
              "properties": {
                "cost": {
                  "description": "Its cost; null: unknown. Needs costs.",
                  "nullable": true,
                  "type": "number"
                },
                "description": {
                  "description": "One sentence shown online, up to 160 characters.",
                  "nullable": true,
                  "type": "string"
                },
                "image_file_id": {
                  "description": "The picture’s `shopify_file_id` from `POST /files`: required with `image_url`, `null` with it.",
                  "nullable": true,
                  "type": "string"
                },
                "image_url": {
                  "description": "Its picture: the `url` `POST /files` answered (a Shopify Files address); `null` removes it.",
                  "nullable": true,
                  "type": "string"
                },
                "label": {
                  "description": "What customers see, when it differs.",
                  "nullable": true,
                  "type": "string"
                },
                "lead_time_days": {
                  "description": "Days it adds to the lead time (0 is Same day); null: none.",
                  "nullable": true,
                  "type": "integer"
                },
                "option_id": {
                  "description": "Edit this value in place: a `values[].option_id` of `GET /options/{id}` (a typed option’s one row is found without it). Without it, a new value.",
                  "type": "string"
                },
                "position": {
                  "description": "Its place in the list, from 0.",
                  "type": "integer"
                },
                "price": {
                  "description": "Its price, 0 or more (0 is Included).",
                  "type": "number"
                },
                "swatch_color": {
                  "description": "`#rrggbb`, for a swatches option.",
                  "nullable": true,
                  "type": "string"
                },
                "value": {
                  "description": "Its name, up to 255 characters: required for a dropdown’s value (a typed option’s one row is named after the option).",
                  "type": "string"
                }
              },
              "type": "object"
            },
            "type": "array"
          },
          "version": {
            "description": "The `version` of `GET /options/{id}` (or the last change) answered, sent back as it is: no read needed first. A change made since is `409 STALE_VERSION` with the current `version` and what `changed`. Send this or `expected_updated_at`.",
            "type": "string"
          }
        },
        "type": "object"
      },
      "OptionList": {
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/OptionSummary"
            },
            "type": "array"
          },
          "next_cursor": {
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "OptionSummary": {
        "properties": {
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "disabled": {
            "description": "Turned off: not offered on new lines.",
            "type": "boolean"
          },
          "id": {
            "type": "string"
          },
          "label": {
            "description": "What customers see, when it differs.",
            "nullable": true,
            "type": "string"
          },
          "name": {
            "description": "The name staff see in the library.",
            "type": "string"
          },
          "required": {
            "type": "boolean"
          },
          "track_stock": {
            "type": "boolean"
          },
          "type": {
            "enum": [
              "text",
              "number",
              "dropdown",
              "textarea",
              "text_image",
              "dimensions"
            ],
            "type": "string"
          },
          "unit": {
            "nullable": true,
            "type": "string"
          },
          "updated_at": {
            "format": "date-time",
            "type": "string"
          },
          "values_count": {
            "type": "integer"
          }
        },
        "type": "object"
      },
      "OptionUsage": {
        "properties": {
          "bundle_count": {
            "type": "integer"
          },
          "bundles": {
            "items": {
              "properties": {
                "id": {
                  "type": "string"
                },
                "name": {
                  "type": "string"
                }
              },
              "type": "object"
            },
            "type": "array"
          },
          "template_count": {
            "type": "integer"
          },
          "templates": {
            "items": {
              "properties": {
                "id": {
                  "type": "string"
                },
                "status": {
                  "enum": ["active", "draft"],
                  "type": "string"
                },
                "title": {
                  "type": "string"
                }
              },
              "type": "object"
            },
            "type": "array"
          }
        },
        "type": "object"
      },
      "Order": {
        "properties": {
          "balance_due": {
            "description": "The same as `totals.balance_due`.",
            "type": "number"
          },
          "cancelled_at": {
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "currency": {
            "type": "string"
          },
          "custom_fields": {
            "items": {
              "properties": {
                "field_id": {
                  "type": "string"
                },
                "name": {
                  "type": "string"
                },
                "value": {
                  "nullable": true,
                  "type": "string"
                }
              },
              "type": "object"
            },
            "type": "array"
          },
          "custom_fields_truncated": {
            "description": "True when the record holds more order-level field values than the app’s limit (100): only those are shown, and `custom_fields` edits are refused.",
            "type": "boolean"
          },
          "customer": {
            "nullable": true,
            "type": "object"
          },
          "discount": {
            "description": "The order discount as it was given (the `discount` of an edit); its amount is `totals.discount`. Null when there is none. Line discounts are on the lines.",
            "nullable": true,
            "properties": {
              "reason": {
                "nullable": true,
                "type": "string"
              },
              "scope": {
                "enum": ["products_and_fees", "products_only"],
                "type": "string"
              },
              "type": {
                "enum": ["percentage", "fixed_amount"],
                "type": "string"
              },
              "value": {
                "description": "A percent, or an amount in `currency`; two decimals.",
                "type": "number"
              }
            },
            "type": "object"
          },
          "edit_token": {
            "description": "Send as `expected_edit_token` with an edit: a Shopify sync that only touched `updated_at` then doesn’t make it stale.",
            "nullable": true,
            "type": "string"
          },
          "expiry": {
            "description": "A quote’s expiry (null on an order). Set or reset it with `POST /quotes/{id}/expiry`.",
            "nullable": true,
            "properties": {
              "expired": {
                "type": "boolean"
              },
              "own_date": {
                "description": "It has a date of its own; false: the store’s default.",
                "type": "boolean"
              },
              "signed": {
                "description": "Signed, placed or paid: the date no longer applies.",
                "type": "boolean"
              },
              "valid_for_days": {
                "description": "The store’s default, in days.",
                "type": "integer"
              },
              "valid_until": {
                "description": "The last day it is valid (YYYY-MM-DD, the store’s time zone). Null while the quote was never sent and has no date of its own: the date starts at the first send, `valid_for_days` later.",
                "nullable": true,
                "type": "string"
              }
            },
            "type": "object"
          },
          "fees": {
            "items": {
              "properties": {
                "amount": {
                  "description": "In `currency`, two decimals.",
                  "type": "number"
                },
                "id": {
                  "type": "string"
                },
                "name": {
                  "type": "string"
                },
                "percentage": {
                  "nullable": true,
                  "type": "number"
                },
                "quantity": {
                  "type": "integer"
                },
                "type": {
                  "type": "string"
                }
              },
              "type": "object"
            },
            "type": "array"
          },
          "fees_truncated": {
            "description": "True when the order has more fees than the first 50 shown.",
            "type": "boolean"
          },
          "id": {
            "type": "string"
          },
          "imported_salesperson": {
            "description": "Who a data import’s file named as the salesperson when they weren’t on the staff: kept as text, never sales credit (that is `salespeople`). `name` as the file wrote it; `email`, lower case, while the record waits for them: the first staff member to open OrderPilot with that email, verified by Shopify, is credited, and `email` becomes null, as it does when someone is credited first. Null for a record made in OrderPilot, or one whose import named nobody or a staff member.",
            "nullable": true,
            "properties": {
              "email": {
                "nullable": true,
                "type": "string"
              },
              "name": {
                "nullable": true,
                "type": "string"
              }
            },
            "type": "object"
          },
          "kind": {
            "enum": ["quote", "order"],
            "type": "string"
          },
          "lines": {
            "items": {
              "$ref": "#/components/schemas/OrderLine"
            },
            "type": "array"
          },
          "lines_truncated": {
            "description": "True when the order has more lines than the first 500 shown.",
            "type": "boolean"
          },
          "location": {
            "properties": {
              "name": {
                "type": "string"
              },
              "shopify_id": {
                "nullable": true,
                "type": "string"
              }
            },
            "type": "object"
          },
          "next_statuses": {
            "description": "Where the store’s status map lets it go next, in the store’s order, and whether this caller may move it there (`POST …/status`). A status not listed is refused.",
            "items": {
              "$ref": "#/components/schemas/NextStatus"
            },
            "type": "array"
          },
          "note": {
            "nullable": true,
            "type": "string"
          },
          "number": {
            "type": "string"
          },
          "number_final": {
            "description": "Whether `number` is the one the record keeps. False while it is OrderPilot’s own (`#94`) and its Shopify draft, whose name (`#D1008`) replaces it, is still to be made: don’t give that number to anyone, read the record again. A quote saved as a draft only is false too: its next save makes its draft. Placing an order gives it its Shopify order number.",
            "type": "boolean"
          },
          "options_truncated": {
            "description": "True when the lines hold more option values than the first 2,000 read: the lines read last may be missing options.",
            "type": "boolean"
          },
          "payment_terms": {
            "description": "The Shopify payment terms template it is on (`payment_terms_id` on an edit); null without terms. Net terms are issued on a day (the store’s today when they were set, as in OrderPilot) and fall due `due_in_days` later.",
            "nullable": true,
            "properties": {
              "deposit_percentage": {
                "description": "The deposit due first, as a percent of the total.",
                "nullable": true,
                "type": "number"
              },
              "due_at": {
                "format": "date-time",
                "nullable": true,
                "type": "string"
              },
              "due_in_days": {
                "nullable": true,
                "type": "integer"
              },
              "id": {
                "description": "The template id, as `GET /payment-terms`.",
                "type": "string"
              },
              "issued_at": {
                "format": "date-time",
                "nullable": true,
                "type": "string"
              },
              "name": {
                "description": "Null when the store’s templates couldn’t be read just now.",
                "nullable": true,
                "type": "string"
              },
              "type": {
                "description": "As `GET /payment-terms`: `receipt`, `fulfillment`, `net` or `fixed`; null with `name`.",
                "enum": [
                  "receipt",
                  "fulfillment",
                  "net",
                  "fixed",
                  "unknown",
                  null
                ],
                "nullable": true,
                "type": "string"
              }
            },
            "type": "object"
          },
          "placed_at": {
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "quoted_at": {
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "salespeople": {
            "items": {
              "properties": {
                "id": {
                  "type": "string"
                },
                "name": {
                  "type": "string"
                }
              },
              "type": "object"
            },
            "type": "array"
          },
          "salesperson": {
            "nullable": true,
            "properties": {
              "id": {
                "type": "string"
              },
              "name": {
                "type": "string"
              }
            },
            "type": "object"
          },
          "ship_to": {
            "description": "Where it ships: the record’s own copy of the address (`ship_to_address_id` on an edit copies a saved one). Null when it has none.",
            "nullable": true,
            "properties": {
              "address1": {
                "type": "string"
              },
              "address2": {
                "nullable": true,
                "type": "string"
              },
              "city": {
                "nullable": true,
                "type": "string"
              },
              "company": {
                "nullable": true,
                "type": "string"
              },
              "country": {
                "nullable": true,
                "type": "string"
              },
              "name": {
                "nullable": true,
                "type": "string"
              },
              "phone": {
                "nullable": true,
                "type": "string"
              },
              "province": {
                "nullable": true,
                "type": "string"
              },
              "zip": {
                "nullable": true,
                "type": "string"
              }
            },
            "type": "object"
          },
          "shopify": {
            "properties": {
              "draft_order_name": {
                "nullable": true,
                "type": "string"
              },
              "order_name": {
                "nullable": true,
                "type": "string"
              },
              "sync_status": {
                "description": "Whether the latest change has reached Shopify (the draft, or a placed order’s order edit). An edit made while it is SYNCING is `409 SYNC_IN_PROGRESS`: wait for SYNCED.",
                "enum": ["SYNCING", "SYNCED", "FAILED", null],
                "nullable": true,
                "type": "string"
              }
            },
            "type": "object"
          },
          "status": {
            "description": "The status name as the merchant has it now. It can be renamed: match on `status_id` or `status_group`.",
            "nullable": true,
            "type": "string"
          },
          "status_group": {
            "description": "The stable key of the status’s group; null for a merchant’s own group or none.",
            "enum": [
              "quote",
              "confirmed",
              "in_production",
              "ready",
              "on_its_way",
              "complete",
              "cancelled",
              null
            ],
            "nullable": true,
            "type": "string"
          },
          "status_id": {
            "description": "The status’s id. Stable across renames.",
            "nullable": true,
            "type": "string"
          },
          "sync_status": {
            "description": "Whether the latest change has reached Shopify. `pending` while the Shopify draft is made or updated (a few seconds after a create or an edit): the `number` (a draft name such as `#D1008` replaces OrderPilot’s own `#94`) and the totals (Shopify works out the tax) are final once it is `synced`. `failed`: send it again with `POST /quotes/{id}/sync-retry` or `POST /orders/{id}/sync-retry` (the order page’s Retry sync). Read the record again until it is `synced`; no webhook event announces the draft. On an order already placed in Shopify an edit is `pending` while Shopify’s order edit runs on the queue.",
            "enum": ["pending", "synced", "failed"],
            "type": "string"
          },
          "tags": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "tax_mode": {
            "description": "The tax choice (the `tax_mode` of an edit): `default` (Shopify decides from the customer’s resale certificates), `exempt` or `charge`.",
            "enum": ["default", "exempt", "charge"],
            "type": "string"
          },
          "tax_mode_reason": {
            "description": "Why staff (or a key) set `tax_mode`.",
            "nullable": true,
            "type": "string"
          },
          "taxes_included": {
            "type": "boolean"
          },
          "totals": {
            "properties": {
              "balance_due": {
                "description": "In `currency`, two decimals.",
                "type": "number"
              },
              "discount": {
                "description": "In `currency`, two decimals.",
                "type": "number"
              },
              "refunded": {
                "description": "In `currency`, two decimals.",
                "type": "number"
              },
              "shipping": {
                "description": "In `currency`, two decimals.",
                "type": "number"
              },
              "subtotal": {
                "description": "In `currency`, two decimals.",
                "type": "number"
              },
              "tax": {
                "description": "In `currency`, two decimals.",
                "type": "number"
              },
              "total": {
                "description": "In `currency`, two decimals.",
                "type": "number"
              }
            },
            "type": "object"
          },
          "updated_at": {
            "format": "date-time",
            "type": "string"
          },
          "version": {
            "description": "Send it back as `version` with the next change, exactly as it is: it stands for `updated_at` and `edit_token`, and every change answers the new one, so no read is needed between changes.",
            "type": "string"
          },
          "warning": {
            "description": "Only on a refund that went through for part of the amount: what is left to check.",
            "nullable": true,
            "type": "string"
          }
        },
        "required": [
          "id",
          "kind",
          "number",
          "number_final",
          "status",
          "status_id",
          "status_group",
          "customer",
          "location",
          "salesperson",
          "currency",
          "totals",
          "balance_due",
          "sync_status",
          "taxes_included",
          "note",
          "payment_terms",
          "ship_to",
          "discount",
          "tax_mode",
          "tax_mode_reason",
          "expiry",
          "next_statuses",
          "custom_fields",
          "edit_token",
          "version",
          "tags",
          "fees",
          "salespeople",
          "imported_salesperson",
          "lines",
          "lines_truncated",
          "options_truncated",
          "fees_truncated",
          "custom_fields_truncated",
          "created_at",
          "updated_at",
          "quoted_at",
          "placed_at",
          "cancelled_at",
          "shopify"
        ],
        "type": "object"
      },
      "OrderCost": {
        "properties": {
          "amount": {
            "description": "Two decimals, in the order’s currency.",
            "type": "number"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "created_by_name": {
            "description": "Who added it (a key: “API key: <name>”).",
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "kind": {
            "description": "`delivery`, `labour` or `other`.",
            "enum": ["delivery", "labour", "other"],
            "type": "string"
          },
          "label": {
            "description": "What the cost was for.",
            "type": "string"
          },
          "line_id": {
            "description": "The order line it is on (`lines[].id` of `GET /orders/{id}`); null: the whole order.",
            "nullable": true,
            "type": "string"
          },
          "line_title": {
            "description": "That line’s name as the order shows it; null on the whole order.",
            "nullable": true,
            "type": "string"
          }
        },
        "required": [
          "id",
          "label",
          "kind",
          "amount",
          "line_id",
          "line_title",
          "created_at"
        ],
        "type": "object"
      },
      "OrderCostCreate": {
        "properties": {
          "amount": {
            "description": "Above 0 and at most 1,000,000, with at most two decimals, in the order’s currency (a string such as `\"85.00\"` is taken too).",
            "type": "number"
          },
          "kind": {
            "description": "`delivery`, `labour` or `other`.",
            "enum": ["delivery", "labour", "other"],
            "type": "string"
          },
          "label": {
            "description": "What the cost was for, 1–120 characters.",
            "type": "string"
          },
          "line_id": {
            "description": "An order line the cost is on: a line’s `id` from `GET /orders/{id}` (a line of the order’s split parts too). Left out or null: the whole order.",
            "nullable": true,
            "type": "string"
          }
        },
        "required": ["label", "kind", "amount"],
        "type": "object"
      },
      "OrderCostDeleted": {
        "properties": {
          "deleted": {
            "description": "Always true.",
            "type": "boolean"
          },
          "id": {
            "description": "The removed cost’s id.",
            "type": "string"
          }
        },
        "required": ["id", "deleted"],
        "type": "object"
      },
      "OrderCostEdit": {
        "description": "Any of the fields; one at least.",
        "properties": {
          "amount": {
            "description": "Above 0 and at most 1,000,000, with at most two decimals, in the order’s currency (a string such as `\"85.00\"` is taken too).",
            "type": "number"
          },
          "kind": {
            "description": "`delivery`, `labour` or `other`.",
            "enum": ["delivery", "labour", "other"],
            "type": "string"
          },
          "label": {
            "description": "What the cost was for, 1–120 characters.",
            "type": "string"
          },
          "line_id": {
            "description": "An order line the cost is on: a line’s `id` from `GET /orders/{id}` (a line of the order’s split parts too). Left out or null: the whole order.",
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "OrderCostList": {
        "properties": {
          "currency": {
            "description": "The order’s currency, every amount’s.",
            "nullable": true,
            "type": "string"
          },
          "items": {
            "description": "Oldest first.",
            "items": {
              "properties": {
                "amount": {
                  "description": "Two decimals, in the order’s currency.",
                  "type": "number"
                },
                "created_at": {
                  "format": "date-time",
                  "type": "string"
                },
                "created_by_name": {
                  "description": "Who added it (a key: “API key: <name>”).",
                  "type": "string"
                },
                "id": {
                  "type": "string"
                },
                "kind": {
                  "description": "`delivery`, `labour` or `other`.",
                  "enum": ["delivery", "labour", "other"],
                  "type": "string"
                },
                "label": {
                  "description": "What the cost was for.",
                  "type": "string"
                },
                "line_id": {
                  "description": "The order line it is on (`lines[].id` of `GET /orders/{id}`); null: the whole order.",
                  "nullable": true,
                  "type": "string"
                },
                "line_title": {
                  "description": "That line’s name as the order shows it; null on the whole order.",
                  "nullable": true,
                  "type": "string"
                }
              },
              "required": [
                "id",
                "label",
                "kind",
                "amount",
                "line_id",
                "line_title",
                "created_at"
              ],
              "type": "object"
            },
            "type": "array"
          },
          "order_id": {
            "type": "string"
          }
        },
        "required": ["order_id", "currency", "items"],
        "type": "object"
      },
      "OrderDraftDeleted": {
        "properties": {
          "deleted": {
            "description": "Its Shopify draft order was deleted.",
            "type": "boolean"
          },
          "id": {
            "description": "The order’s id: the order itself stays.",
            "type": "string"
          }
        },
        "required": ["id", "deleted"],
        "type": "object"
      },
      "OrderEdit": {
        "properties": {
          "add_lines": {
            "description": "Add lines: `[{ template_id, quantity?, note?, price? }]`, `[{ shopify_variant_id, shopify_product_id?, quantity?, note?, price? }]` (or a Shopify product by its `sku` alone) or a custom item `[{ title, price, quantity?, sku?, note? }]` (up to 20). A template line is priced by the server from the template; a Shopify product line at the variant’s catalog price. A `price` each, and a custom item, set the price by hand: they need the right to change item prices (a key: Prices and exceptions, `PRICING_WRITE`), and a role’s discount limit applies; a template with no set price is added only with one. A Shopify product that is a composition goes on as its pieces, as the order screens add one: each its own line at its quantity times the line’s, at its catalog price, or, when the record already has the piece as a plain line (no options or discount, at its catalog price), that line’s quantity raised; the composition line takes no `price` or `note`, and one whose pieces can’t all be sold is refused, naming them. Can be sent with `lines` and `remove_lines`, alone otherwise.",
            "items": {
              "properties": {
                "note": {
                  "type": "string"
                },
                "options": {
                  "description": "A template line’s option values [{ field_id, value }] or [{ option, value }] (the option by its name; see GET /product-templates/{id}), as `POST /quotes` takes them; a text-and-image option takes its picture in `image_url`.",
                  "items": {
                    "properties": {
                      "field_id": {
                        "type": "string"
                      },
                      "image_file_id": {
                        "description": "The picture’s Shopify file id, the `shopify_file_id` `POST /files` answered. Optional; sent with `image_url`.",
                        "nullable": true,
                        "type": "string"
                      },
                      "image_url": {
                        "description": "A text-and-image option’s or field’s picture: its Shopify Files URL, the `url` `POST /files` answered (another host is refused). Its text is `value`.",
                        "nullable": true,
                        "type": "string"
                      },
                      "option": {
                        "description": "The option’s name (its `label` on `GET /product-templates/{id}`), instead of `field_id`.",
                        "type": "string"
                      },
                      "value": {
                        "type": "string"
                      }
                    },
                    "type": "object"
                  },
                  "type": "array"
                },
                "price": {
                  "description": "The price each, set by hand (from 0, 2 decimals). Required for a custom item.",
                  "type": "number"
                },
                "quantity": {
                  "type": "integer"
                },
                "shopify_product_id": {
                  "type": "string"
                },
                "shopify_variant_id": {
                  "type": "string"
                },
                "sku": {
                  "description": "A custom item’s SKU (optional, with its `title`). Without a `title`: the Shopify product’s variant with this SKU (exact, any case); several are `409 SKU_AMBIGUOUS`, listed in `error.matches`.",
                  "type": "string"
                },
                "template_id": {
                  "type": "string"
                },
                "title": {
                  "description": "A custom item’s name, with its `price`.",
                  "type": "string"
                }
              },
              "type": "object"
            },
            "type": "array"
          },
          "custom_fields": {
            "description": "Set order-level custom fields: `[{ field_id, value }]` (text, number, a dropdown option’s id or value, or a size as text such as `96 × 38 × 30`; `null` clears one). A text-and-image field takes its text in `value` and its picture in `image_url`. Only the fields sent change; required fields are enforced as in the admin. Send on its own.",
            "items": {
              "properties": {
                "field_id": {
                  "type": "string"
                },
                "image_file_id": {
                  "description": "The picture’s Shopify file id, the `shopify_file_id` `POST /files` answered. Optional; sent with `image_url`.",
                  "nullable": true,
                  "type": "string"
                },
                "image_url": {
                  "description": "A text-and-image option’s or field’s picture: its Shopify Files URL, the `url` `POST /files` answered (another host is refused). Its text is `value`.",
                  "nullable": true,
                  "type": "string"
                },
                "value": {
                  "nullable": true,
                  "type": "string"
                }
              },
              "type": "object"
            },
            "type": "array"
          },
          "discount": {
            "description": "The order-wide discount: `{ type: percentage | fixed_amount, value, reason, scope?: products_and_fees | products_only }`, or null to remove it. Needs the right to override prices (a key: Prices and exceptions, `PRICING_WRITE`). A role’s discount limit applies as in the admin: over it the discount is refused (or allowed and flagged, as the shop chose). Send on its own. Not on an order already placed in Shopify (`422 ORDER_LOCKED`): give its lines their own discounts instead.",
            "nullable": true,
            "properties": {
              "reason": {
                "type": "string"
              },
              "scope": {
                "enum": ["products_and_fees", "products_only"],
                "type": "string"
              },
              "type": {
                "enum": ["percentage", "fixed_amount"],
                "type": "string"
              },
              "value": {
                "type": "number"
              }
            },
            "type": "object"
          },
          "expected_edit_token": {
            "description": "The `edit_token` you last read (optional; `version` holds it).",
            "type": "string"
          },
          "expected_updated_at": {
            "description": "The `updated_at` you last read, when you don’t send `version`. A change made since is `409 STALE_VERSION`.",
            "format": "date-time",
            "type": "string"
          },
          "fees": {
            "description": "Add and/or remove fees: `{ add: [...], remove: [fee id] }`. An added fee is a saved one at its set price, `{ template_id, quantity? }`, or a custom one at your price, `{ name, type, value, quantity?, taxable?, physical? }` (type: fixed_amount, percent_of_discounted_price, percent_of_total or percent_of_retail_price). A saved fee and a removal need only the right to edit. A custom fee is a pricing override: it needs the right to override prices (a key: Prices and exceptions, `PRICING_WRITE`). Send on its own.",
            "properties": {
              "add": {
                "items": {
                  "properties": {
                    "name": {
                      "type": "string"
                    },
                    "physical": {
                      "type": "boolean"
                    },
                    "quantity": {
                      "type": "integer"
                    },
                    "taxable": {
                      "type": "boolean"
                    },
                    "template_id": {
                      "type": "string"
                    },
                    "type": {
                      "enum": [
                        "fixed_amount",
                        "percent_of_discounted_price",
                        "percent_of_total",
                        "percent_of_retail_price"
                      ],
                      "type": "string"
                    },
                    "value": {
                      "type": "number"
                    }
                  },
                  "type": "object"
                },
                "type": "array"
              },
              "remove": {
                "items": {
                  "type": "string"
                },
                "type": "array"
              }
            },
            "type": "object"
          },
          "line_fulfillment": {
            "description": "One item’s fulfillment, as the order page’s fulfillment pill sets it: where its units come from and how they reach the customer, in one part, or two to split the item (the parts’ quantities add up to the item’s). Works on quotes and orders. Pickup is at the record’s own store: to change the store, move the record with `location_id` first. `line_id` is any row of the item (`split_group_id` names a split item’s rows). Still allowed on a Shopify order under a status that locks editing; refused once the item is handed over or on a purchase order (`422 RULE_REFUSED` with why). Send on its own.",
            "properties": {
              "line_id": {
                "type": "string"
              },
              "parts": {
                "items": {
                  "properties": {
                    "how": {
                      "description": "Store pickup today, pickup on a later day, or delivery. Made to order is never `pickup`.",
                      "enum": ["pickup", "later", "delivery"],
                      "type": "string"
                    },
                    "location_id": {
                      "description": "Inventory from another store: its Shopify location id (`GET /locations`), one this caller may use. Null or left out: the order’s own location.",
                      "nullable": true,
                      "type": "string"
                    },
                    "quantity": {
                      "type": "integer"
                    },
                    "source": {
                      "description": "From stock, or made (or ordered) for this order.",
                      "enum": ["inventory", "made_to_order"],
                      "type": "string"
                    }
                  },
                  "type": "object"
                },
                "type": "array"
              }
            },
            "type": "object"
          },
          "lines": {
            "description": "Change existing lines: `{ id, quantity?, note?, discount?, price? }`. `price` sets the line’s price each by hand (a template line then stays hand-priced): it needs the right to change item prices (a key: Prices and exceptions, `PRICING_WRITE`), and a role’s discount limit applies to a Shopify product’s line priced under its catalog price. On an order already placed in Shopify a Shopify product’s line and a line with its own discount keep their price (`422 RULE_REFUSED`), as on the order page. Send on its own, not with other fields. No line is added or removed here.",
            "items": {
              "properties": {
                "discount": {
                  "description": "The line’s own discount, as the line read shows it: a percent, or an amount off each unit in `currency` (up to its price each, 2 decimals); null takes it off. Giving or raising one, or changing its type or reason, needs the Prices and exceptions scope (`PRICING_WRITE`); lowering or removing one doesn’t. A reason is required unless the store turned that off. A role’s discount limit applies as in OrderPilot.",
                  "nullable": true,
                  "properties": {
                    "reason": {
                      "type": "string"
                    },
                    "type": {
                      "enum": ["percentage", "fixed_amount"],
                      "type": "string"
                    },
                    "value": {
                      "type": "number"
                    }
                  },
                  "type": "object"
                },
                "id": {
                  "type": "string"
                },
                "note": {
                  "nullable": true,
                  "type": "string"
                },
                "price": {
                  "description": "The price each, set by hand (from 0, 2 decimals).",
                  "type": "number"
                },
                "quantity": {
                  "type": "integer"
                }
              },
              "type": "object"
            },
            "type": "array"
          },
          "location_id": {
            "description": "Move the record to this Shopify location (an active, billed one, from `GET /locations`). Not allowed once it is a Shopify order or linked to a purchase order.",
            "type": "string"
          },
          "note": {
            "description": "The record’s note; null or empty clears it.",
            "nullable": true,
            "type": "string"
          },
          "payment_terms_due_date": {
            "description": "The day fixed-date terms fall due (`YYYY-MM-DD`), sent with their `payment_terms_id`; they are issued on it too, as in OrderPilot. Only for terms of type `fixed`; without it they are `422 TERMS_UNSUPPORTED`.",
            "format": "date",
            "type": "string"
          },
          "payment_terms_id": {
            "description": "A template id from `GET /payment-terms`; null removes the terms (and any deposit). A change needs the right to set payment terms (a key: Prices and exceptions, `PRICING_WRITE`). Terms with a fixed date need `payment_terms_due_date`.",
            "nullable": true,
            "type": "string"
          },
          "remove_lines": {
            "description": "Remove lines by id (up to 100). A record keeps at least one line; a line covered by a warranty plan or split for delivery isn’t removed here.",
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "salesperson_ids": {
            "description": "Staff ids credited with the sale (up to 5; the first is the primary and takes the assignment). A change needs the right to change sales credit (a key: Change sales credit, `COMMISSION_WRITE`). [] credits nobody.",
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "ship_to_address_id": {
            "description": "Deliver to one of the customer’s saved addresses (an `id` from `GET /customers/{id}/addresses`). Send on its own with expected_updated_at. On an order already placed in Shopify the address is sent to its Shopify order on the queue (Shopify keeps the address it shipped to once it has fulfilled the order); not on a placed order split in two for tax, nor on a store pickup one.",
            "type": "string"
          },
          "shipping": {
            "description": "The record’s delivery charges, replacing the current ones: `[{ title, price }]` (up to 5, price from 0 with 2 decimals); `[]` removes them. Needs the right to override prices (a key: Prices and exceptions, `PRICING_WRITE`). Send on its own. Not on a store pickup record.",
            "items": {
              "properties": {
                "price": {
                  "type": "number"
                },
                "title": {
                  "type": "string"
                }
              },
              "type": "object"
            },
            "type": "array"
          },
          "tags": {
            "description": "The record’s tags, replacing the current ones (up to 250, 40 characters each).",
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "tax_mode": {
            "description": "The order page’s tax choice: `default` (Shopify decides from the customer’s resale certificates), `exempt` (exempt this order from tax) or `charge` (charge tax despite a certificate; the order is then paid through its own payment link once placed, and the draft’s invoice link is withdrawn). Not once it is a Shopify order, nor on an order split in two for tax.",
            "enum": ["default", "exempt", "charge"],
            "type": "string"
          },
          "tax_mode_reason": {
            "description": "Why (up to 200 characters): required for `exempt` and `charge` unless the store turned that off. Left out with an unchanged `tax_mode`, the stored reason stays.",
            "nullable": true,
            "type": "string"
          },
          "version": {
            "description": "The `version` of the last answer about this record (its read, its list row or the last change), sent back as it is: no read needed first. A change made since is `409 STALE_VERSION` with the current `version` and what `changed`. Send this or `expected_updated_at`.",
            "type": "string"
          }
        },
        "type": "object"
      },
      "OrderInvoiceList": {
        "properties": {
          "invoice_number": {
            "description": "The order’s invoice number; null until it is given one (the order page’s first invoice print, or `POST /orders/{id}/invoice-number`).",
            "nullable": true,
            "type": "string"
          },
          "items": {
            "items": {
              "properties": {
                "balance_due": {
                  "description": "In the order’s currency, two decimals.",
                  "type": "number"
                },
                "created_at": {
                  "format": "date-time",
                  "type": "string"
                },
                "currency": {
                  "type": "string"
                },
                "current": {
                  "description": "The version the customer has now.",
                  "type": "boolean"
                },
                "file_name": {
                  "type": "string"
                },
                "id": {
                  "description": "Downloads with `GET /orders/{id}/invoices/{snapshotId}`.",
                  "type": "string"
                },
                "label": {
                  "description": "Its document number, as printed on it.",
                  "type": "string"
                },
                "paid": {
                  "description": "In the order’s currency, two decimals.",
                  "type": "number"
                },
                "paid_at": {
                  "format": "date-time",
                  "nullable": true,
                  "type": "string"
                },
                "payment_status": {
                  "description": "The invoice’s payment state when it was frozen.",
                  "enum": ["unpaid", "partially_paid", "paid"],
                  "type": "string"
                },
                "reason": {
                  "description": "Why it was frozen: the order was created, revised after it was sent, or a payment was recorded.",
                  "enum": ["created", "revised", "payment_recorded", "other"],
                  "type": "string"
                },
                "refunded": {
                  "description": "In the order’s currency, two decimals.",
                  "type": "number"
                },
                "superseded_at": {
                  "description": "When a newer version replaced it.",
                  "format": "date-time",
                  "nullable": true,
                  "type": "string"
                },
                "total": {
                  "description": "In the order’s currency, two decimals.",
                  "type": "number"
                },
                "version": {
                  "description": "Its number among the order’s versions, from 1.",
                  "type": "integer"
                }
              },
              "type": "object"
            },
            "type": "array"
          },
          "next_cursor": {
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "OrderInvoiceNumber": {
        "properties": {
          "assigned": {
            "description": "This request gave it the number; false when it had one already, or none is given.",
            "type": "boolean"
          },
          "id": {
            "description": "The order’s id.",
            "type": "string"
          },
          "invoice_number": {
            "description": "The order’s invoice number. Null: the store doesn’t number its invoices itself (the invoice prints the order’s own number, as `I-…`).",
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "OrderLine": {
        "properties": {
          "discount": {
            "description": "The line’s own discount, as given: a percent or an amount in `currency`.",
            "nullable": true,
            "properties": {
              "type": {
                "enum": ["percentage", "fixed_amount"],
                "type": "string"
              },
              "value": {
                "type": "number"
              }
            },
            "type": "object"
          },
          "fulfillment": {
            "description": "Where its units come from and how they reach the customer (the `line_fulfillment` of an edit). Null for a service line, which is neither delivered nor picked up.",
            "nullable": true,
            "properties": {
              "how": {
                "enum": ["pickup", "later", "delivery"],
                "type": "string"
              },
              "location_id": {
                "description": "Inventory taken from another store: its Shopify location id. Null: the order’s own location.",
                "nullable": true,
                "type": "string"
              },
              "source": {
                "enum": ["inventory", "made_to_order"],
                "type": "string"
              },
              "split_group_id": {
                "description": "Shared by the two rows of an item split in two parts; null otherwise.",
                "nullable": true,
                "type": "string"
              }
            },
            "type": "object"
          },
          "id": {
            "type": "string"
          },
          "note": {
            "nullable": true,
            "type": "string"
          },
          "options": {
            "items": {
              "properties": {
                "field_id": {
                  "type": "string"
                },
                "label": {
                  "type": "string"
                },
                "value": {
                  "nullable": true,
                  "type": "string"
                }
              },
              "type": "object"
            },
            "type": "array"
          },
          "price": {
            "description": "In `currency`, two decimals.",
            "type": "number"
          },
          "product_template_id": {
            "nullable": true,
            "type": "string"
          },
          "quantity": {
            "type": "integer"
          },
          "shopify_product_id": {
            "type": "string"
          },
          "shopify_variant_id": {
            "type": "string"
          },
          "sku": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "variant_title": {
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "OrderList": {
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/OrderSummary"
            },
            "type": "array"
          },
          "next_cursor": {
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "OrderProfit": {
        "properties": {
          "additional_costs": {
            "description": "The order’s additional costs (`GET /orders/{id}/costs` has them in full).",
            "items": {
              "properties": {
                "amount": {
                  "description": "Two decimals, in the order’s currency.",
                  "type": "number"
                },
                "id": {
                  "type": "string"
                },
                "kind": {
                  "description": "`delivery`, `labour` or `other`.",
                  "enum": ["delivery", "labour", "other"],
                  "type": "string"
                },
                "label": {
                  "type": "string"
                }
              },
              "type": "object"
            },
            "type": "array"
          },
          "cover_ends_at": {
            "description": "When the last unit still covered stops being covered; null: none.",
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "currency": {
            "description": "Null when the order has no lines.",
            "nullable": true,
            "type": "string"
          },
          "expected_warranty": {
            "description": "How the store estimates the warranty still to come (Settings › Products › Warranty coverage); null when the order has no lines.",
            "nullable": true,
            "properties": {
              "basis": {
                "description": "`none` (not estimated), `product_cost` or `selling_price`.",
                "enum": ["none", "product_cost", "selling_price"],
                "type": "string"
              },
              "percent": {
                "description": "The store’s rate, two decimals.",
                "type": "number"
              }
            },
            "type": "object"
          },
          "figures": {
            "description": "The order’s totals; null when the order has no lines.",
            "nullable": true,
            "properties": {
              "additional": {
                "description": "The order’s additional costs.",
                "type": "number"
              },
              "after_warranty": {
                "description": "net − warranty_spent − warranty_expected.",
                "type": "number"
              },
              "commission": {
                "description": "Two decimals, in the order’s currency.",
                "type": "number"
              },
              "cost": {
                "description": "Goods cost: landed cost less the freight in it.",
                "type": "number"
              },
              "currency": {
                "type": "string"
              },
              "estimated": {
                "description": "Some cost is an estimate (nothing drawn yet, or a receipt not final).",
                "type": "boolean"
              },
              "freight": {
                "description": "Two decimals, in the order’s currency.",
                "type": "number"
              },
              "lines": {
                "type": "integer"
              },
              "margin_percent": {
                "description": "after_warranty as a share of selling; null when nothing was sold for money.",
                "nullable": true,
                "type": "number"
              },
              "net": {
                "description": "selling − cost − freight − commission − additional.",
                "type": "number"
              },
              "sale_margin_percent": {
                "description": "net (before warranty) as a share of selling: the margin at the sale.",
                "nullable": true,
                "type": "number"
              },
              "selling": {
                "description": "Net merchandise: after discounts, without tax.",
                "type": "number"
              },
              "service": {
                "description": "Every line is a service.",
                "type": "boolean"
              },
              "uncosted_lines": {
                "description": "Lines with no cost recorded anywhere: their net counts the whole price.",
                "type": "integer"
              },
              "units": {
                "type": "integer"
              },
              "units_covered": {
                "description": "Units still under cover that carry an expected cost.",
                "type": "integer"
              },
              "warranty_costs": {
                "description": "What warranty claims cost the store, before vendor credit.",
                "type": "number"
              },
              "warranty_credited": {
                "description": "What vendors credited back on those claims.",
                "type": "number"
              },
              "warranty_expected": {
                "description": "Still expected on units under cover (0 while the store doesn’t estimate).",
                "type": "number"
              },
              "warranty_spent": {
                "description": "warranty_costs − warranty_credited.",
                "type": "number"
              }
            },
            "type": "object"
          },
          "lines": {
            "description": "The order’s lines (its split parts’ too), A to Z.",
            "items": {
              "properties": {
                "cost": {
                  "description": "Landed cost, freight included.",
                  "type": "number"
                },
                "cost_estimated": {
                  "type": "boolean"
                },
                "cost_missing": {
                  "description": "Nothing on the line carries a cost.",
                  "type": "boolean"
                },
                "cover_ends_at": {
                  "description": "When its last covered unit’s cover ends; null when none is covered.",
                  "format": "date-time",
                  "nullable": true,
                  "type": "string"
                },
                "freight": {
                  "description": "The freight within `cost`.",
                  "type": "number"
                },
                "id": {
                  "description": "The line’s `id`, as `GET /orders/{id}` gives it.",
                  "type": "string"
                },
                "quantity": {
                  "type": "integer"
                },
                "selling": {
                  "description": "Two decimals, in the order’s currency.",
                  "type": "number"
                },
                "service": {
                  "type": "boolean"
                },
                "title": {
                  "type": "string"
                },
                "warranty_expected": {
                  "description": "Two decimals, in the order’s currency.",
                  "type": "number"
                },
                "warranty_spent": {
                  "description": "Two decimals, in the order’s currency.",
                  "type": "number"
                }
              },
              "type": "object"
            },
            "type": "array"
          },
          "more_warranty_claims": {
            "description": "Claims past the first 50, not listed (their money is in `figures`).",
            "type": "integer"
          },
          "order_id": {
            "type": "string"
          },
          "warranty_claims": {
            "description": "Claims on the order that cost the store something, oldest first.",
            "items": {
              "properties": {
                "claim_number": {
                  "type": "string"
                },
                "credited": {
                  "description": "What the vendor credited.",
                  "type": "number"
                },
                "description": {
                  "description": "Its items and reason.",
                  "type": "string"
                },
                "id": {
                  "description": "Opens with `GET /warranty/claims/{id}`.",
                  "type": "string"
                },
                "labour": {
                  "description": "Two decimals, in the order’s currency.",
                  "type": "number"
                },
                "money_back": {
                  "description": "Refunds and store credit given.",
                  "type": "number"
                },
                "other": {
                  "description": "Shipping and other costs the store paid.",
                  "type": "number"
                },
                "parts": {
                  "description": "Two decimals, in the order’s currency.",
                  "type": "number"
                },
                "replacement": {
                  "description": "Two decimals, in the order’s currency.",
                  "type": "number"
                },
                "spent": {
                  "description": "What it cost the store less what the vendor credited.",
                  "type": "number"
                },
                "status": {
                  "description": "The claim’s status; null only for one this version doesn’t know.",
                  "enum": [
                    "new",
                    "in_review",
                    "approved",
                    "in_progress",
                    "resolved",
                    "declined",
                    null
                  ],
                  "nullable": true,
                  "type": "string"
                },
                "vendor_name": {
                  "nullable": true,
                  "type": "string"
                },
                "warranty_order": {
                  "description": "The claim’s repair or replacement order, when it has one the caller may see.",
                  "nullable": true,
                  "properties": {
                    "created_at": {
                      "format": "date-time",
                      "type": "string"
                    },
                    "id": {
                      "type": "string"
                    },
                    "label": {
                      "description": "Its number, as the order shows it.",
                      "type": "string"
                    }
                  },
                  "type": "object"
                }
              },
              "type": "object"
            },
            "type": "array"
          }
        },
        "required": [
          "order_id",
          "currency",
          "figures",
          "lines",
          "additional_costs",
          "warranty_claims",
          "more_warranty_claims",
          "expected_warranty",
          "cover_ends_at"
        ],
        "type": "object"
      },
      "OrderPurchaseNeeds": {
        "properties": {
          "lines": {
            "description": "The order’s lines, in the order’s own order (up to 500).",
            "items": {
              "properties": {
                "components": {
                  "description": "The parts a purchase order buys: the product itself (`line:` key) first, then each stock-tracked option (`cfv:` key).",
                  "items": {
                    "properties": {
                      "component_key": {
                        "description": "What a purchase order line’s `component_key` takes. The product’s own part may be left out of the line instead.",
                        "type": "string"
                      },
                      "excluded": {
                        "description": "Excluded from purchase orders (marked so, or a service): a line for it is refused (`LINE_EXCLUDED`).",
                        "type": "boolean"
                      },
                      "ordered_quantity": {
                        "description": "Units the order line needs of this part (an option chosen by number counts its number per unit).",
                        "type": "number"
                      },
                      "remaining_quantity": {
                        "description": "Units still to buy: the most a purchase order line for it may take now. 0 when excluded or covered.",
                        "type": "number"
                      },
                      "sku": {
                        "type": "string"
                      },
                      "title": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "component_key",
                      "title",
                      "sku",
                      "excluded",
                      "ordered_quantity",
                      "remaining_quantity"
                    ],
                    "type": "object"
                  },
                  "type": "array"
                },
                "quantity": {
                  "type": "integer"
                },
                "source_line_item_id": {
                  "description": "The order line’s id: what a purchase order line’s `source_line_item_id` takes.",
                  "type": "string"
                },
                "title": {
                  "nullable": true,
                  "type": "string"
                },
                "vendor": {
                  "description": "Who it is bought from: a purchase order’s `vendor_id` takes this `id`. Null: no vendor set, so it can’t go on a purchase order yet.",
                  "nullable": true,
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    }
                  },
                  "type": "object"
                }
              },
              "required": [
                "source_line_item_id",
                "title",
                "quantity",
                "vendor",
                "components"
              ],
              "type": "object"
            },
            "type": "array"
          },
          "lines_truncated": {
            "description": "True when the order has more lines than the first 500 shown.",
            "type": "boolean"
          },
          "order_id": {
            "type": "string"
          }
        },
        "required": ["order_id", "lines", "lines_truncated"],
        "type": "object"
      },
      "OrderQuickBooks": {
        "properties": {
          "can_retry": {
            "description": "This caller may send it again (`POST /orders/{id}/quickbooks-sync`): it may change the order.",
            "type": "boolean"
          },
          "cost_of_goods": {
            "description": "The cost of goods journal entries carrying this order’s cost, oldest first, and its gross profit. Null when none posted, or hidden (`costs_hidden`).",
            "nullable": true,
            "properties": {
              "entries": {
                "items": {
                  "properties": {
                    "amount": {
                      "description": "In the order’s currency, two decimals.",
                      "type": "number"
                    },
                    "day": {
                      "description": "YYYY-MM-DD.",
                      "type": "string"
                    },
                    "number": {
                      "nullable": true,
                      "type": "string"
                    },
                    "posted": {
                      "type": "boolean"
                    }
                  },
                  "type": "object"
                },
                "type": "array"
              },
              "gross_profit": {
                "description": "Sales on the invoice less tax, and that less `total`. Null without an invoice, or past the documents read (`gross_profit_partial`).",
                "nullable": true,
                "properties": {
                  "profit": {
                    "description": "In the order’s currency, two decimals.",
                    "type": "number"
                  },
                  "sales": {
                    "description": "In the order’s currency, two decimals.",
                    "type": "number"
                  }
                },
                "type": "object"
              },
              "gross_profit_partial": {
                "type": "boolean"
              },
              "partial": {
                "description": "More entries than listed: `entries` holds the oldest; `total` counts all.",
                "type": "boolean"
              },
              "total": {
                "description": "In the order’s currency, two decimals.",
                "type": "number"
              }
            },
            "type": "object"
          },
          "cost_of_goods_on": {
            "description": "The store posts cost of goods to QuickBooks.",
            "type": "boolean"
          },
          "costs_hidden": {
            "description": "Present, with a `reason`, when cost figures were left out (the store keeps cost off the order page, or the caller may not see costs).",
            "properties": {
              "reason": {
                "type": "string"
              }
            },
            "required": ["reason"],
            "type": "object"
          },
          "currency": {
            "nullable": true,
            "type": "string"
          },
          "invoice": {
            "description": "The invoice posted for the order; null until one is.",
            "nullable": true,
            "properties": {
              "number": {
                "nullable": true,
                "type": "string"
              },
              "total": {
                "description": "In the order’s currency, two decimals.",
                "nullable": true,
                "type": "number"
              }
            },
            "type": "object"
          },
          "message": {
            "nullable": true,
            "type": "string"
          },
          "payments": {
            "description": "Payments, store credit used, refunds and credits posted, oldest first.",
            "items": {
              "properties": {
                "label": {
                  "type": "string"
                },
                "total": {
                  "description": "In the order’s currency, two decimals.",
                  "nullable": true,
                  "type": "number"
                }
              },
              "type": "object"
            },
            "type": "array"
          },
          "payments_partial": {
            "description": "More were posted than this lists: `payments` holds the oldest.",
            "type": "boolean"
          },
          "posts": {
            "description": "Customer orders post to QuickBooks (it is connected with orders turned on). False: the rest is empty.",
            "type": "boolean"
          },
          "status": {
            "description": "`not_synced`: nothing has looked at it yet (not paid since orders began posting). `pending`: queued or being written. `synced`: in step. `waiting`: not posted yet, for the reason in `message`. `not_applicable`: never posts (`message` says why). `failed`: the last try failed (`message`). Null when `posts` is false.",
            "enum": [
              "not_synced",
              "pending",
              "synced",
              "waiting",
              "not_applicable",
              "failed",
              null
            ],
            "nullable": true,
            "type": "string"
          },
          "synced_at": {
            "format": "date-time",
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "OrderQuickBooksSync": {
        "properties": {
          "id": {
            "description": "The order’s id.",
            "type": "string"
          },
          "message": {
            "description": "“Sending to QuickBooks”.",
            "type": "string"
          },
          "status": {
            "description": "Queued: read `GET /orders/{id}/quickbooks` until it is `synced` or `failed`.",
            "enum": ["pending"],
            "type": "string"
          }
        },
        "type": "object"
      },
      "OrderRequirementChoices": {
        "properties": {
          "items": {
            "items": {
              "properties": {
                "category_ids": {
                  "description": "Templates: their categories (a category already on the list covers them).",
                  "items": {
                    "type": "string"
                  },
                  "type": "array"
                },
                "detail": {
                  "description": "A template’s categories, a product’s vendor.",
                  "nullable": true,
                  "type": "string"
                },
                "id": {
                  "description": "What a row or a condition takes: a template’s, category’s or vendor’s id, a Shopify product’s or location’s GID.",
                  "type": "string"
                },
                "image_url": {
                  "nullable": true,
                  "type": "string"
                },
                "label": {
                  "type": "string"
                },
                "vendor": {
                  "nullable": true,
                  "type": "string"
                }
              },
              "required": [
                "id",
                "label",
                "detail",
                "category_ids",
                "image_url",
                "vendor"
              ],
              "type": "object"
            },
            "type": "array"
          },
          "next_cursor": {
            "description": "Pass it as `cursor` (same `source` and `q`) for the next page; null on the last.",
            "nullable": true,
            "type": "string"
          }
        },
        "required": ["items", "next_cursor"],
        "type": "object"
      },
      "OrderRequirementKind": {
        "description": "One requirement: its switches and its list.",
        "properties": {
          "every_order_percent": {
            "description": "Deposit only (null for the signature): the % Every order asks for on each device, null until set.",
            "nullable": true,
            "properties": {
              "admin": {
                "nullable": true,
                "type": "number"
              },
              "pos": {
                "nullable": true,
                "type": "number"
              }
            },
            "required": ["admin", "pos"],
            "type": "object"
          },
          "kind": {
            "description": "The requirement: `signature` (the customer’s signature) or `deposit`.",
            "enum": ["signature", "deposit"],
            "type": "string"
          },
          "list_idle_reason": {
            "description": "Why the list isn’t used at all (both devices on Never, or a signature on Every order on both), as the screen says it; null when it is.",
            "nullable": true,
            "type": "string"
          },
          "modes": {
            "description": "Each device’s switch.",
            "properties": {
              "admin": {
                "description": "In the admin (and the online store). The switch: `every_order` (every quote and order made there), `list` (only the list) or `never`.",
                "enum": ["every_order", "list", "never"],
                "type": "string"
              },
              "pos": {
                "description": "On POS. The switch: `every_order` (every quote and order made there), `list` (only the list) or `never`.",
                "enum": ["every_order", "list", "never"],
                "type": "string"
              }
            },
            "required": ["admin", "pos"],
            "type": "object"
          },
          "rows": {
            "description": "The list: rules, then categories, products and Excluded rows, by name within each (up to 2,000 of each kind).",
            "items": {
              "$ref": "#/components/schemas/OrderRequirementRow"
            },
            "type": "array"
          }
        },
        "required": [
          "kind",
          "modes",
          "every_order_percent",
          "list_idle_reason",
          "rows"
        ],
        "type": "object"
      },
      "OrderRequirementKindSaved": {
        "description": "The requirement after the change.",
        "properties": {
          "added": {
            "description": "Rows put on the list: how many were sent; null otherwise.",
            "nullable": true,
            "type": "integer"
          },
          "every_order_percent": {
            "description": "Deposit only (null for the signature): the % Every order asks for on each device, null until set.",
            "nullable": true,
            "properties": {
              "admin": {
                "nullable": true,
                "type": "number"
              },
              "pos": {
                "nullable": true,
                "type": "number"
              }
            },
            "required": ["admin", "pos"],
            "type": "object"
          },
          "kind": {
            "description": "The requirement: `signature` (the customer’s signature) or `deposit`.",
            "enum": ["signature", "deposit"],
            "type": "string"
          },
          "list_idle_reason": {
            "description": "Why the list isn’t used at all (both devices on Never, or a signature on Every order on both), as the screen says it; null when it is.",
            "nullable": true,
            "type": "string"
          },
          "modes": {
            "description": "Each device’s switch.",
            "properties": {
              "admin": {
                "description": "In the admin (and the online store). The switch: `every_order` (every quote and order made there), `list` (only the list) or `never`.",
                "enum": ["every_order", "list", "never"],
                "type": "string"
              },
              "pos": {
                "description": "On POS. The switch: `every_order` (every quote and order made there), `list` (only the list) or `never`.",
                "enum": ["every_order", "list", "never"],
                "type": "string"
              }
            },
            "required": ["admin", "pos"],
            "type": "object"
          },
          "no_longer_found": {
            "description": "A rule’s PATCH of its conditions: the picks it already held whose record the store no longer has (a deleted category, template, vendor or location, or a Shopify product gone). They are kept as stored, with their stored label, and match nothing: drop them to tidy the rule. Empty otherwise.",
            "items": {
              "properties": {
                "field": {
                  "description": "The condition’s `field`.",
                  "type": "string"
                },
                "id": {
                  "description": "The pick’s `id`, as the rule stores it.",
                  "type": "string"
                },
                "label": {
                  "description": "Its label as stored.",
                  "type": "string"
                }
              },
              "required": ["field", "id", "label"],
              "type": "object"
            },
            "type": "array"
          },
          "rows": {
            "description": "The list: rules, then categories, products and Excluded rows, by name within each (up to 2,000 of each kind).",
            "items": {
              "$ref": "#/components/schemas/OrderRequirementRow"
            },
            "type": "array"
          },
          "saved_id": {
            "description": "A rule saved or copied: its `id`; null otherwise.",
            "nullable": true,
            "type": "string"
          }
        },
        "required": [
          "kind",
          "modes",
          "every_order_percent",
          "list_idle_reason",
          "rows",
          "saved_id",
          "added",
          "no_longer_found"
        ],
        "type": "object"
      },
      "OrderRequirementModeCount": {
        "properties": {
          "confirm": {
            "description": "The confirm the screen asks, for the person to read before the change.",
            "properties": {
              "body": {
                "type": "string"
              },
              "confirm": {
                "type": "string"
              },
              "title": {
                "type": "string"
              }
            },
            "required": ["title", "body", "confirm"],
            "type": "object"
          },
          "count": {
            "description": "Open quotes and orders the switch changes; null when the caller can’t read quotes and orders.",
            "nullable": true,
            "type": "integer"
          },
          "scanned": {
            "description": "More open ones exist: the count is of the newest this many. Null otherwise.",
            "nullable": true,
            "type": "integer"
          }
        },
        "required": ["count", "scanned", "confirm"],
        "type": "object"
      },
      "OrderRequirementModeSet": {
        "properties": {
          "device": {
            "description": "The device: `admin` (the admin and online store) or `pos`.",
            "enum": ["admin", "pos"],
            "type": "string"
          },
          "kind": {
            "description": "The requirement: `signature` (the customer’s signature) or `deposit`.",
            "enum": ["signature", "deposit"],
            "type": "string"
          },
          "mode": {
            "description": "The switch: `every_order` (every quote and order made there), `list` (only the list) or `never`.",
            "enum": ["every_order", "list", "never"],
            "type": "string"
          },
          "percent": {
            "description": "Deposit: the % Every order asks for (needed with `every_order`; kept when the switch moves away).",
            "type": "number"
          }
        },
        "required": ["kind", "device", "mode"],
        "type": "object"
      },
      "OrderRequirementRow": {
        "properties": {
          "after_remove": {
            "description": "Products and categories: what taking it off the list leaves.",
            "type": "string"
          },
          "also_required_by": {
            "description": "The categories on the list that ask for it too (their names).",
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "color": {
            "description": "A category’s colour.",
            "nullable": true,
            "type": "string"
          },
          "conditions": {
            "allOf": [
              {
                "$ref": "#/components/schemas/OrderRequirementRuleTree"
              }
            ],
            "description": "A rule’s conditions; null on other rows and on a rule that can’t be read.",
            "nullable": true
          },
          "detail": {
            "description": "The second line: a category’s path, a template’s categories (“Archived” first when it is), a product’s vendor, or a rule in one sentence.",
            "type": "string"
          },
          "devices": {
            "description": "The devices it counts on: `both`, `admin` (the admin and online store) or `pos`.",
            "enum": ["both", "admin", "pos"],
            "type": "string"
          },
          "excluded": {
            "description": "A template or Shopify product set to not need it (Not required, or a 0 % deposit): it cancels only its categories.",
            "type": "boolean"
          },
          "id": {
            "description": "The rule’s, category’s or template’s id, or the Shopify product’s GID.",
            "type": "string"
          },
          "image_url": {
            "nullable": true,
            "type": "string"
          },
          "key": {
            "description": "`<type>:<id>`, unique on the list.",
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "percent": {
            "description": "A deposit row’s % (0 when Excluded); null on the signature list.",
            "nullable": true,
            "type": "number"
          },
          "problem": {
            "description": "A rule that can’t be read: why (it is skipped on orders until it is saved again with good conditions).",
            "nullable": true,
            "type": "string"
          },
          "type": {
            "description": "A `rule`, a `category`, a product `template` or a `shopify_product`.",
            "enum": ["rule", "category", "template", "shopify_product"],
            "type": "string"
          }
        },
        "required": [
          "key",
          "type",
          "id",
          "name",
          "detail",
          "excluded",
          "percent",
          "devices",
          "image_url",
          "color",
          "also_required_by",
          "conditions",
          "problem",
          "after_remove"
        ],
        "type": "object"
      },
      "OrderRequirementRowUpdate": {
        "properties": {
          "devices": {
            "description": "The devices it counts on: `both`, `admin` (the admin and online store) or `pos`.",
            "enum": ["both", "admin", "pos"],
            "type": "string"
          },
          "id": {
            "description": "The row’s `id` in `signature.rows` or `deposit.rows` of `GET /settings/requirements` (a Shopify product by its GID).",
            "type": "string"
          },
          "kind": {
            "description": "The requirement: `signature` (the customer’s signature) or `deposit`.",
            "enum": ["signature", "deposit"],
            "type": "string"
          },
          "percent": {
            "description": "A deposit row’s % (not an Excluded row’s).",
            "type": "number"
          },
          "type": {
            "description": "The row’s `type`: `category`, `template` or `shopify_product`.",
            "enum": ["category", "template", "shopify_product"],
            "type": "string"
          }
        },
        "required": ["kind", "type", "id"],
        "type": "object"
      },
      "OrderRequirementRowsAdd": {
        "properties": {
          "category_ids": {
            "description": "Categories, by `id` (`categories` of `GET /settings/requirements`).",
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "devices": {
            "description": "The devices it counts on: `both`, `admin` (the admin and online store) or `pos`.",
            "enum": ["both", "admin", "pos"],
            "type": "string"
          },
          "kind": {
            "description": "The requirement: `signature` (the customer’s signature) or `deposit`.",
            "enum": ["signature", "deposit"],
            "type": "string"
          },
          "percent": {
            "description": "Deposit: the % for every row added (needed).",
            "type": "number"
          },
          "shopify_product_ids": {
            "description": "The store’s own Shopify products, by GID (`GET /settings/requirements/choices` with `source` `shopify_products`); their name, vendor and picture are read from Shopify. A product OrderPilot runs (a template’s, an option’s) is refused: put its template on the list.",
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "template_ids": {
            "description": "Product templates, by `id` (`GET /settings/requirements/choices` with `source` `templates`).",
            "items": {
              "type": "string"
            },
            "type": "array"
          }
        },
        "required": ["kind", "devices"],
        "type": "object"
      },
      "OrderRequirementRowsRemove": {
        "properties": {
          "kind": {
            "description": "The requirement: `signature` (the customer’s signature) or `deposit`.",
            "enum": ["signature", "deposit"],
            "type": "string"
          },
          "rows": {
            "description": "The rows to take off (up to 250).",
            "items": {
              "properties": {
                "id": {
                  "description": "The row’s `id` in `signature.rows` or `deposit.rows` of `GET /settings/requirements` (a Shopify product by its GID).",
                  "type": "string"
                },
                "type": {
                  "description": "The row’s `type`: `category`, `template` or `shopify_product`.",
                  "enum": ["category", "template", "shopify_product"],
                  "type": "string"
                }
              },
              "required": ["type", "id"],
              "type": "object"
            },
            "type": "array"
          }
        },
        "required": ["kind", "rows"],
        "type": "object"
      },
      "OrderRequirementRuleCondition": {
        "properties": {
          "field": {
            "description": "The condition’s field (a `field` of `rule_fields`).",
            "enum": [
              "order_total",
              "subtotal",
              "item_count",
              "location",
              "payment_due_later",
              "customer_tag",
              "first_order",
              "template",
              "shopify_product",
              "category",
              "vendor",
              "shopify_type",
              "shopify_tag",
              "price_each",
              "made_to_order",
              "has_options",
              "delivery",
              "service"
            ],
            "type": "string"
          },
          "op": {
            "description": "The comparison: one of the field’s `ops` in `rule_fields`.",
            "enum": [
              "at_least",
              "under",
              "between",
              "is",
              "is_any_of",
              "is_none_of",
              "contains"
            ],
            "type": "string"
          },
          "value": {
            "description": "What the field is compared with, by its `type` in `rule_fields`: `money` and `count` a number (`between`: `[low, high]`); `set` the picked `[{ id, label }]` (ids from `GET /settings/requirements/choices` with the field’s `choices_source`); `text` the typed words as `[{ id, label }]` (`contains`: one string); `bool` true or false; `delivery` `delivery` or `store_pickup`."
          }
        },
        "required": ["field", "op", "value"],
        "type": "object"
      },
      "OrderRequirementRuleCreate": {
        "properties": {
          "conditions": {
            "$ref": "#/components/schemas/OrderRequirementRuleTree"
          },
          "deposit_percent": {
            "description": "A deposit rule’s % (needed for one).",
            "type": "number"
          },
          "devices": {
            "description": "The devices it counts on: `both`, `admin` (the admin and online store) or `pos`.",
            "enum": ["both", "admin", "pos"],
            "type": "string"
          },
          "kind": {
            "description": "The requirement: `signature` (the customer’s signature) or `deposit`.",
            "enum": ["signature", "deposit"],
            "type": "string"
          },
          "name": {
            "description": "Unique on the list, up to 80 characters.",
            "type": "string"
          }
        },
        "required": ["kind", "name", "devices", "conditions"],
        "type": "object"
      },
      "OrderRequirementRuleGroupPart": {
        "properties": {
          "conditions": {
            "description": "An `item` part’s conditions: all of them hold for one item (up to 8).",
            "items": {
              "$ref": "#/components/schemas/OrderRequirementRuleCondition"
            },
            "type": "array"
          },
          "field": {
            "description": "The condition’s field (a `field` of `rule_fields`).",
            "enum": [
              "order_total",
              "subtotal",
              "item_count",
              "location",
              "payment_due_later",
              "customer_tag",
              "first_order",
              "template",
              "shopify_product",
              "category",
              "vendor",
              "shopify_type",
              "shopify_tag",
              "price_each",
              "made_to_order",
              "has_options",
              "delivery",
              "service"
            ],
            "type": "string"
          },
          "kind": {
            "enum": ["order", "item"],
            "type": "string"
          },
          "op": {
            "description": "The comparison: one of the field’s `ops` in `rule_fields`.",
            "enum": [
              "at_least",
              "under",
              "between",
              "is",
              "is_any_of",
              "is_none_of",
              "contains"
            ],
            "type": "string"
          },
          "value": {
            "description": "What the field is compared with, by its `type` in `rule_fields`: `money` and `count` a number (`between`: `[low, high]`); `set` the picked `[{ id, label }]` (ids from `GET /settings/requirements/choices` with the field’s `choices_source`); `text` the typed words as `[{ id, label }]` (`contains`: one string); `bool` true or false; `delivery` `delivery` or `store_pickup`."
          }
        },
        "required": ["kind"],
        "type": "object"
      },
      "OrderRequirementRulePart": {
        "properties": {
          "conditions": {
            "description": "An `item` part’s conditions: all of them hold for one item (up to 8).",
            "items": {
              "$ref": "#/components/schemas/OrderRequirementRuleCondition"
            },
            "type": "array"
          },
          "field": {
            "description": "The condition’s field (a `field` of `rule_fields`).",
            "enum": [
              "order_total",
              "subtotal",
              "item_count",
              "location",
              "payment_due_later",
              "customer_tag",
              "first_order",
              "template",
              "shopify_product",
              "category",
              "vendor",
              "shopify_type",
              "shopify_tag",
              "price_each",
              "made_to_order",
              "has_options",
              "delivery",
              "service"
            ],
            "type": "string"
          },
          "kind": {
            "description": "`order`: one condition on the order (`field`, `op`, `value`); `item`: `conditions` one item meets together; `group`: `match` and `parts` (orders and items only, one group a rule).",
            "enum": ["order", "item", "group"],
            "type": "string"
          },
          "match": {
            "description": "A `group`’s: `all` or `any`.",
            "enum": ["all", "any"],
            "type": "string"
          },
          "op": {
            "description": "The comparison: one of the field’s `ops` in `rule_fields`.",
            "enum": [
              "at_least",
              "under",
              "between",
              "is",
              "is_any_of",
              "is_none_of",
              "contains"
            ],
            "type": "string"
          },
          "parts": {
            "description": "A `group`’s parts: `order` and `item` parts.",
            "items": {
              "$ref": "#/components/schemas/OrderRequirementRuleGroupPart"
            },
            "type": "array"
          },
          "value": {
            "description": "What the field is compared with, by its `type` in `rule_fields`: `money` and `count` a number (`between`: `[low, high]`); `set` the picked `[{ id, label }]` (ids from `GET /settings/requirements/choices` with the field’s `choices_source`); `text` the typed words as `[{ id, label }]` (`contains`: one string); `bool` true or false; `delivery` `delivery` or `store_pickup`."
          }
        },
        "required": ["kind"],
        "type": "object"
      },
      "OrderRequirementRulePreview": {
        "properties": {
          "count": {
            "description": "Open quotes and orders it matches; null when the caller can’t read quotes and orders.",
            "nullable": true,
            "type": "integer"
          },
          "matches": {
            "description": "Up to three of them, newest first.",
            "items": {
              "properties": {
                "customer": {
                  "type": "string"
                },
                "id": {
                  "description": "The quote’s or order’s `id`.",
                  "type": "string"
                },
                "label": {
                  "description": "Its number as shown (“Q-1042”, “#1042”).",
                  "type": "string"
                },
                "total": {
                  "type": "number"
                }
              },
              "required": ["id", "label", "customer", "total"],
              "type": "object"
            },
            "type": "array"
          },
          "scanned": {
            "description": "More open ones exist: the count is of the newest this many. Null otherwise.",
            "nullable": true,
            "type": "integer"
          }
        },
        "required": ["count", "matches", "scanned"],
        "type": "object"
      },
      "OrderRequirementRulePreviewBody": {
        "properties": {
          "conditions": {
            "$ref": "#/components/schemas/OrderRequirementRuleTree"
          },
          "devices": {
            "description": "The devices it counts on: `both`, `admin` (the admin and online store) or `pos`.",
            "enum": ["both", "admin", "pos"],
            "type": "string"
          }
        },
        "required": ["devices", "conditions"],
        "type": "object"
      },
      "OrderRequirementRuleTree": {
        "description": "A rule’s conditions: its `parts` combined by `match`, `all` or `any`. A part is an `order` condition (`field`, `op`, `value`), an `item` block (`conditions` one item meets together) or one `group` (`match` and `parts` of the other two kinds). Up to 20 conditions in all.",
        "properties": {
          "match": {
            "enum": ["all", "any"],
            "type": "string"
          },
          "parts": {
            "items": {
              "$ref": "#/components/schemas/OrderRequirementRulePart"
            },
            "type": "array"
          }
        },
        "required": ["match", "parts"],
        "type": "object"
      },
      "OrderRequirementRuleUpdate": {
        "properties": {
          "conditions": {
            "$ref": "#/components/schemas/OrderRequirementRuleTree"
          },
          "deposit_percent": {
            "description": "A deposit rule’s %.",
            "type": "number"
          },
          "devices": {
            "description": "The devices it counts on: `both`, `admin` (the admin and online store) or `pos`.",
            "enum": ["both", "admin", "pos"],
            "type": "string"
          },
          "name": {
            "description": "Unique on the list, up to 80 characters.",
            "type": "string"
          }
        },
        "type": "object"
      },
      "OrderRequirements": {
        "properties": {
          "categories": {
            "description": "Every category of the store (for a category row or a rule).",
            "items": {
              "properties": {
                "id": {
                  "type": "string"
                },
                "name": {
                  "type": "string"
                },
                "parent_id": {
                  "nullable": true,
                  "type": "string"
                },
                "path": {
                  "description": "“Living room › Sofas”.",
                  "type": "string"
                }
              },
              "required": ["id", "name", "parent_id", "path"],
              "type": "object"
            },
            "type": "array"
          },
          "delivery_values": {
            "description": "A `delivery` field’s values.",
            "items": {
              "enum": ["delivery", "store_pickup"],
              "type": "string"
            },
            "type": "array"
          },
          "deposit": {
            "$ref": "#/components/schemas/OrderRequirementKind"
          },
          "limits": {
            "properties": {
              "conditions_per_item": {
                "type": "integer"
              },
              "conditions_per_rule": {
                "type": "integer"
              },
              "rows_per_request": {
                "type": "integer"
              },
              "rule_name_length": {
                "type": "integer"
              },
              "rules_per_list": {
                "type": "integer"
              },
              "values_per_condition": {
                "type": "integer"
              }
            },
            "required": [
              "rules_per_list",
              "conditions_per_rule",
              "conditions_per_item",
              "values_per_condition",
              "rule_name_length",
              "rows_per_request"
            ],
            "type": "object"
          },
          "rule_fields": {
            "description": "What a rule’s conditions can use, as the rule builder offers it (the same for every store). `order` fields are a part of their own; `item` fields go in an `item` part’s `conditions`.",
            "items": {
              "properties": {
                "choices_source": {
                  "description": "`set` fields: the `source` of `GET /settings/requirements/choices` its values come from.",
                  "enum": [
                    "locations",
                    "templates",
                    "shopify_products",
                    "categories",
                    "vendors",
                    null
                  ],
                  "nullable": true,
                  "type": "string"
                },
                "field": {
                  "enum": [
                    "order_total",
                    "subtotal",
                    "item_count",
                    "location",
                    "payment_due_later",
                    "customer_tag",
                    "first_order",
                    "template",
                    "shopify_product",
                    "category",
                    "vendor",
                    "shopify_type",
                    "shopify_tag",
                    "price_each",
                    "made_to_order",
                    "has_options",
                    "delivery",
                    "service"
                  ],
                  "type": "string"
                },
                "from_shopify": {
                  "description": "Read from Shopify when a rule uses it; a fact Shopify can’t give counts the condition as met.",
                  "enum": ["customer", "product", null],
                  "nullable": true,
                  "type": "string"
                },
                "label": {
                  "type": "string"
                },
                "level": {
                  "enum": ["order", "item"],
                  "type": "string"
                },
                "note": {
                  "description": "Which items have it, when only some do (“Templates only”).",
                  "nullable": true,
                  "type": "string"
                },
                "ops": {
                  "items": {
                    "enum": [
                      "at_least",
                      "under",
                      "between",
                      "is",
                      "is_any_of",
                      "is_none_of",
                      "contains"
                    ],
                    "type": "string"
                  },
                  "type": "array"
                },
                "type": {
                  "description": "What its `value` is (see a condition’s `value`).",
                  "enum": ["money", "count", "set", "text", "bool", "delivery"],
                  "type": "string"
                }
              },
              "required": [
                "field",
                "label",
                "level",
                "type",
                "ops",
                "choices_source",
                "note",
                "from_shopify"
              ],
              "type": "object"
            },
            "type": "array"
          },
          "signature": {
            "$ref": "#/components/schemas/OrderRequirementKind"
          }
        },
        "required": [
          "signature",
          "deposit",
          "categories",
          "rule_fields",
          "limits"
        ],
        "type": "object"
      },
      "OrderSerials": {
        "properties": {
          "lines": {
            "items": {
              "properties": {
                "entered": {
                  "description": "Fulfilled units with a serial.",
                  "type": "integer"
                },
                "fulfilled": {
                  "description": "Fulfilled units: each one can take a serial.",
                  "type": "integer"
                },
                "line_id": {
                  "type": "string"
                },
                "missing": {
                  "description": "Fulfilled units still missing one (0 when it isn’t required).",
                  "type": "integer"
                },
                "ordered": {
                  "type": "integer"
                },
                "required": {
                  "description": "Its product (or a warranty plan sold on it) asks for a serial on every fulfilled unit.",
                  "type": "boolean"
                },
                "sku": {
                  "nullable": true,
                  "type": "string"
                },
                "title": {
                  "type": "string"
                },
                "units": {
                  "items": {
                    "properties": {
                      "serial": {
                        "nullable": true,
                        "type": "string"
                      },
                      "shipped_at": {
                        "format": "date-time",
                        "nullable": true,
                        "type": "string"
                      },
                      "state": {
                        "enum": ["delivered", "in_transit", "not_fulfilled"],
                        "type": "string"
                      },
                      "unit_number": {
                        "description": "Which unit of the line, from 1 (as `GET /units/{serial}`).",
                        "type": "integer"
                      }
                    },
                    "type": "object"
                  },
                  "type": "array"
                }
              },
              "type": "object"
            },
            "type": "array"
          },
          "version": {
            "description": "Send it back as `version` with the next save, exactly as it is: it stands for every unit’s `previous_serial`, and every save answers the new one, so no read is needed between saves.",
            "type": "string"
          }
        },
        "type": "object"
      },
      "OrderSummary": {
        "properties": {
          "balance_due": {
            "description": "What is left to pay, in `currency`, two decimals: the total less what was paid, never below 0 (a refund doesn’t add to it). A split order’s parts are summed.",
            "type": "number"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "currency": {
            "type": "string"
          },
          "customer": {
            "description": "`email` only for callers who may read customers.",
            "nullable": true,
            "properties": {
              "email": {
                "nullable": true,
                "type": "string"
              },
              "id": {
                "type": "string"
              },
              "name": {
                "nullable": true,
                "type": "string"
              }
            },
            "required": ["id", "name"],
            "type": "object"
          },
          "id": {
            "type": "string"
          },
          "number": {
            "type": "string"
          },
          "number_final": {
            "description": "Whether `number` is the one the record keeps. False while it is OrderPilot’s own (`#94`) and its Shopify draft, whose name (`#D1008`) replaces it, is still to be made: don’t give that number to anyone, read the record again. A quote saved as a draft only is false too: its next save makes its draft. Placing an order gives it its Shopify order number.",
            "type": "boolean"
          },
          "status": {
            "description": "The status name as the merchant has it now. It can be renamed: match on `status_id` or `status_group`.",
            "nullable": true,
            "type": "string"
          },
          "status_group": {
            "description": "The stable key of the status’s group; null for a merchant’s own group or none.",
            "enum": [
              "quote",
              "confirmed",
              "in_production",
              "ready",
              "on_its_way",
              "complete",
              "cancelled",
              null
            ],
            "nullable": true,
            "type": "string"
          },
          "status_id": {
            "description": "The status’s id. Stable across renames.",
            "nullable": true,
            "type": "string"
          },
          "sync_status": {
            "description": "Whether the latest change has reached Shopify. `pending` while the Shopify draft is made or updated (a few seconds after a create or an edit): the `number` (a draft name such as `#D1008` replaces OrderPilot’s own `#94`) and the totals (Shopify works out the tax) are final once it is `synced`. `failed`: send it again with `POST /quotes/{id}/sync-retry` or `POST /orders/{id}/sync-retry` (the order page’s Retry sync). Read the record again until it is `synced`; no webhook event announces the draft. On an order already placed in Shopify an edit is `pending` while Shopify’s order edit runs on the queue.",
            "enum": ["pending", "synced", "failed"],
            "type": "string"
          },
          "total": {
            "description": "In `currency`, two decimals.",
            "type": "number"
          },
          "updated_at": {
            "format": "date-time",
            "type": "string"
          },
          "version": {
            "description": "Send it back as `version` with a change (`PATCH`): no read first. From a list it checks `updated_at` only; the record’s own read gives one that a Shopify sync alone doesn’t make stale.",
            "type": "string"
          }
        },
        "required": [
          "id",
          "number",
          "number_final",
          "status",
          "status_id",
          "status_group",
          "customer",
          "total",
          "balance_due",
          "currency",
          "sync_status",
          "created_at",
          "updated_at",
          "version"
        ],
        "type": "object"
      },
      "OrderSupply": {
        "properties": {
          "costs_hidden": {
            "description": "Present, with a `reason`, when cost figures were left out (the store keeps cost off the order page, or the caller may not see costs).",
            "properties": {
              "reason": {
                "type": "string"
              }
            },
            "required": ["reason"],
            "type": "object"
          },
          "lines": {
            "items": {
              "properties": {
                "cost_pending_reason": {
                  "description": "Why the cost is not final yet; null when it is.",
                  "nullable": true,
                  "type": "string"
                },
                "cost_status": {
                  "description": "Whether the cost is settled (`final`) or not yet.",
                  "enum": ["planned", "estimated", "final", "missing"],
                  "type": "string"
                },
                "costed_quantity": {
                  "description": "Units of the line with a cost recorded.",
                  "type": "integer"
                },
                "held": {
                  "description": "Received units of the line held for it, by location.",
                  "items": {
                    "properties": {
                      "location_id": {
                        "description": "As `GET /locations` `id`.",
                        "type": "string"
                      },
                      "location_name": {
                        "type": "string"
                      },
                      "units": {
                        "type": "integer"
                      }
                    },
                    "type": "object"
                  },
                  "type": "array"
                },
                "line_id": {
                  "description": "A line id from `GET /orders/{id}`.",
                  "type": "string"
                },
                "lost_while_cancelled": {
                  "description": "Units sold while staff had the order cancelled: the line needs another purchase order for them. 0 when none.",
                  "type": "integer"
                },
                "move": {
                  "description": "Received units held at another location that staff can move to the order’s location in OrderPilot (Move to …); null when none.",
                  "nullable": true,
                  "properties": {
                    "from_location_id": {
                      "type": "string"
                    },
                    "from_location_name": {
                      "type": "string"
                    },
                    "quantity": {
                      "type": "integer"
                    },
                    "to_location_id": {
                      "type": "string"
                    },
                    "to_location_name": {
                      "type": "string"
                    }
                  },
                  "type": "object"
                },
                "purchase_order": {
                  "description": "The newest purchase order the line is on; null when none.",
                  "nullable": true,
                  "properties": {
                    "created_at": {
                      "format": "date-time",
                      "type": "string"
                    },
                    "id": {
                      "description": "Opens with `GET /purchase-orders/{id}`.",
                      "type": "string"
                    },
                    "line_ordered_quantity": {
                      "description": "The same in the line’s own units, leaving out what the purchase order buys for stock: what the page’s “N of M received” prints.",
                      "type": "integer"
                    },
                    "line_received_quantity": {
                      "type": "integer"
                    },
                    "number": {
                      "nullable": true,
                      "type": "string"
                    },
                    "ordered_quantity": {
                      "description": "Units of the line ordered on it (the product’s units).",
                      "type": "integer"
                    },
                    "received_quantity": {
                      "type": "integer"
                    },
                    "sent_at": {
                      "description": "When it went to the vendor; null until then.",
                      "format": "date-time",
                      "nullable": true,
                      "type": "string"
                    },
                    "vendor_name": {
                      "nullable": true,
                      "type": "string"
                    }
                  },
                  "type": "object"
                },
                "purchase_orders": {
                  "description": "Every purchase order the line is on, oldest first (a line split 4 + 2).",
                  "items": {
                    "properties": {
                      "id": {
                        "type": "string"
                      },
                      "number": {
                        "nullable": true,
                        "type": "string"
                      },
                      "ordered_quantity": {
                        "type": "integer"
                      },
                      "received_quantity": {
                        "type": "integer"
                      },
                      "sent_at": {
                        "format": "date-time",
                        "nullable": true,
                        "type": "string"
                      },
                      "still_due": {
                        "description": "It still owes the line units (what it buys for stock doesn’t count).",
                        "type": "boolean"
                      },
                      "vendor_name": {
                        "nullable": true,
                        "type": "string"
                      }
                    },
                    "type": "object"
                  },
                  "type": "array"
                },
                "state": {
                  "description": "`received`: its goods arrived (from a purchase order or already in stock). `on_the_way`: a purchase order has not fully brought it in. `from_stock`: drawn from stock already there. `unknown`: nothing links it to supply yet.",
                  "enum": ["received", "on_the_way", "from_stock", "unknown"],
                  "type": "string"
                },
                "stock_hold": {
                  "description": "The hold on stock of a line sold from a stocked unit; null when none.",
                  "nullable": true,
                  "properties": {
                    "failed": {
                      "description": "Updating Shopify’s stock for it gave up after every retry.",
                      "type": "boolean"
                    },
                    "held_units": {
                      "description": "Units it still holds.",
                      "type": "integer"
                    },
                    "location_id": {
                      "nullable": true,
                      "type": "string"
                    },
                    "location_name": {
                      "type": "string"
                    },
                    "quantity": {
                      "description": "Units asked for.",
                      "type": "integer"
                    },
                    "retrying": {
                      "description": "With `failed`: it is still tried again.",
                      "type": "boolean"
                    },
                    "status": {
                      "description": "`pending`: asked for, not placed yet. `held`: its units are reserved. `short`: too few were in stock when the order was sent.",
                      "enum": ["pending", "held", "short"],
                      "type": "string"
                    }
                  },
                  "type": "object"
                },
                "total_cost": {
                  "description": "Every costed unit’s cost. Null: none, or hidden.",
                  "nullable": true,
                  "type": "number"
                },
                "unit_cost": {
                  "description": "Cost of one unit (its product’s and its costed options’). Null: not costed yet, or hidden.",
                  "nullable": true,
                  "type": "number"
                }
              },
              "type": "object"
            },
            "type": "array"
          }
        },
        "type": "object"
      },
      "OrderWarranty": {
        "properties": {
          "lines": {
            "description": "Each order line with its parts, terms, exclusions and plans.",
            "items": {
              "properties": {
                "addable": {
                  "items": {
                    "properties": {
                      "current_months": {
                        "nullable": true,
                        "type": "integer"
                      },
                      "definition_id": {
                        "type": "string"
                      },
                      "name": {
                        "type": "string"
                      }
                    },
                    "type": "object"
                  },
                  "type": "array"
                },
                "carries_warranty": {
                  "type": "boolean"
                },
                "order_line_item_id": {
                  "type": "string"
                },
                "plans": {
                  "items": {
                    "properties": {
                      "covered_component_keys": {
                        "items": {
                          "type": "string"
                        },
                        "type": "array"
                      },
                      "covers_whole_product": {
                        "type": "boolean"
                      },
                      "line_total": {
                        "type": "number"
                      },
                      "months": {
                        "type": "integer"
                      },
                      "name": {
                        "type": "string"
                      },
                      "plan_key": {
                        "type": "string"
                      },
                      "quantity_sold": {
                        "type": "integer"
                      },
                      "unit_price": {
                        "type": "number"
                      }
                    },
                    "type": "object"
                  },
                  "type": "array"
                },
                "quantity": {
                  "type": "integer"
                },
                "resolved_category_name": {
                  "nullable": true,
                  "type": "string"
                },
                "resolved_vendor_name": {
                  "nullable": true,
                  "type": "string"
                },
                "rows": {
                  "items": {
                    "properties": {
                      "component_key": {
                        "description": "What `component_key` takes when starting a claim.",
                        "type": "string"
                      },
                      "component_name": {
                        "type": "string"
                      },
                      "excluded": {
                        "type": "boolean"
                      },
                      "extended_months": {
                        "type": "integer"
                      },
                      "extended_text": {
                        "type": "string"
                      },
                      "is_product": {
                        "type": "boolean"
                      },
                      "locked": {
                        "type": "boolean"
                      },
                      "months": {
                        "description": "Null: no cover.",
                        "nullable": true,
                        "type": "integer"
                      },
                      "option_label": {
                        "nullable": true,
                        "type": "string"
                      },
                      "option_swatch_color": {
                        "nullable": true,
                        "type": "string"
                      },
                      "option_value_label": {
                        "nullable": true,
                        "type": "string"
                      },
                      "overridden": {
                        "type": "boolean"
                      },
                      "source": {
                        "description": "Where the term came from.",
                        "enum": [
                          "store_policy",
                          "vendor_policy",
                          "category_policy",
                          "category_vendor_policy",
                          "template",
                          "product",
                          "line",
                          null
                        ],
                        "nullable": true,
                        "type": "string"
                      },
                      "source_label": {
                        "type": "string"
                      },
                      "term_text": {
                        "type": "string"
                      },
                      "total_text": {
                        "type": "string"
                      },
                      "unexcluded": {
                        "type": "boolean"
                      }
                    },
                    "type": "object"
                  },
                  "type": "array"
                },
                "title": {
                  "type": "string"
                },
                "trace": {
                  "items": {
                    "properties": {
                      "applied": {
                        "type": "boolean"
                      },
                      "label": {
                        "type": "string"
                      },
                      "note": {
                        "nullable": true,
                        "type": "string"
                      },
                      "says": {
                        "type": "string"
                      }
                    },
                    "type": "object"
                  },
                  "type": "array"
                }
              },
              "type": "object"
            },
            "type": "array"
          },
          "term_presets": {
            "description": "The store’s warranty term choices, in months.",
            "items": {
              "type": "integer"
            },
            "type": "array"
          }
        },
        "required": ["lines", "term_presets"],
        "type": "object"
      },
      "PaperScanFromUrl": {
        "properties": {
          "file_name": {
            "description": "The name to keep it under (up to 255 characters; its extension becomes the one its bytes are). Default: the address’s last part.",
            "nullable": true,
            "type": "string"
          },
          "url": {
            "description": "Where the scan is: a public https address (up to 2,048 characters). A key fetches at most 50 files from web addresses a day, each counted before it is fetched (`403 CAP_EXCEEDED`, `reason` `daily_url_fetches`).",
            "type": "string"
          }
        },
        "required": ["url"],
        "type": "object"
      },
      "PayLink": {
        "properties": {
          "payment_turned_on": {
            "description": "This call is what turned customer payment on (while the store asks for it to be turned on).",
            "type": "boolean"
          },
          "pays_each_part": {
            "description": "A split order: the link opens its page, where the customer pays each part.",
            "type": "boolean"
          },
          "url": {
            "description": "The payment link, to send the customer yourself.",
            "type": "string"
          }
        },
        "type": "object"
      },
      "PaymentRecord": {
        "properties": {
          "amount": {
            "description": "A part payment, in the order’s currency (Shopify Plus only). Leave it out to mark the order paid in full.",
            "type": "number"
          },
          "note": {
            "description": "How it was paid (“Cash”, “Cheque 1042”, “Bank transfer”), kept with the payment (up to 255 characters).",
            "type": "string"
          },
          "paid_at": {
            "description": "When the store received the money, with `amount`: a date (`2026-11-24`, noon in the store’s time zone) or a date and time with its offset (`2026-11-24T15:30:00-05:00`). Not in the future, nor before the order was placed. The payment is dated by it in Shopify and OrderPilot. Left out: now. Paid in full (no `amount`) takes no date: Shopify’s Mark as paid has none.",
            "type": "string"
          }
        },
        "type": "object"
      },
      "PaymentRequest": {
        "properties": {
          "amount": {
            "description": "What it asked for, two decimals.",
            "type": "number"
          },
          "cancellable": {
            "description": "Still open, so `POST /payment-requests/{id}/cancel` may cancel it.",
            "type": "boolean"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "currency": {
            "type": "string"
          },
          "deposit_percent": {
            "description": "A deposit asked for as a percentage of the total; null otherwise.",
            "nullable": true,
            "type": "number"
          },
          "id": {
            "type": "string"
          },
          "kind": {
            "description": "`payment`: a request for the balance (a Request payment email, or an older invoice); `deposit`: a deposit order (without Shopify Plus); `store_credit`: paid from the customer’s store credit; `pos`: taken on POS; `before_orderpilot`: paid before the store moved to OrderPilot, brought in by an import (its `note` says how).",
            "enum": [
              "payment",
              "deposit",
              "store_credit",
              "pos",
              "before_orderpilot"
            ],
            "type": "string"
          },
          "link": {
            "description": "While it is `pending`: the link the customer pays it with (a balance request’s payment link, a deposit order’s checkout). Only for a caller who may ask for payment (Record and request payments); null otherwise.",
            "nullable": true,
            "type": "string"
          },
          "note": {
            "nullable": true,
            "type": "string"
          },
          "paid_amount": {
            "description": "What was paid against it, two decimals.",
            "type": "number"
          },
          "paid_at": {
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "part": {
            "description": "A split order’s part the request is on: `pickup` (the Store pickup items) or `delivery`. Null when the order is one Shopify order.",
            "enum": ["pickup", "delivery", null],
            "nullable": true,
            "type": "string"
          },
          "status": {
            "description": "`pending` while it waits for the customer; `settled` for a balance request once nothing is due (its payment is a row of its own); `paid`, `partial`, `expired`, `cancelled`.",
            "enum": [
              "pending",
              "paid",
              "partial",
              "expired",
              "cancelled",
              "settled"
            ],
            "type": "string"
          }
        },
        "type": "object"
      },
      "PaymentRequestCreate": {
        "properties": {
          "bcc": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "cc": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "deposit": {
            "description": "A deposit instead of the balance: `percent` (of the total; on Shopify Plus, 1–99 of the subtotal before shipping and tax) or `amount`, less than the balance due. Leave it out to ask for the balance.",
            "properties": {
              "amount": {
                "description": "Above 0, two decimals.",
                "type": "number"
              },
              "percent": {
                "description": "Above 0 and below 100, two decimals.",
                "type": "number"
              }
            },
            "type": "object"
          },
          "send_at": {
            "description": "The balance’s email: schedule it for this time (ISO 8601 with its offset; at least a minute ahead, within the composer’s limit) instead of now. As the composer’s Schedule, it is the email only: no payment request is recorded and customer payment isn’t turned on by it (`POST /orders/{id}/customer-payment`, or the quote’s, does that). It takes one from the Emails per day cap now. Not with `deposit`.",
            "format": "date-time",
            "type": "string"
          },
          "send_email": {
            "description": "Email the customer (default true; it needs Send emails). `false` only with a deposit without Shopify Plus: the deposit order is made and its `link` is yours to hand out. For the balance without an email, use `POST /orders/{id}/pay-link`.",
            "type": "boolean"
          },
          "template_key": {
            "description": "The balance request’s email: a Request payment template from `GET /email-templates` (one whose `preset` is `request-payment`: the shipped one, a copy or a brand version of it); default the store’s Request payment.",
            "type": "string"
          },
          "to": {
            "description": "The balance request’s email: up to 5 addresses; the customer’s own when left out. A deposit is emailed to the customer’s address.",
            "items": {
              "type": "string"
            },
            "type": "array"
          }
        },
        "type": "object"
      },
      "PaymentRequestList": {
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/PaymentRequest"
            },
            "type": "array"
          },
          "next_cursor": {
            "description": "Always null: every request is on the one page.",
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "PaymentRequestOutcome": {
        "properties": {
          "deposit": {
            "description": "The deposit asked for; null for the balance.",
            "nullable": true,
            "properties": {
              "amount": {
                "description": "In `currency`, two decimals.",
                "type": "number"
              },
              "percent": {
                "nullable": true,
                "type": "number"
              }
            },
            "type": "object"
          },
          "emailed": {
            "description": "An email to the customer was queued (a deposit’s is sent once its deposit order is made).",
            "type": "boolean"
          },
          "next": {
            "description": "What to do next, when something is left: on Shopify Plus, the email that asks for the deposit once Shopify has it.",
            "nullable": true,
            "type": "string"
          },
          "payment_request": {
            "allOf": [
              {
                "$ref": "#/components/schemas/PaymentRequest"
              }
            ],
            "description": "The request made; null when only a Shopify Plus deposit was set on the draft (see `next`).",
            "nullable": true
          },
          "schedule_id": {
            "description": "With `send_at`: the scheduled email, for its cancel (`DELETE /orders/{id}/payment-requests/scheduled/{scheduleId}`, or the quote’s). Null otherwise.",
            "nullable": true,
            "type": "string"
          },
          "scheduled_at": {
            "description": "With `send_at`: when the email goes. Null for a request sent now.",
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "to": {
            "description": "Who the email goes to.",
            "items": {
              "type": "string"
            },
            "type": "array"
          }
        },
        "type": "object"
      },
      "PaymentTermsList": {
        "properties": {
          "deposits_allowed": {
            "description": "Deposits need Shopify Plus.",
            "type": "boolean"
          },
          "items": {
            "items": {
              "properties": {
                "description": {
                  "type": "string"
                },
                "due_in_days": {
                  "nullable": true,
                  "type": "integer"
                },
                "id": {
                  "type": "string"
                },
                "name": {
                  "type": "string"
                },
                "type": {
                  "description": "When payment is due: on `receipt`, on `fulfillment`, `net` days after the issue date, or on a `fixed` date.",
                  "enum": ["receipt", "fulfillment", "net", "fixed", "unknown"],
                  "type": "string"
                }
              },
              "type": "object"
            },
            "type": "array"
          }
        },
        "type": "object"
      },
      "Pdf": {
        "format": "binary",
        "type": "string"
      },
      "PermissionList": {
        "properties": {
          "items": {
            "items": {
              "properties": {
                "group": {
                  "description": "The role editor’s group it is listed under.",
                  "enum": [
                    "orders",
                    "pricing",
                    "approvals",
                    "payments",
                    "customers",
                    "warranty",
                    "purchasing",
                    "receiving",
                    "costs",
                    "catalog",
                    "reports",
                    "administration"
                  ],
                  "type": "string"
                },
                "group_label": {
                  "type": "string"
                },
                "help": {
                  "description": "One line under the checkbox; empty when the label says it all.",
                  "type": "string"
                },
                "id": {
                  "description": "Lowercase, as `GET /roles` and `GET /me` name it: what a role’s `permissions` takes.",
                  "type": "string"
                },
                "irreversible": {
                  "description": "It deletes or resets something that can’t be brought back.",
                  "type": "boolean"
                },
                "label": {
                  "type": "string"
                },
                "needs": {
                  "description": "The permissions it turns on with it (their `id`s): a role given it holds these too.",
                  "items": {
                    "type": "string"
                  },
                  "type": "array"
                },
                "sensitive": {
                  "description": "Money, costs or access: flagged in the editor.",
                  "type": "boolean"
                }
              },
              "required": [
                "id",
                "label",
                "help",
                "group",
                "group_label",
                "sensitive",
                "irreversible",
                "needs"
              ],
              "type": "object"
            },
            "type": "array"
          }
        },
        "required": ["items"],
        "type": "object"
      },
      "ProductCategoryList": {
        "properties": {
          "items": {
            "items": {
              "properties": {
                "full_name": {
                  "description": "Its place in the taxonomy (`Furniture > Sofas > Sectional Sofas`).",
                  "type": "string"
                },
                "id": {
                  "description": "The category’s GID (`gid://shopify/TaxonomyCategory/fr-1-2`): what a product import’s `category_id` takes.",
                  "type": "string"
                },
                "taxonomy_id": {
                  "description": "The same id as Shopify’s taxonomy writes it (`fr-1-2`); also taken.",
                  "type": "string"
                }
              },
              "required": ["id", "taxonomy_id", "full_name"],
              "type": "object"
            },
            "type": "array"
          },
          "next_cursor": {
            "description": "Pass it as `cursor` (with the same `q`) for the next page; null on the last.",
            "nullable": true,
            "type": "string"
          }
        },
        "required": ["items", "next_cursor"],
        "type": "object"
      },
      "ProductComposition": {
        "properties": {
          "is_composition": {
            "type": "boolean"
          },
          "part_of": {
            "description": "The compositions this product is a piece of.",
            "items": {
              "properties": {
                "product_id": {
                  "type": "string"
                },
                "title": {
                  "type": "string"
                }
              },
              "type": "object"
            },
            "type": "array"
          },
          "pieces": {
            "items": {
              "properties": {
                "price": {
                  "nullable": true,
                  "type": "number"
                },
                "product_id": {
                  "type": "string"
                },
                "quantity": {
                  "description": "How many one composition holds.",
                  "type": "integer"
                },
                "sku": {
                  "nullable": true,
                  "type": "string"
                },
                "title": {
                  "type": "string"
                },
                "variant_id": {
                  "description": "Its one variant: what a line takes.",
                  "type": "string"
                }
              },
              "type": "object"
            },
            "type": "array"
          },
          "problem": {
            "description": "Why the composition can’t be added (set up wrong in Shopify); null when it can.",
            "nullable": true,
            "type": "string"
          },
          "product_id": {
            "type": "string"
          },
          "skipped": {
            "items": {
              "properties": {
                "reason": {
                  "type": "string"
                },
                "title": {
                  "type": "string"
                }
              },
              "type": "object"
            },
            "type": "array"
          },
          "title": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "ProductFacets": {
        "properties": {
          "facet": {
            "enum": ["vendor", "product_type", "tag", "collection", "category"],
            "type": "string"
          },
          "values": {
            "items": {
              "properties": {
                "count": {
                  "description": "The products it would leave, with the other filters; null where it wasn’t counted.",
                  "nullable": true,
                  "type": "integer"
                },
                "label": {
                  "description": "Its name, as the menu shows it.",
                  "type": "string"
                },
                "value": {
                  "description": "What the filter takes: the vendor, type or tag as Shopify spells it, or a collection’s or category’s id.",
                  "type": "string"
                }
              },
              "required": ["value", "label", "count"],
              "type": "object"
            },
            "type": "array"
          }
        },
        "required": ["facet", "values"],
        "type": "object"
      },
      "ProductImport": {
        "properties": {
          "counts": {
            "properties": {
              "created": {
                "type": "integer"
              },
              "failed": {
                "type": "integer"
              },
              "pending": {
                "type": "integer"
              },
              "refused": {
                "type": "integer"
              },
              "updated": {
                "type": "integer"
              }
            },
            "required": ["pending", "created", "updated", "refused", "failed"],
            "type": "object"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "created_by": {
            "description": "“API key: <name>”, or the staff member to a caller that may read the staff (`GET /staff`), never by an email; null to any other caller.",
            "nullable": true,
            "type": "string"
          },
          "finished_at": {
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "items": {
            "description": "In the order they were sent.",
            "items": {
              "properties": {
                "error": {
                  "description": "Why it was refused or failed, and what to do.",
                  "nullable": true,
                  "type": "string"
                },
                "handle": {
                  "type": "string"
                },
                "index": {
                  "type": "integer"
                },
                "key": {
                  "type": "string"
                },
                "shopify_product_id": {
                  "description": "The product’s GID once it is written.",
                  "nullable": true,
                  "type": "string"
                },
                "status": {
                  "enum": [
                    "pending",
                    "created",
                    "updated",
                    "refused",
                    "failed"
                  ],
                  "type": "string"
                },
                "updated_at": {
                  "format": "date-time",
                  "type": "string"
                }
              },
              "required": [
                "index",
                "key",
                "handle",
                "status",
                "shopify_product_id",
                "error"
              ],
              "type": "object"
            },
            "type": "array"
          },
          "started_at": {
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "status": {
            "description": "`completed`: every item was created, updated or refused. `failed`: the worker gave up; the items it never reached are `failed`.",
            "enum": ["queued", "running", "completed", "failed"],
            "type": "string"
          },
          "total": {
            "type": "integer"
          }
        },
        "required": ["id", "status", "total", "counts", "items"],
        "type": "object"
      },
      "ProductImportCreate": {
        "description": "Up to 100 products. The whole call is checked first: one item that can’t be read is `400 INVALID_BODY` naming it, and nothing is imported. The body is at most 256 KB: send fewer items when they have many variants.",
        "properties": {
          "items": {
            "description": "1–100 products, each with a different `key` and `handle`.",
            "items": {
              "$ref": "#/components/schemas/ProductImportItemInput"
            },
            "type": "array"
          }
        },
        "required": ["items"],
        "type": "object"
      },
      "ProductImportItemInput": {
        "properties": {
          "category_id": {
            "description": "A Shopify product category (standard taxonomy) id, like `aa-1-13`, or its GID.",
            "type": "string"
          },
          "channels": {
            "description": "Where it is published. Left out: none, as a stock purchase order’s new products (a new product is kept off every channel that adds new products by itself). An update only adds channels.",
            "items": {
              "enum": ["point_of_sale", "online_store"],
              "type": "string"
            },
            "type": "array"
          },
          "description_html": {
            "description": "HTML, up to 64 KB.",
            "type": "string"
          },
          "handle": {
            "description": "The Shopify handle it is created under and found by on a re-run (lowercase letters, digits and hyphens; other characters become hyphens). Defaults to one made from `key`, never from the title.",
            "type": "string"
          },
          "images": {
            "description": "Up to 20, by public URL (Shopify downloads them). On an update only images not imported before are added; none is removed.",
            "items": {
              "properties": {
                "alt": {
                  "description": "Up to 512 characters.",
                  "type": "string"
                },
                "source_url": {
                  "type": "string"
                }
              },
              "required": ["source_url"],
              "type": "object"
            },
            "type": "array"
          },
          "key": {
            "description": "The product’s stable id in the system it comes from; a re-run sends the same. Defaults to the handle. `key` or `handle` is required.",
            "type": "string"
          },
          "options": {
            "description": "Up to 3 (Shopify’s limit). Left out: the product has one variant and no options.",
            "items": {
              "properties": {
                "name": {
                  "type": "string"
                },
                "values": {
                  "description": "The values in the order to show them, each used by a variant. Left out: the variants’ own, in their order.",
                  "items": {
                    "type": "string"
                  },
                  "type": "array"
                }
              },
              "required": ["name"],
              "type": "object"
            },
            "type": "array"
          },
          "product_type": {
            "type": "string"
          },
          "status": {
            "description": "A new product without one is created `draft`; an update without one leaves it as it is.",
            "enum": ["active", "draft", "unlisted", "archived"],
            "type": "string"
          },
          "tags": {
            "description": "Up to 250. Left out: an updated product keeps its tags. A tag with “OrderPilot” or “Order Pilot” in it is refused (OrderPilot hides its own products by them).",
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "title": {
            "description": "Up to 255 characters.",
            "type": "string"
          },
          "variants": {
            "description": "1–100. An update must list every variant the product has: an import never removes one.",
            "items": {
              "$ref": "#/components/schemas/ProductImportVariantInput"
            },
            "type": "array"
          },
          "vendor": {
            "description": "Shopify’s vendor. A new vendor name becomes a vendor in OrderPilot once the import finishes.",
            "type": "string"
          }
        },
        "required": ["title", "variants"],
        "type": "object"
      },
      "ProductImportVariantInput": {
        "properties": {
          "barcode": {
            "type": "string"
          },
          "compare_at_price": {
            "description": "At most 2 decimals.",
            "type": "number"
          },
          "cost": {
            "description": "Shopify’s unit cost, at most 2 decimals. Needs Enter costs and charges (a key: Enter and correct costs), or OrderPilot’s data migration connection; another caller’s item with a cost is refused.",
            "type": "number"
          },
          "inventory_policy": {
            "description": "At 0 in stock: stop selling (`deny`, Shopify’s default) or keep selling.",
            "enum": ["deny", "continue"],
            "type": "string"
          },
          "option_values": {
            "description": "One value per option, in the options’ order. Left out when the product has no options.",
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "price": {
            "description": "Selling price, at most 2 decimals.",
            "type": "number"
          },
          "quantities": {
            "description": "Stock available at each location (up to 20; an item sets at most 250 in all). Set, never added: a re-run leaves the same numbers.",
            "items": {
              "properties": {
                "available": {
                  "description": "0 to 1,000,000.",
                  "type": "integer"
                },
                "location_id": {
                  "description": "A location id from `GET /locations`.",
                  "type": "string"
                }
              },
              "required": ["location_id", "available"],
              "type": "object"
            },
            "type": "array"
          },
          "sku": {
            "type": "string"
          },
          "tracked": {
            "description": "Whether Shopify counts its stock. Default true.",
            "type": "boolean"
          }
        },
        "type": "object"
      },
      "ProductRequirements": {
        "properties": {
          "category": {
            "description": "The OrderPilot category its lines get, with what it asks.",
            "nullable": true,
            "properties": {
              "name": {
                "type": "string"
              },
              "required_deposit_percent": {
                "nullable": true,
                "type": "number"
              },
              "requires_signature": {
                "type": "boolean"
              }
            },
            "type": "object"
          },
          "product_id": {
            "type": "string"
          },
          "required_deposit_percent": {
            "description": "The product’s own deposit before an order is placed (0: none); null: its category’s.",
            "nullable": true,
            "type": "number"
          },
          "requires_signature": {
            "description": "The product’s own choice; null: its category’s.",
            "nullable": true,
            "type": "boolean"
          },
          "template": {
            "description": "The template whose Shopify product this is: its lines take its setting.",
            "nullable": true,
            "properties": {
              "id": {
                "type": "string"
              },
              "title": {
                "type": "string"
              }
            },
            "type": "object"
          }
        },
        "type": "object"
      },
      "ProductRequirementsEdit": {
        "properties": {
          "required_deposit_percent": {
            "description": "0–100, two decimals; `null`: its category’s.",
            "nullable": true,
            "type": "number"
          },
          "requires_signature": {
            "description": "`null`: its category’s.",
            "nullable": true,
            "type": "boolean"
          }
        },
        "type": "object"
      },
      "ProductSpecEntries": {
        "properties": {
          "items": {
            "items": {
              "properties": {
                "id": {
                  "description": "The metaobject entry’s id.",
                  "type": "string"
                },
                "image_url": {
                  "nullable": true,
                  "type": "string"
                },
                "label": {
                  "type": "string"
                }
              },
              "type": "object"
            },
            "type": "array"
          }
        },
        "type": "object"
      },
      "ProductSpecFields": {
        "properties": {
          "fields": {
            "items": {
              "properties": {
                "image_url": {
                  "nullable": true,
                  "type": "string"
                },
                "key": {
                  "description": "The spec’s key, matched to a line’s field.",
                  "type": "string"
                },
                "label": {
                  "type": "string"
                },
                "value": {
                  "type": "string"
                }
              },
              "type": "object"
            },
            "type": "array"
          },
          "product_id": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "ProductSpecSheet": {
        "properties": {
          "location_id": {
            "type": "string"
          },
          "product_id": {
            "type": "string"
          },
          "url": {
            "description": "The PDF, for 10 minutes, no sign-in needed.",
            "type": "string"
          }
        },
        "type": "object"
      },
      "ProfitBreakdown": {
        "properties": {
          "items": {
            "items": {
              "properties": {
                "commission": {
                  "description": "Two decimals.",
                  "type": "number"
                },
                "cost": {
                  "description": "Goods cost: landed cost less the freight in it.",
                  "type": "number"
                },
                "currency": {
                  "type": "string"
                },
                "estimated": {
                  "description": "Some cost is an estimate (nothing drawn yet, or a receipt not final).",
                  "type": "boolean"
                },
                "freight": {
                  "description": "Two decimals.",
                  "type": "number"
                },
                "key": {
                  "type": "string"
                },
                "label": {
                  "type": "string"
                },
                "lines": {
                  "type": "integer"
                },
                "margin_percent": {
                  "description": "A percentage to one place or two; null when there is nothing to divide by.",
                  "nullable": true,
                  "type": "number"
                },
                "net": {
                  "description": "selling − cost − freight − commission.",
                  "type": "number"
                },
                "options": {
                  "description": "A configuration’s options; empty for anything else.",
                  "items": {
                    "properties": {
                      "field": {
                        "type": "string"
                      },
                      "value": {
                        "type": "string"
                      }
                    },
                    "type": "object"
                  },
                  "type": "array"
                },
                "orders": {
                  "type": "integer"
                },
                "selling": {
                  "description": "Net merchandise: after discounts, without tax.",
                  "type": "number"
                },
                "uncosted_lines": {
                  "description": "Lines with no cost recorded anywhere: their net counts the whole price.",
                  "type": "integer"
                },
                "units": {
                  "type": "integer"
                }
              },
              "type": "object"
            },
            "type": "array"
          },
          "of": {
            "enum": ["configuration", "product"],
            "type": "string"
          },
          "rest": {
            "description": "Everything past the first five, added up; null when there is nothing more.",
            "nullable": true,
            "properties": {
              "commission": {
                "description": "Two decimals.",
                "type": "number"
              },
              "cost": {
                "description": "Goods cost: landed cost less the freight in it.",
                "type": "number"
              },
              "count": {
                "type": "integer"
              },
              "currency": {
                "type": "string"
              },
              "estimated": {
                "description": "Some cost is an estimate (nothing drawn yet, or a receipt not final).",
                "type": "boolean"
              },
              "freight": {
                "description": "Two decimals.",
                "type": "number"
              },
              "lines": {
                "type": "integer"
              },
              "margin_percent": {
                "description": "A percentage to one place or two; null when there is nothing to divide by.",
                "nullable": true,
                "type": "number"
              },
              "net": {
                "description": "selling − cost − freight − commission.",
                "type": "number"
              },
              "orders": {
                "type": "integer"
              },
              "selling": {
                "description": "Net merchandise: after discounts, without tax.",
                "type": "number"
              },
              "uncosted_lines": {
                "description": "Lines with no cost recorded anywhere: their net counts the whole price.",
                "type": "integer"
              },
              "units": {
                "type": "integer"
              }
            },
            "type": "object"
          }
        },
        "type": "object"
      },
      "ProfitReport": {
        "properties": {
          "group_by": {
            "type": "string"
          },
          "items": {
            "items": {
              "properties": {
                "children": {
                  "description": "Configurations (by product or template) or products inside.",
                  "type": "integer"
                },
                "commission": {
                  "description": "Two decimals.",
                  "type": "number"
                },
                "cost": {
                  "description": "Goods cost: landed cost less the freight in it.",
                  "type": "number"
                },
                "currency": {
                  "type": "string"
                },
                "estimated": {
                  "description": "Some cost is an estimate (nothing drawn yet, or a receipt not final).",
                  "type": "boolean"
                },
                "freight": {
                  "description": "Two decimals.",
                  "type": "number"
                },
                "key": {
                  "description": "What `GET /reports/profit/breakdown` takes as `key`.",
                  "type": "string"
                },
                "label": {
                  "type": "string"
                },
                "lines": {
                  "type": "integer"
                },
                "margin_percent": {
                  "description": "A percentage to one place or two; null when there is nothing to divide by.",
                  "nullable": true,
                  "type": "number"
                },
                "net": {
                  "description": "selling − cost − freight − commission.",
                  "type": "number"
                },
                "options": {
                  "description": "A configuration’s options; empty for anything else.",
                  "items": {
                    "properties": {
                      "field": {
                        "type": "string"
                      },
                      "value": {
                        "type": "string"
                      }
                    },
                    "type": "object"
                  },
                  "type": "array"
                },
                "orders": {
                  "type": "integer"
                },
                "selling": {
                  "description": "Net merchandise: after discounts, without tax.",
                  "type": "number"
                },
                "uncosted_lines": {
                  "description": "Lines with no cost recorded anywhere: their net counts the whole price.",
                  "type": "integer"
                },
                "units": {
                  "type": "integer"
                }
              },
              "type": "object"
            },
            "type": "array"
          },
          "next_cursor": {
            "nullable": true,
            "type": "string"
          },
          "period": {
            "properties": {
              "from": {
                "description": "YYYY-MM-DD, a day of the store’s.",
                "type": "string"
              },
              "to": {
                "description": "YYYY-MM-DD, a day of the store’s.",
                "type": "string"
              }
            },
            "type": "object"
          },
          "series": {
            "description": "The chart per currency (first page only; null on later pages).",
            "items": {
              "properties": {
                "currency": {
                  "type": "string"
                },
                "points": {
                  "items": {
                    "properties": {
                      "commission": {
                        "description": "Two decimals.",
                        "type": "number"
                      },
                      "cost": {
                        "description": "Two decimals.",
                        "type": "number"
                      },
                      "days": {
                        "type": "integer"
                      },
                      "end": {
                        "description": "YYYY-MM-DD, a day of the store’s.",
                        "type": "string"
                      },
                      "freight": {
                        "description": "Two decimals.",
                        "type": "number"
                      },
                      "margin_percent": {
                        "description": "A percentage to one place or two; null when there is nothing to divide by.",
                        "nullable": true,
                        "type": "number"
                      },
                      "net": {
                        "description": "Two decimals.",
                        "type": "number"
                      },
                      "selling": {
                        "description": "Two decimals.",
                        "type": "number"
                      },
                      "start": {
                        "description": "YYYY-MM-DD, a day of the store’s.",
                        "type": "string"
                      }
                    },
                    "type": "object"
                  },
                  "type": "array"
                },
                "unit": {
                  "enum": ["day", "week", "month"],
                  "type": "string"
                }
              },
              "type": "object"
            },
            "nullable": true,
            "type": "array"
          },
          "top_configurations": {
            "description": "The best-selling configurations by units, revenue and profit (first page only; null on later pages). A configuration is listed when it is in the top four of any ranking; `rank` is its place in each (1 first).",
            "items": {
              "properties": {
                "currency": {
                  "type": "string"
                },
                "key": {
                  "type": "string"
                },
                "options": {
                  "description": "A configuration’s options; empty for anything else.",
                  "items": {
                    "properties": {
                      "field": {
                        "type": "string"
                      },
                      "value": {
                        "type": "string"
                      }
                    },
                    "type": "object"
                  },
                  "type": "array"
                },
                "product_template_id": {
                  "type": "string"
                },
                "profit": {
                  "description": "Two decimals.",
                  "type": "number"
                },
                "rank": {
                  "properties": {
                    "profit": {
                      "type": "integer"
                    },
                    "revenue": {
                      "type": "integer"
                    },
                    "units": {
                      "type": "integer"
                    }
                  },
                  "type": "object"
                },
                "revenue": {
                  "description": "Two decimals.",
                  "type": "number"
                },
                "title": {
                  "type": "string"
                },
                "units": {
                  "type": "integer"
                }
              },
              "type": "object"
            },
            "nullable": true,
            "type": "array"
          },
          "totals": {
            "description": "Per currency, every group of the period (not only this page).",
            "items": {
              "properties": {
                "commission": {
                  "description": "Two decimals.",
                  "type": "number"
                },
                "cost": {
                  "description": "Goods cost: landed cost less the freight in it.",
                  "type": "number"
                },
                "currency": {
                  "type": "string"
                },
                "estimated": {
                  "description": "Some cost is an estimate (nothing drawn yet, or a receipt not final).",
                  "type": "boolean"
                },
                "freight": {
                  "description": "Two decimals.",
                  "type": "number"
                },
                "groups": {
                  "type": "integer"
                },
                "lines": {
                  "type": "integer"
                },
                "margin_percent": {
                  "description": "A percentage to one place or two; null when there is nothing to divide by.",
                  "nullable": true,
                  "type": "number"
                },
                "net": {
                  "description": "selling − cost − freight − commission.",
                  "type": "number"
                },
                "orders": {
                  "type": "integer"
                },
                "selling": {
                  "description": "Net merchandise: after discounts, without tax.",
                  "type": "number"
                },
                "uncosted_lines": {
                  "description": "Lines with no cost recorded anywhere: their net counts the whole price.",
                  "type": "integer"
                },
                "units": {
                  "type": "integer"
                }
              },
              "type": "object"
            },
            "type": "array"
          }
        },
        "type": "object"
      },
      "PurchaseNeedExclude": {
        "properties": {
          "component_key": {
            "description": "The part: `lines[].components[].component_key` of `GET /orders/{id}/purchase-needs` (`line:` the product, `cfv:` an option).",
            "type": "string"
          },
          "excluded": {
            "description": "True leaves it off purchase orders; false puts it back.",
            "type": "boolean"
          },
          "source_line_item_id": {
            "description": "The order line: `lines[].source_line_item_id` of `GET /orders/{id}/purchase-needs`.",
            "type": "string"
          }
        },
        "required": ["source_line_item_id", "component_key", "excluded"],
        "type": "object"
      },
      "PurchaseNeedExcluded": {
        "properties": {
          "component_key": {
            "type": "string"
          },
          "excluded": {
            "type": "boolean"
          },
          "order_id": {
            "type": "string"
          },
          "source_line_item_id": {
            "type": "string"
          },
          "title": {
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "PurchaseOrder": {
        "properties": {
          "content_version": {
            "description": "Send it back when changing the delivery: the save is refused if the purchase order changed since. `version` holds it.",
            "type": "integer"
          },
          "cost_status": {
            "enum": ["planned", "estimated", "final", "missing"],
            "type": "string"
          },
          "costs_hidden": {
            "description": "Present, with a `reason`, when money was left out.",
            "properties": {
              "reason": {
                "type": "string"
              }
            },
            "required": ["reason"],
            "type": "object"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "delivery_address": {
            "nullable": true,
            "type": "string"
          },
          "delivery_type": {
            "enum": ["store", "customer", "dropship"],
            "type": "string"
          },
          "finalized_at": {
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "internal_notes": {
            "nullable": true,
            "type": "string"
          },
          "lines": {
            "items": {
              "properties": {
                "charge_parts": {
                  "description": "One purchase order’s read, only with “View costs”: the parts a charge can cover on its own, as the Add charge dialog lists them (the base cost, then each costed option). A charge’s `targets[]` takes one as `{ line_id, option_label, option_value, option_unit_cost }`. Empty when the line’s cost isn’t split into parts: target the whole line.",
                  "items": {
                    "properties": {
                      "option_label": {
                        "description": "What `option_label` takes (`Base` for the base cost).",
                        "type": "string"
                      },
                      "option_unit_cost": {
                        "description": "The part’s vendor cost per unit.",
                        "type": "number"
                      },
                      "option_value": {
                        "description": "What `option_value` takes.",
                        "type": "string"
                      }
                    },
                    "required": [
                      "option_label",
                      "option_value",
                      "option_unit_cost"
                    ],
                    "type": "object"
                  },
                  "type": "array"
                },
                "customer_order_number": {
                  "nullable": true,
                  "type": "string"
                },
                "id": {
                  "type": "string"
                },
                "item_label": {
                  "nullable": true,
                  "type": "string"
                },
                "kind": {
                  "description": "What it buys: an order line, a product the store sells in Shopify, a product made in Shopify for this purchase order, or a template configuration.",
                  "enum": ["order_line", "stock", "new_product", "template"],
                  "type": "string"
                },
                "new_product": {
                  "description": "A `new_product` line only: its Shopify product. `creating` while it is being made (seconds), `failed` with the `reason` (`POST /purchase-orders/{id}/new-products/retry` tries again), `not_queued` when it waits for that retry, `made` with the product’s and variant’s ids. `GET /purchase-orders/{id}/new-products` lists only the lines not made yet.",
                  "properties": {
                    "product_id": {
                      "description": "The Shopify product, once made.",
                      "nullable": true,
                      "type": "string"
                    },
                    "reason": {
                      "nullable": true,
                      "type": "string"
                    },
                    "status": {
                      "enum": ["creating", "failed", "not_queued", "made"],
                      "type": "string"
                    },
                    "variant_id": {
                      "description": "Its variant, once made.",
                      "nullable": true,
                      "type": "string"
                    }
                  },
                  "required": ["status", "reason", "product_id", "variant_id"],
                  "type": "object"
                },
                "price": {
                  "description": "Unit cost. Only with “View costs”.",
                  "type": "number"
                },
                "quantity": {
                  "type": "integer"
                },
                "received_quantity": {
                  "nullable": true,
                  "type": "integer"
                },
                "receiving_status": {
                  "enum": ["pending", "partial", "complete", "rejected", null],
                  "nullable": true,
                  "type": "string"
                },
                "rejected_quantity": {
                  "nullable": true,
                  "type": "integer"
                },
                "sku": {
                  "nullable": true,
                  "type": "string"
                },
                "source_line_item_id": {
                  "description": "The order line it buys, for an order line.",
                  "nullable": true,
                  "type": "string"
                },
                "source_order_id": {
                  "nullable": true,
                  "type": "string"
                },
                "template_id": {
                  "description": "The product template, for a template line.",
                  "nullable": true,
                  "type": "string"
                },
                "title": {
                  "nullable": true,
                  "type": "string"
                },
                "total_cost": {
                  "description": "Only with “View costs”.",
                  "type": "number"
                },
                "variant_id": {
                  "description": "The Shopify variant, for a stock line.",
                  "nullable": true,
                  "type": "string"
                }
              },
              "required": [
                "id",
                "title",
                "item_label",
                "sku",
                "quantity",
                "received_quantity",
                "rejected_quantity",
                "receiving_status",
                "source_order_id",
                "customer_order_number"
              ],
              "type": "object"
            },
            "type": "array"
          },
          "lines_truncated": {
            "type": "boolean"
          },
          "notes": {
            "nullable": true,
            "type": "string"
          },
          "number": {
            "description": "The PO number as printed.",
            "type": "string"
          },
          "original_number": {
            "description": "An imported purchase order’s number in the old system (the PO page’s Original PO number); `q` on the list finds it. Null otherwise.",
            "nullable": true,
            "type": "string"
          },
          "po_charges": {
            "description": "The charges on the whole purchase order. The final receipt names each of them in `final_charge_review`.",
            "items": {
              "properties": {
                "id": {
                  "type": "string"
                },
                "updated_at": {
                  "format": "date-time",
                  "type": "string"
                }
              },
              "required": ["id", "updated_at"],
              "type": "object"
            },
            "type": "array"
          },
          "po_id": {
            "type": "integer"
          },
          "received_at": {
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "receiving_notes": {
            "nullable": true,
            "type": "string"
          },
          "requested_delivery_date": {
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "sent_at": {
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "shipping": {
            "description": "Only with “View costs”.",
            "type": "number"
          },
          "source_order_ids": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "status": {
            "enum": [
              "draft",
              "sending",
              "sent",
              "partial",
              "partially_received",
              "received",
              "rejected",
              "completed"
            ],
            "type": "string"
          },
          "store_location_id": {
            "description": "The Shopify location whose stock the receipt counts at: what `store_location_id` takes (`GET /locations`). Null when none is set.",
            "nullable": true,
            "type": "string"
          },
          "subtotal": {
            "description": "Only with “View costs”.",
            "type": "number"
          },
          "tax": {
            "description": "Only with “View costs”.",
            "type": "number"
          },
          "total_amount": {
            "description": "Only with “View costs”.",
            "type": "number"
          },
          "updated_at": {
            "format": "date-time",
            "type": "string"
          },
          "vendor": {
            "properties": {
              "display_name": {
                "type": "string"
              },
              "id": {
                "type": "string"
              }
            },
            "required": ["id", "display_name"],
            "type": "object"
          },
          "vendor_notes": {
            "nullable": true,
            "type": "string"
          },
          "version": {
            "description": "Send it back as `version` with the next write, exactly as it is: it stands for `content_version` (a purchase order write: delivery, lines, tax and shipping, a receipt), and every write answers the new one, so no read is needed between writes.",
            "type": "string"
          },
          "warehouse_id": {
            "description": "A store delivery to a warehouse: its `id` (`GET /warehouses`), what `warehouse_id` takes. Null: delivered to the location itself, or the warehouse was deleted.",
            "nullable": true,
            "type": "string"
          },
          "warehouse_name": {
            "nullable": true,
            "type": "string"
          }
        },
        "required": [
          "id",
          "number",
          "original_number",
          "status",
          "vendor",
          "delivery_type",
          "requested_delivery_date",
          "sent_at",
          "received_at",
          "finalized_at",
          "cost_status",
          "created_at",
          "updated_at",
          "po_id",
          "delivery_address",
          "warehouse_id",
          "warehouse_name",
          "store_location_id",
          "notes",
          "internal_notes",
          "vendor_notes",
          "receiving_notes",
          "source_order_ids",
          "lines",
          "lines_truncated"
        ],
        "type": "object"
      },
      "PurchaseOrderAttachment": {
        "properties": {
          "content_type": {
            "type": "string"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "file_name": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "size_bytes": {
            "type": "integer"
          },
          "uploaded_by": {
            "nullable": true,
            "type": "string"
          }
        },
        "required": [
          "id",
          "file_name",
          "content_type",
          "size_bytes",
          "uploaded_by",
          "created_at"
        ],
        "type": "object"
      },
      "PurchaseOrderAttachmentDeleted": {
        "properties": {
          "deleted": {
            "type": "boolean"
          },
          "id": {
            "type": "string"
          }
        },
        "required": ["id", "deleted"],
        "type": "object"
      },
      "PurchaseOrderAttachmentList": {
        "properties": {
          "items": {
            "items": {
              "properties": {
                "content_type": {
                  "type": "string"
                },
                "created_at": {
                  "format": "date-time",
                  "type": "string"
                },
                "file_name": {
                  "type": "string"
                },
                "id": {
                  "type": "string"
                },
                "size_bytes": {
                  "type": "integer"
                },
                "uploaded_by": {
                  "nullable": true,
                  "type": "string"
                }
              },
              "required": [
                "id",
                "file_name",
                "content_type",
                "size_bytes",
                "uploaded_by",
                "created_at"
              ],
              "type": "object"
            },
            "type": "array"
          }
        },
        "required": ["items"],
        "type": "object"
      },
      "PurchaseOrderAttachmentUrl": {
        "properties": {
          "filename": {
            "type": "string"
          },
          "url": {
            "description": "Works for a few minutes.",
            "type": "string"
          }
        },
        "required": ["url", "filename"],
        "type": "object"
      },
      "PurchaseOrderCancelled": {
        "properties": {
          "cancelled": {
            "type": "boolean"
          },
          "id": {
            "type": "string"
          }
        },
        "required": ["id", "cancelled"],
        "type": "object"
      },
      "PurchaseOrderChargeCreate": {
        "properties": {
          "allocation_method": {
            "description": "How it is split over the lines: by their value, their quantity or their weight, by hand (`manual`, with `manual_amounts`), or `expense`: in no item cost (its own line in QuickBooks). Any casing is accepted.",
            "enum": [
              "by_value",
              "by_quantity",
              "by_weight",
              "manual",
              "expense"
            ],
            "type": "string"
          },
          "amount": {
            "description": "As billed, in `currency`: 0 or more, at most 2 decimals.",
            "type": "number"
          },
          "attachment_url": {
            "description": "A link to the invoice.",
            "nullable": true,
            "type": "string"
          },
          "currency": {
            "description": "The billed currency, three letters. Left out: the store’s. Another needs `fx_rate`.",
            "type": "string"
          },
          "description": {
            "description": "Up to 500 characters.",
            "nullable": true,
            "type": "string"
          },
          "fx_rate": {
            "description": "The store’s currency per unit of `currency`, for a charge billed in another.",
            "nullable": true,
            "type": "number"
          },
          "is_estimated": {
            "description": "True until the vendor’s invoice confirms the amount.",
            "type": "boolean"
          },
          "manual_amounts": {
            "description": "For `manual`: each line’s amount, `{ line_id, amount }`. They must add up to the charge.",
            "items": {
              "properties": {
                "amount": {
                  "description": "Two decimals.",
                  "type": "number"
                },
                "line_id": {
                  "type": "string"
                }
              },
              "required": ["line_id", "amount"],
              "type": "object"
            },
            "type": "array"
          },
          "receipt_id": {
            "description": "For `scope: receipt`: the receipt’s id.",
            "nullable": true,
            "type": "string"
          },
          "reference": {
            "description": "The vendor’s invoice or waybill number. Up to 500 characters.",
            "nullable": true,
            "type": "string"
          },
          "reopen": {
            "description": "True: a finalized purchase order is reopened, takes the charge and is finalized again, in one transaction (nothing lands if any step is refused). Finalizing again marks every estimated charge final. Needs “Finalize and reopen purchase orders” whenever sent true. Left out or false: a finalized purchase order refuses the charge.",
            "type": "boolean"
          },
          "scope": {
            "description": "Left out: `purchase_order`. `receipt`: a charge on one posted delivery (`receipt_id`), which needs “Correct received costs”.",
            "enum": ["purchase_order", "receipt"],
            "type": "string"
          },
          "targets": {
            "description": "The lines (or options on lines) the charge is limited to. Left out or empty: every line.",
            "items": {
              "properties": {
                "line_id": {
                  "description": "A line’s `id` from the purchase order’s `lines`.",
                  "type": "string"
                },
                "option_label": {
                  "description": "Only part of the line: the option’s label (“Lining”).",
                  "nullable": true,
                  "type": "string"
                },
                "option_unit_cost": {
                  "description": "What the option costs per unit: what a split by value uses for it.",
                  "nullable": true,
                  "type": "number"
                },
                "option_value": {
                  "description": "The option’s value on this line (“Blackout lining”).",
                  "nullable": true,
                  "type": "string"
                }
              },
              "required": ["line_id"],
              "type": "object"
            },
            "nullable": true,
            "type": "array"
          },
          "type": {
            "description": "What the charge is for. Any casing is accepted.",
            "enum": [
              "inbound_shipping",
              "duty_import",
              "brokerage",
              "insurance",
              "handling",
              "tariff",
              "other"
            ],
            "type": "string"
          }
        },
        "required": ["type", "amount", "allocation_method", "is_estimated"],
        "type": "object"
      },
      "PurchaseOrderChargeDeleted": {
        "properties": {
          "charge_id": {
            "type": "string"
          },
          "charges_in_item_cost": {
            "description": "The charges split over the lines.",
            "type": "number"
          },
          "charges_total": {
            "description": "Every charge, in the store’s currency.",
            "type": "number"
          },
          "content_version": {
            "description": "Send it with `PATCH /purchase-orders/{id}/vendor-costs` (`version` holds it).",
            "type": "integer"
          },
          "cost_status": {
            "description": "`final` once every charge on what was received is confirmed.",
            "enum": ["planned", "estimated", "final", "missing"],
            "type": "string"
          },
          "cost_sync_error": {
            "nullable": true,
            "type": "string"
          },
          "cost_sync_status": {
            "description": "Publishing the received costs to Shopify’s cost per item.",
            "enum": ["not_applicable", "pending", "synced", "failed", "paused"],
            "type": "string"
          },
          "currency": {
            "description": "The store’s currency, which the totals are in.",
            "nullable": true,
            "type": "string"
          },
          "deleted": {
            "type": "boolean"
          },
          "expensed_charges": {
            "description": "The charges in no item cost.",
            "type": "number"
          },
          "finalized_at": {
            "description": "Set while the costs are closed: no charge changes until it is reopened.",
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "id": {
            "description": "The purchase order’s id.",
            "type": "string"
          },
          "items": {
            "items": {
              "properties": {
                "allocation_method": {
                  "enum": [
                    "by_value",
                    "by_quantity",
                    "by_weight",
                    "manual",
                    "expense"
                  ],
                  "type": "string"
                },
                "allocations": {
                  "description": "Each line’s planned share, in the store’s currency.",
                  "items": {
                    "properties": {
                      "amount": {
                        "description": "Two decimals.",
                        "type": "number"
                      },
                      "basis": {
                        "description": "What the share was worked out from: the value, units or weight.",
                        "nullable": true,
                        "type": "number"
                      },
                      "line_id": {
                        "type": "string"
                      }
                    },
                    "required": ["line_id", "amount", "basis"],
                    "type": "object"
                  },
                  "type": "array"
                },
                "amount": {
                  "description": "As billed, in `currency`.",
                  "type": "number"
                },
                "amount_in_shop_currency": {
                  "description": "What the split and the totals use.",
                  "type": "number"
                },
                "attachment_url": {
                  "nullable": true,
                  "type": "string"
                },
                "created_at": {
                  "format": "date-time",
                  "type": "string"
                },
                "currency": {
                  "type": "string"
                },
                "description": {
                  "nullable": true,
                  "type": "string"
                },
                "expensed": {
                  "description": "In no item cost (`allocation_method: expense`).",
                  "type": "boolean"
                },
                "fx_rate": {
                  "nullable": true,
                  "type": "number"
                },
                "id": {
                  "type": "string"
                },
                "is_estimated": {
                  "type": "boolean"
                },
                "receipt_id": {
                  "nullable": true,
                  "type": "string"
                },
                "reference": {
                  "nullable": true,
                  "type": "string"
                },
                "scope": {
                  "description": "`purchase_order`: split over its lines. `receipt`: one delivery’s (`receipt_id`). `multi_po`: one bill shared by several purchase orders.",
                  "enum": ["purchase_order", "receipt", "multi_po"],
                  "type": "string"
                },
                "targets": {
                  "description": "The lines (or options) it is limited to; empty: every line.",
                  "items": {
                    "properties": {
                      "line_id": {
                        "type": "string"
                      },
                      "option_label": {
                        "nullable": true,
                        "type": "string"
                      },
                      "option_unit_cost": {
                        "nullable": true,
                        "type": "number"
                      },
                      "option_value": {
                        "nullable": true,
                        "type": "string"
                      }
                    },
                    "required": [
                      "line_id",
                      "option_label",
                      "option_value",
                      "option_unit_cost"
                    ],
                    "type": "object"
                  },
                  "type": "array"
                },
                "type": {
                  "enum": [
                    "inbound_shipping",
                    "duty_import",
                    "brokerage",
                    "insurance",
                    "handling",
                    "tariff",
                    "other"
                  ],
                  "type": "string"
                },
                "updated_at": {
                  "format": "date-time",
                  "type": "string"
                }
              },
              "required": [
                "id",
                "type",
                "scope",
                "receipt_id",
                "description",
                "reference",
                "attachment_url",
                "amount",
                "currency",
                "fx_rate",
                "amount_in_shop_currency",
                "allocation_method",
                "expensed",
                "is_estimated",
                "targets",
                "allocations",
                "created_at",
                "updated_at"
              ],
              "type": "object"
            },
            "type": "array"
          },
          "items_truncated": {
            "description": "True past the first 500 charges.",
            "type": "boolean"
          },
          "planned_landed_total": {
            "description": "Goods, the charges in item cost, tax and shipping, as planned. Null while a line has no vendor price.",
            "nullable": true,
            "type": "number"
          },
          "quickbooks_sync_error": {
            "nullable": true,
            "type": "string"
          },
          "quickbooks_sync_status": {
            "enum": ["not_applicable", "pending", "synced", "failed"],
            "type": "string"
          },
          "shipping": {
            "description": "The vendor’s shipping.",
            "type": "number"
          },
          "subtotal": {
            "description": "The goods: the lines’ vendor cost.",
            "type": "number"
          },
          "tax": {
            "description": "Two decimals.",
            "type": "number"
          },
          "total_amount": {
            "description": "Goods, tax and shipping: what the vendor bills.",
            "type": "number"
          },
          "version": {
            "description": "Send it back as `version` with the next write, exactly as it is: it stands for `content_version` (tax and shipping, and every purchase order write), and every write answers the new one, so no read is needed between writes.",
            "type": "string"
          }
        },
        "required": [
          "charge_id",
          "deleted",
          "id",
          "content_version",
          "version",
          "currency",
          "cost_status",
          "cost_sync_status",
          "cost_sync_error",
          "quickbooks_sync_status",
          "quickbooks_sync_error",
          "finalized_at",
          "subtotal",
          "tax",
          "shipping",
          "total_amount",
          "charges_total",
          "charges_in_item_cost",
          "expensed_charges",
          "planned_landed_total",
          "items",
          "items_truncated"
        ],
        "type": "object"
      },
      "PurchaseOrderChargeEdit": {
        "description": "At least one field; the rest are kept.",
        "properties": {
          "allocation_method": {
            "description": "How it is split over the lines: by their value, their quantity or their weight, by hand (`manual`, with `manual_amounts`), or `expense`: in no item cost (its own line in QuickBooks). Any casing is accepted.",
            "enum": [
              "by_value",
              "by_quantity",
              "by_weight",
              "manual",
              "expense"
            ],
            "type": "string"
          },
          "amount": {
            "description": "As billed, in `currency`: 0 or more, at most 2 decimals.",
            "type": "number"
          },
          "attachment_url": {
            "description": "A link to the invoice.",
            "nullable": true,
            "type": "string"
          },
          "currency": {
            "description": "The billed currency, three letters. Left out: the store’s. Another needs `fx_rate`.",
            "type": "string"
          },
          "description": {
            "description": "Up to 500 characters.",
            "nullable": true,
            "type": "string"
          },
          "fx_rate": {
            "description": "The store’s currency per unit of `currency`, for a charge billed in another.",
            "nullable": true,
            "type": "number"
          },
          "is_estimated": {
            "description": "True until the vendor’s invoice confirms the amount.",
            "type": "boolean"
          },
          "manual_amounts": {
            "description": "For `manual`: each line’s amount, `{ line_id, amount }`. They must add up to the charge.",
            "items": {
              "properties": {
                "amount": {
                  "description": "Two decimals.",
                  "type": "number"
                },
                "line_id": {
                  "type": "string"
                }
              },
              "required": ["line_id", "amount"],
              "type": "object"
            },
            "type": "array"
          },
          "reference": {
            "description": "The vendor’s invoice or waybill number. Up to 500 characters.",
            "nullable": true,
            "type": "string"
          },
          "targets": {
            "description": "The lines (or options on lines) the charge is limited to. Left out or empty: every line.",
            "items": {
              "properties": {
                "line_id": {
                  "description": "A line’s `id` from the purchase order’s `lines`.",
                  "type": "string"
                },
                "option_label": {
                  "description": "Only part of the line: the option’s label (“Lining”).",
                  "nullable": true,
                  "type": "string"
                },
                "option_unit_cost": {
                  "description": "What the option costs per unit: what a split by value uses for it.",
                  "nullable": true,
                  "type": "number"
                },
                "option_value": {
                  "description": "The option’s value on this line (“Blackout lining”).",
                  "nullable": true,
                  "type": "string"
                }
              },
              "required": ["line_id"],
              "type": "object"
            },
            "nullable": true,
            "type": "array"
          },
          "type": {
            "description": "What the charge is for. Any casing is accepted.",
            "enum": [
              "inbound_shipping",
              "duty_import",
              "brokerage",
              "insurance",
              "handling",
              "tariff",
              "other"
            ],
            "type": "string"
          }
        },
        "type": "object"
      },
      "PurchaseOrderChargeEstimate": {
        "properties": {
          "is_estimated": {
            "description": "False: final. True: estimated again.",
            "type": "boolean"
          }
        },
        "required": ["is_estimated"],
        "type": "object"
      },
      "PurchaseOrderChargePreview": {
        "properties": {
          "allocatable": {
            "description": "False: the charge can’t be split this way (`refusal` says why).",
            "type": "boolean"
          },
          "id": {
            "type": "string"
          },
          "lines": {
            "items": {
              "properties": {
                "basis": {
                  "nullable": true,
                  "type": "number"
                },
                "eligible": {
                  "type": "boolean"
                },
                "line_id": {
                  "type": "string"
                },
                "posts_now": {
                  "description": "The part of the share that lands on units already received.",
                  "type": "number"
                },
                "price": {
                  "description": "The line’s unit cost.",
                  "type": "number"
                },
                "quantity": {
                  "type": "integer"
                },
                "receipt_numbers": {
                  "items": {
                    "type": "integer"
                  },
                  "type": "array"
                },
                "received_units": {
                  "type": "integer"
                },
                "share": {
                  "description": "The line’s share of the charge.",
                  "nullable": true,
                  "type": "number"
                },
                "title": {
                  "nullable": true,
                  "type": "string"
                }
              },
              "required": [
                "line_id",
                "title",
                "quantity",
                "price",
                "share",
                "basis",
                "eligible",
                "received_units",
                "posts_now",
                "receipt_numbers"
              ],
              "type": "object"
            },
            "type": "array"
          },
          "refusal": {
            "nullable": true,
            "properties": {
              "delta": {
                "description": "`manual_mismatch`: how far the amounts are from the charge.",
                "nullable": true,
                "type": "number"
              },
              "line_ids": {
                "description": "The lines to fix.",
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              "message": {
                "description": "What to fix, as the dialog says it.",
                "type": "string"
              },
              "reason": {
                "enum": [
                  "no_targets",
                  "missing_basis",
                  "zero_basis",
                  "manual_mismatch"
                ],
                "type": "string"
              }
            },
            "required": ["reason", "message", "line_ids", "delta"],
            "type": "object"
          },
          "total": {
            "description": "What the split puts on the lines.",
            "nullable": true,
            "type": "number"
          },
          "unallocated": {
            "nullable": true,
            "type": "number"
          }
        },
        "required": [
          "id",
          "allocatable",
          "total",
          "unallocated",
          "refusal",
          "lines"
        ],
        "type": "object"
      },
      "PurchaseOrderChargePreviewInput": {
        "properties": {
          "allocation_method": {
            "description": "How it is split over the lines: by their value, their quantity or their weight, by hand (`manual`, with `manual_amounts`), or `expense`: in no item cost (its own line in QuickBooks). Any casing is accepted.",
            "enum": [
              "by_value",
              "by_quantity",
              "by_weight",
              "manual",
              "expense"
            ],
            "type": "string"
          },
          "amount": {
            "description": "As billed, in `currency`: 0 or more, at most 2 decimals.",
            "type": "number"
          },
          "fx_rate": {
            "description": "The store’s currency per unit of `currency`, for a charge billed in another.",
            "nullable": true,
            "type": "number"
          },
          "manual_amounts": {
            "description": "For `manual`: each line’s amount, `{ line_id, amount }`. They must add up to the charge.",
            "items": {
              "properties": {
                "amount": {
                  "description": "Two decimals.",
                  "type": "number"
                },
                "line_id": {
                  "type": "string"
                }
              },
              "required": ["line_id", "amount"],
              "type": "object"
            },
            "type": "array"
          },
          "targets": {
            "description": "The lines (or options on lines) the charge is limited to. Left out or empty: every line.",
            "items": {
              "properties": {
                "line_id": {
                  "description": "A line’s `id` from the purchase order’s `lines`.",
                  "type": "string"
                },
                "option_label": {
                  "description": "Only part of the line: the option’s label (“Lining”).",
                  "nullable": true,
                  "type": "string"
                },
                "option_unit_cost": {
                  "description": "What the option costs per unit: what a split by value uses for it.",
                  "nullable": true,
                  "type": "number"
                },
                "option_value": {
                  "description": "The option’s value on this line (“Blackout lining”).",
                  "nullable": true,
                  "type": "string"
                }
              },
              "required": ["line_id"],
              "type": "object"
            },
            "nullable": true,
            "type": "array"
          }
        },
        "required": ["amount", "allocation_method"],
        "type": "object"
      },
      "PurchaseOrderChargeSaved": {
        "description": "The purchase order’s costs after the change. If reading them back fails: `{ id, charge_id }` (the change was made; read them again).",
        "properties": {
          "charge_id": {
            "type": "string"
          },
          "charges_in_item_cost": {
            "description": "The charges split over the lines.",
            "type": "number"
          },
          "charges_total": {
            "description": "Every charge, in the store’s currency.",
            "type": "number"
          },
          "content_version": {
            "description": "Send it with `PATCH /purchase-orders/{id}/vendor-costs` (`version` holds it).",
            "type": "integer"
          },
          "cost_status": {
            "description": "`final` once every charge on what was received is confirmed.",
            "enum": ["planned", "estimated", "final", "missing"],
            "type": "string"
          },
          "cost_sync_error": {
            "nullable": true,
            "type": "string"
          },
          "cost_sync_status": {
            "description": "Publishing the received costs to Shopify’s cost per item.",
            "enum": ["not_applicable", "pending", "synced", "failed", "paused"],
            "type": "string"
          },
          "currency": {
            "description": "The store’s currency, which the totals are in.",
            "nullable": true,
            "type": "string"
          },
          "expensed_charges": {
            "description": "The charges in no item cost.",
            "type": "number"
          },
          "finalized_at": {
            "description": "Set while the costs are closed: no charge changes until it is reopened.",
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "id": {
            "description": "The purchase order’s id.",
            "type": "string"
          },
          "items": {
            "items": {
              "properties": {
                "allocation_method": {
                  "enum": [
                    "by_value",
                    "by_quantity",
                    "by_weight",
                    "manual",
                    "expense"
                  ],
                  "type": "string"
                },
                "allocations": {
                  "description": "Each line’s planned share, in the store’s currency.",
                  "items": {
                    "properties": {
                      "amount": {
                        "description": "Two decimals.",
                        "type": "number"
                      },
                      "basis": {
                        "description": "What the share was worked out from: the value, units or weight.",
                        "nullable": true,
                        "type": "number"
                      },
                      "line_id": {
                        "type": "string"
                      }
                    },
                    "required": ["line_id", "amount", "basis"],
                    "type": "object"
                  },
                  "type": "array"
                },
                "amount": {
                  "description": "As billed, in `currency`.",
                  "type": "number"
                },
                "amount_in_shop_currency": {
                  "description": "What the split and the totals use.",
                  "type": "number"
                },
                "attachment_url": {
                  "nullable": true,
                  "type": "string"
                },
                "created_at": {
                  "format": "date-time",
                  "type": "string"
                },
                "currency": {
                  "type": "string"
                },
                "description": {
                  "nullable": true,
                  "type": "string"
                },
                "expensed": {
                  "description": "In no item cost (`allocation_method: expense`).",
                  "type": "boolean"
                },
                "fx_rate": {
                  "nullable": true,
                  "type": "number"
                },
                "id": {
                  "type": "string"
                },
                "is_estimated": {
                  "type": "boolean"
                },
                "receipt_id": {
                  "nullable": true,
                  "type": "string"
                },
                "reference": {
                  "nullable": true,
                  "type": "string"
                },
                "scope": {
                  "description": "`purchase_order`: split over its lines. `receipt`: one delivery’s (`receipt_id`). `multi_po`: one bill shared by several purchase orders.",
                  "enum": ["purchase_order", "receipt", "multi_po"],
                  "type": "string"
                },
                "targets": {
                  "description": "The lines (or options) it is limited to; empty: every line.",
                  "items": {
                    "properties": {
                      "line_id": {
                        "type": "string"
                      },
                      "option_label": {
                        "nullable": true,
                        "type": "string"
                      },
                      "option_unit_cost": {
                        "nullable": true,
                        "type": "number"
                      },
                      "option_value": {
                        "nullable": true,
                        "type": "string"
                      }
                    },
                    "required": [
                      "line_id",
                      "option_label",
                      "option_value",
                      "option_unit_cost"
                    ],
                    "type": "object"
                  },
                  "type": "array"
                },
                "type": {
                  "enum": [
                    "inbound_shipping",
                    "duty_import",
                    "brokerage",
                    "insurance",
                    "handling",
                    "tariff",
                    "other"
                  ],
                  "type": "string"
                },
                "updated_at": {
                  "format": "date-time",
                  "type": "string"
                }
              },
              "required": [
                "id",
                "type",
                "scope",
                "receipt_id",
                "description",
                "reference",
                "attachment_url",
                "amount",
                "currency",
                "fx_rate",
                "amount_in_shop_currency",
                "allocation_method",
                "expensed",
                "is_estimated",
                "targets",
                "allocations",
                "created_at",
                "updated_at"
              ],
              "type": "object"
            },
            "type": "array"
          },
          "items_truncated": {
            "description": "True past the first 500 charges.",
            "type": "boolean"
          },
          "planned_landed_total": {
            "description": "Goods, the charges in item cost, tax and shipping, as planned. Null while a line has no vendor price.",
            "nullable": true,
            "type": "number"
          },
          "quickbooks_sync_error": {
            "nullable": true,
            "type": "string"
          },
          "quickbooks_sync_status": {
            "enum": ["not_applicable", "pending", "synced", "failed"],
            "type": "string"
          },
          "reopened": {
            "description": "Sent with `reopen: true` only: the purchase order was finalized, so it was reopened and finalized again with the charge.",
            "type": "boolean"
          },
          "shipping": {
            "description": "The vendor’s shipping.",
            "type": "number"
          },
          "subtotal": {
            "description": "The goods: the lines’ vendor cost.",
            "type": "number"
          },
          "tax": {
            "description": "Two decimals.",
            "type": "number"
          },
          "total_amount": {
            "description": "Goods, tax and shipping: what the vendor bills.",
            "type": "number"
          },
          "version": {
            "description": "Send it back as `version` with the next write, exactly as it is: it stands for `content_version` (tax and shipping, and every purchase order write), and every write answers the new one, so no read is needed between writes.",
            "type": "string"
          }
        },
        "required": [
          "charge_id",
          "id",
          "content_version",
          "version",
          "currency",
          "cost_status",
          "cost_sync_status",
          "cost_sync_error",
          "quickbooks_sync_status",
          "quickbooks_sync_error",
          "finalized_at",
          "subtotal",
          "tax",
          "shipping",
          "total_amount",
          "charges_total",
          "charges_in_item_cost",
          "expensed_charges",
          "planned_landed_total",
          "items",
          "items_truncated"
        ],
        "type": "object"
      },
      "PurchaseOrderCostAdjustment": {
        "properties": {
          "amount": {
            "description": "Only with “View costs”. Two decimals.",
            "type": "number"
          },
          "costs_hidden": {
            "description": "Present, with a `reason`, when money was left out.",
            "properties": {
              "reason": {
                "type": "string"
              }
            },
            "required": ["reason"],
            "type": "object"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "description": {
            "nullable": true,
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "kind": {
            "enum": [
              "late_charge",
              "correct_unit_cost",
              "vendor_credit",
              "reversal",
              "quantity_correction"
            ],
            "type": "string"
          },
          "marks_cost_final": {
            "type": "boolean"
          },
          "new_landed_unit_cost": {
            "description": "Only with “View costs”. Null when nobody has said what it costs.",
            "nullable": true,
            "type": "number"
          },
          "new_receipt_total": {
            "description": "Only with “View costs”. Null when nobody has said what it costs.",
            "nullable": true,
            "type": "number"
          },
          "previous_landed_unit_cost": {
            "description": "Only with “View costs”. Null when nobody has said what it costs.",
            "nullable": true,
            "type": "number"
          },
          "previous_receipt_total": {
            "description": "Only with “View costs”. Null when nobody has said what it costs.",
            "nullable": true,
            "type": "number"
          },
          "reason": {
            "type": "string"
          },
          "receipt_id": {
            "type": "string"
          },
          "receipt_line_id": {
            "nullable": true,
            "type": "string"
          }
        },
        "required": [
          "id",
          "receipt_id",
          "receipt_line_id",
          "kind",
          "reason",
          "description",
          "marks_cost_final",
          "created_at"
        ],
        "type": "object"
      },
      "PurchaseOrderCostAdjustmentCreate": {
        "properties": {
          "amount": {
            "description": "What it adds to the received cost of those units, in all (two decimals); below zero lowers it (a vendor credit). Spread over the received units by count. It can’t take a cost below zero.",
            "type": "number"
          },
          "description": {
            "nullable": true,
            "type": "string"
          },
          "kind": {
            "description": "Any casing is accepted.",
            "enum": [
              "late_charge",
              "correct_unit_cost",
              "vendor_credit",
              "reversal"
            ],
            "type": "string"
          },
          "marks_cost_final": {
            "description": "Declare those lines’ costs final after this change.",
            "type": "boolean"
          },
          "reason": {
            "description": "Why the received cost changes. Required.",
            "type": "string"
          },
          "receipt_line_id": {
            "description": "One line of the receipt; left out, every line of it.",
            "nullable": true,
            "type": "string"
          }
        },
        "required": ["kind", "amount", "reason"],
        "type": "object"
      },
      "PurchaseOrderCostSync": {
        "properties": {
          "cost_sync_status": {
            "description": "`pending` until the worker publishes the costs.",
            "enum": ["not_applicable", "pending", "synced", "failed", "paused"],
            "type": "string"
          },
          "id": {
            "type": "string"
          }
        },
        "required": ["id", "cost_sync_status"],
        "type": "object"
      },
      "PurchaseOrderCosts": {
        "properties": {
          "charges_in_item_cost": {
            "description": "The charges split over the lines.",
            "type": "number"
          },
          "charges_total": {
            "description": "Every charge, in the store’s currency.",
            "type": "number"
          },
          "content_version": {
            "description": "Send it with `PATCH /purchase-orders/{id}/vendor-costs` (`version` holds it).",
            "type": "integer"
          },
          "cost_status": {
            "description": "`final` once every charge on what was received is confirmed.",
            "enum": ["planned", "estimated", "final", "missing"],
            "type": "string"
          },
          "cost_sync_error": {
            "nullable": true,
            "type": "string"
          },
          "cost_sync_status": {
            "description": "Publishing the received costs to Shopify’s cost per item.",
            "enum": ["not_applicable", "pending", "synced", "failed", "paused"],
            "type": "string"
          },
          "currency": {
            "description": "The store’s currency, which the totals are in.",
            "nullable": true,
            "type": "string"
          },
          "expensed_charges": {
            "description": "The charges in no item cost.",
            "type": "number"
          },
          "finalized_at": {
            "description": "Set while the costs are closed: no charge changes until it is reopened.",
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "id": {
            "description": "The purchase order’s id.",
            "type": "string"
          },
          "items": {
            "items": {
              "properties": {
                "allocation_method": {
                  "enum": [
                    "by_value",
                    "by_quantity",
                    "by_weight",
                    "manual",
                    "expense"
                  ],
                  "type": "string"
                },
                "allocations": {
                  "description": "Each line’s planned share, in the store’s currency.",
                  "items": {
                    "properties": {
                      "amount": {
                        "description": "Two decimals.",
                        "type": "number"
                      },
                      "basis": {
                        "description": "What the share was worked out from: the value, units or weight.",
                        "nullable": true,
                        "type": "number"
                      },
                      "line_id": {
                        "type": "string"
                      }
                    },
                    "required": ["line_id", "amount", "basis"],
                    "type": "object"
                  },
                  "type": "array"
                },
                "amount": {
                  "description": "As billed, in `currency`.",
                  "type": "number"
                },
                "amount_in_shop_currency": {
                  "description": "What the split and the totals use.",
                  "type": "number"
                },
                "attachment_url": {
                  "nullable": true,
                  "type": "string"
                },
                "created_at": {
                  "format": "date-time",
                  "type": "string"
                },
                "currency": {
                  "type": "string"
                },
                "description": {
                  "nullable": true,
                  "type": "string"
                },
                "expensed": {
                  "description": "In no item cost (`allocation_method: expense`).",
                  "type": "boolean"
                },
                "fx_rate": {
                  "nullable": true,
                  "type": "number"
                },
                "id": {
                  "type": "string"
                },
                "is_estimated": {
                  "type": "boolean"
                },
                "receipt_id": {
                  "nullable": true,
                  "type": "string"
                },
                "reference": {
                  "nullable": true,
                  "type": "string"
                },
                "scope": {
                  "description": "`purchase_order`: split over its lines. `receipt`: one delivery’s (`receipt_id`). `multi_po`: one bill shared by several purchase orders.",
                  "enum": ["purchase_order", "receipt", "multi_po"],
                  "type": "string"
                },
                "targets": {
                  "description": "The lines (or options) it is limited to; empty: every line.",
                  "items": {
                    "properties": {
                      "line_id": {
                        "type": "string"
                      },
                      "option_label": {
                        "nullable": true,
                        "type": "string"
                      },
                      "option_unit_cost": {
                        "nullable": true,
                        "type": "number"
                      },
                      "option_value": {
                        "nullable": true,
                        "type": "string"
                      }
                    },
                    "required": [
                      "line_id",
                      "option_label",
                      "option_value",
                      "option_unit_cost"
                    ],
                    "type": "object"
                  },
                  "type": "array"
                },
                "type": {
                  "enum": [
                    "inbound_shipping",
                    "duty_import",
                    "brokerage",
                    "insurance",
                    "handling",
                    "tariff",
                    "other"
                  ],
                  "type": "string"
                },
                "updated_at": {
                  "format": "date-time",
                  "type": "string"
                }
              },
              "required": [
                "id",
                "type",
                "scope",
                "receipt_id",
                "description",
                "reference",
                "attachment_url",
                "amount",
                "currency",
                "fx_rate",
                "amount_in_shop_currency",
                "allocation_method",
                "expensed",
                "is_estimated",
                "targets",
                "allocations",
                "created_at",
                "updated_at"
              ],
              "type": "object"
            },
            "type": "array"
          },
          "items_truncated": {
            "description": "True past the first 500 charges.",
            "type": "boolean"
          },
          "planned_landed_total": {
            "description": "Goods, the charges in item cost, tax and shipping, as planned. Null while a line has no vendor price.",
            "nullable": true,
            "type": "number"
          },
          "quickbooks_sync_error": {
            "nullable": true,
            "type": "string"
          },
          "quickbooks_sync_status": {
            "enum": ["not_applicable", "pending", "synced", "failed"],
            "type": "string"
          },
          "shipping": {
            "description": "The vendor’s shipping.",
            "type": "number"
          },
          "subtotal": {
            "description": "The goods: the lines’ vendor cost.",
            "type": "number"
          },
          "tax": {
            "description": "Two decimals.",
            "type": "number"
          },
          "total_amount": {
            "description": "Goods, tax and shipping: what the vendor bills.",
            "type": "number"
          },
          "version": {
            "description": "Send it back as `version` with the next write, exactly as it is: it stands for `content_version` (tax and shipping, and every purchase order write), and every write answers the new one, so no read is needed between writes.",
            "type": "string"
          }
        },
        "required": [
          "id",
          "content_version",
          "version",
          "currency",
          "cost_status",
          "cost_sync_status",
          "cost_sync_error",
          "quickbooks_sync_status",
          "quickbooks_sync_error",
          "finalized_at",
          "subtotal",
          "tax",
          "shipping",
          "total_amount",
          "charges_total",
          "charges_in_item_cost",
          "expensed_charges",
          "planned_landed_total",
          "items",
          "items_truncated"
        ],
        "type": "object"
      },
      "PurchaseOrderCreate": {
        "description": "One draft purchase order for one vendor, linked to the order lines it buys or bought for stock. Sending it (and emailing the vendor) is `POST /purchase-orders/{id}/send`.",
        "properties": {
          "delivery_address": {
            "description": "Where it is delivered, as printed on the purchase order: to a location, its `address` from `GET /locations`; to a warehouse, its `address` from `GET /warehouses`; to the customer, their address. Left out on a store delivery: the warehouse’s address (`warehouse_id`), else the location’s (`store_location_id`). Required for a customer or dropship delivery.",
            "type": "string"
          },
          "delivery_type": {
            "description": "Left out: `store`.",
            "enum": ["store", "customer", "dropship"],
            "type": "string"
          },
          "hide_pricing": {
            "description": "Leave prices off the copy the vendor gets.",
            "type": "boolean"
          },
          "internal_notes": {
            "type": "string"
          },
          "lines": {
            "description": "At most 300 lines, each a thing to buy (`kind`) and a quantity; an order line no more than it still needs.",
            "items": {
              "description": "One line, by `kind`: `order_line` (the default) buys an order line (`source_line_item_id`, `component_key` for one of its options); `stock` buys a product the store sells in Shopify, found by its exact `sku` (`variant_id` picks one when several have it) or, for a product with no SKU, by its `variant_id` alone; `new_product` buys a product made in Shopify when the purchase order is created (`title`, `sku`, `category_id` or `category_slug`, `retail_price`, `save_as_template`); `template` buys a configuration of a product template (`template_id`, `selections`). A purchase order is raised for order lines or for stock, not both. New product and template lines need Manage catalog (a key: Change the catalog), a retail price Edit catalog prices too. A new product’s `sku` must be one no product has: a SKU a Shopify product has already, or a new product on another purchase order still waiting for its product, is `409 SKU_EXISTS` (`error.products`, or `error.purchase_order_id`): buy that product with a `stock` line instead. A new product’s name, SKU, category and retail price can’t be changed once the purchase order exists, in the admin either: send them all now.",
              "properties": {
                "category_id": {
                  "description": "`new_product`: the category’s `id`, from `GET /categories` or `POST /categories`; its name becomes the Shopify product’s type. Send this or `category_slug`, not both. Left out, the product has no type, and the line can’t be given one later.",
                  "type": "string"
                },
                "category_slug": {
                  "description": "`new_product`: the category’s `slug`, from `GET /categories`.",
                  "type": "string"
                },
                "component_key": {
                  "description": "`order_line`: an option’s key from the line’s PO components; left out for the product itself.",
                  "type": "string"
                },
                "item_label": {
                  "description": "The line’s Item notes, as the workbench and the edit page take them, shown with the line on the purchase order’s page. Up to 500 characters.",
                  "type": "string"
                },
                "kind": {
                  "description": "Any casing. Default `order_line`.",
                  "enum": ["order_line", "stock", "new_product", "template"],
                  "type": "string"
                },
                "price": {
                  "description": "Unit cost, at most 2 decimals. Needs “Enter costs and charges”; otherwise an order line takes its own cost and any other line 0.",
                  "type": "number"
                },
                "quantity": {
                  "description": "Units to buy, a whole number above 0.",
                  "type": "integer"
                },
                "retail_price": {
                  "description": "`new_product`: its selling price. Needs Edit catalog prices. Left out, the product is made at 0 and the line can’t change it later: set it in Shopify, or send a `products` import draft (`POST /imports`) for the merchant to sign off.",
                  "type": "number"
                },
                "save_as_template": {
                  "description": "`new_product`: also make a product template of it, to quote it again.",
                  "type": "boolean"
                },
                "selections": {
                  "description": "`template`: the options chosen, each by its `field_id` from the template’s `options` in `GET /product-templates/{id}`.",
                  "items": {
                    "properties": {
                      "definition_id": {
                        "description": "The same id as `field_id`, by its first name. Send one of them.",
                        "type": "string"
                      },
                      "field_id": {
                        "description": "The option: its `field_id` from `GET /product-templates/{id}`. Send this or `definition_id`.",
                        "type": "string"
                      },
                      "option_id": {
                        "description": "A dropdown’s value: its `option_id` from the option’s `values`.",
                        "type": "string"
                      },
                      "value": {
                        "description": "A number or text option’s value.",
                        "type": "string"
                      }
                    },
                    "type": "object"
                  },
                  "type": "array"
                },
                "sku": {
                  "description": "`stock`: the SKU of the Shopify variant (exact, any case); send this, `variant_id`, or both. `new_product`, `template`: the new item’s SKU. A `new_product` SKU that a Shopify product has already is `409 SKU_EXISTS`: send a `stock` line with it.",
                  "type": "string"
                },
                "source_line_item_id": {
                  "description": "`order_line`: the order line’s id.",
                  "type": "string"
                },
                "template_id": {
                  "description": "`template`: an active product template.",
                  "type": "string"
                },
                "title": {
                  "description": "`new_product`: the product’s name in Shopify.",
                  "type": "string"
                },
                "variant_id": {
                  "description": "`stock`: the Shopify variant (an id or gid, from `GET /products/{id}`): alone for a product with no SKU, or with `sku` to pick one when several have it.",
                  "type": "string"
                }
              },
              "required": ["quantity"],
              "type": "object"
            },
            "type": "array"
          },
          "notes": {
            "type": "string"
          },
          "requested_delivery_date": {
            "format": "date-time",
            "type": "string"
          },
          "shipping": {
            "description": "Needs “Enter costs and charges”; otherwise 0.",
            "type": "number"
          },
          "side_label": {
            "type": "string"
          },
          "store_location_id": {
            "description": "The Shopify location that receives the stock: an `id` from `GET /locations` (one of the caller’s). Required for a stock purchase order (and to take a store delivery’s address from it), unless the caller can use only one location: then that one.",
            "type": "string"
          },
          "tax": {
            "description": "Needs “Enter costs and charges”; otherwise 0.",
            "type": "number"
          },
          "vendor": {
            "description": "The vendor by its name (its `display_name` in `GET /vendors`; case and spacing don’t matter), instead of `vendor_id`. A name two vendors answer to is refused, naming both (`error.matches`); none is `404`.",
            "type": "string"
          },
          "vendor_id": {
            "description": "Every line’s vendor must be this one: an `id` from `GET /vendors`. Send this or `vendor`.",
            "type": "string"
          },
          "vendor_notes": {
            "type": "string"
          },
          "warehouse_id": {
            "description": "A store delivery to a warehouse: an `id` from `GET /warehouses`. Left out: delivered to the location itself.",
            "type": "string"
          }
        },
        "required": ["lines"],
        "type": "object"
      },
      "PurchaseOrderCreated": {
        "properties": {
          "content_version": {
            "description": "The purchase order’s version now: send it with the next delivery or lines edit (`PATCH /purchase-orders/{id}`, `PATCH /purchase-orders/{id}/lines`). `version` holds it.",
            "type": "integer"
          },
          "costs_hidden": {
            "description": "Present, with a `reason`, when money was left out.",
            "properties": {
              "reason": {
                "type": "string"
              }
            },
            "required": ["reason"],
            "type": "object"
          },
          "delivery_address": {
            "description": "As saved: what was sent, or filled in.",
            "type": "string"
          },
          "delivery_type": {
            "description": "As saved: what was sent, or filled in.",
            "enum": ["store", "customer", "dropship"],
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "lines": {
            "items": {
              "properties": {
                "component_key": {
                  "nullable": true,
                  "type": "string"
                },
                "id": {
                  "type": "string"
                },
                "kind": {
                  "enum": ["order_line", "stock", "new_product", "template"],
                  "type": "string"
                },
                "new_product": {
                  "description": "A `new_product` line only: its Shopify product. `creating` while it is being made (seconds), `failed` with the `reason` (`POST /purchase-orders/{id}/new-products/retry` tries again), `not_queued` when it waits for that retry, `made` with the product’s and variant’s ids. `GET /purchase-orders/{id}/new-products` lists only the lines not made yet.",
                  "properties": {
                    "product_id": {
                      "description": "The Shopify product, once made.",
                      "nullable": true,
                      "type": "string"
                    },
                    "reason": {
                      "nullable": true,
                      "type": "string"
                    },
                    "status": {
                      "enum": ["creating", "failed", "not_queued", "made"],
                      "type": "string"
                    },
                    "variant_id": {
                      "description": "Its variant, once made.",
                      "nullable": true,
                      "type": "string"
                    }
                  },
                  "required": ["status", "reason", "product_id", "variant_id"],
                  "type": "object"
                },
                "price": {
                  "description": "Only with “View costs”.",
                  "type": "number"
                },
                "quantity": {
                  "type": "integer"
                },
                "source_line_item_id": {
                  "nullable": true,
                  "type": "string"
                },
                "title": {
                  "nullable": true,
                  "type": "string"
                },
                "total_cost": {
                  "description": "Only with “View costs”.",
                  "type": "number"
                }
              },
              "required": [
                "id",
                "kind",
                "source_line_item_id",
                "component_key",
                "title",
                "quantity"
              ],
              "type": "object"
            },
            "type": "array"
          },
          "number": {
            "description": "The PO number as printed.",
            "type": "string"
          },
          "shipping": {
            "description": "Only with “View costs”.",
            "type": "number"
          },
          "status": {
            "enum": ["draft"],
            "type": "string"
          },
          "store_location_id": {
            "description": "As saved: what was sent, or the caller’s only location.",
            "nullable": true,
            "type": "string"
          },
          "subtotal": {
            "description": "Only with “View costs”.",
            "type": "number"
          },
          "tax": {
            "description": "Only with “View costs”.",
            "type": "number"
          },
          "total_amount": {
            "description": "Only with “View costs”.",
            "type": "number"
          },
          "vendor_id": {
            "type": "string"
          },
          "version": {
            "description": "Send it back as `version` with the next write, exactly as it is: it stands for `content_version`, and every write answers the new one, so no read is needed between writes.",
            "type": "string"
          },
          "warehouse_id": {
            "nullable": true,
            "type": "string"
          }
        },
        "required": ["id", "number", "status", "vendor_id", "lines"],
        "type": "object"
      },
      "PurchaseOrderDelivery": {
        "properties": {
          "content_version": {
            "type": "integer"
          },
          "id": {
            "type": "string"
          },
          "version": {
            "description": "Send it back as `version` with the next write, exactly as it is: it stands for `content_version`, and every write answers the new one, so no read is needed between writes.",
            "type": "string"
          }
        },
        "required": ["id", "content_version"],
        "type": "object"
      },
      "PurchaseOrderDeliveryEdit": {
        "description": "Only the delivery fields; anything else is refused.",
        "properties": {
          "content_version": {
            "description": "The `content_version` an earlier answer gave, when you don’t send `version`; if the purchase order has changed since, the save is refused (409).",
            "type": "integer"
          },
          "delivery_address": {
            "description": "Where it is delivered, as printed: a location’s `address` from `GET /locations` or a warehouse’s from `GET /warehouses`.",
            "type": "string"
          },
          "delivery_type": {
            "description": "Customer and dropship can only be kept, not newly chosen here. Any casing is accepted.",
            "enum": ["store", "customer", "dropship"],
            "type": "string"
          },
          "store_location_id": {
            "description": "Where received stock counts: a Shopify location id (an `id` from `GET /locations`); null keeps the purchase order’s own.",
            "nullable": true,
            "type": "string"
          },
          "version": {
            "description": "The `version` of the last answer about this record (its read, its list row, its costs or the last change), sent back exactly as it is: no read needed first. A change made since is refused (409) with the current `version` and what `changed`. Send this or `content_version`.",
            "type": "string"
          },
          "warehouse_id": {
            "description": "A store delivery to this warehouse (an `id` from `GET /warehouses`); null delivers to the location itself.",
            "nullable": true,
            "type": "string"
          }
        },
        "required": ["delivery_type", "delivery_address"],
        "type": "object"
      },
      "PurchaseOrderEmailCompose": {
        "description": "Every field is optional: an empty body previews the store’s vendor template.",
        "properties": {
          "message": {
            "description": "Left out: the template’s.",
            "type": "string"
          },
          "subject": {
            "description": "Left out: the template’s. Up to 500 characters.",
            "type": "string"
          },
          "template_key": {
            "description": "A vendor email template’s `key`, as `GET /email-templates` lists them with `audience=vendor`. Left out: the store’s purchase order template.",
            "type": "string"
          }
        },
        "type": "object"
      },
      "PurchaseOrderEmailPreview": {
        "properties": {
          "html": {
            "description": "The email’s HTML, as the vendor receives it.",
            "type": "string"
          },
          "subject": {
            "type": "string"
          },
          "text": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "PurchaseOrderFinalized": {
        "properties": {
          "changed": {
            "description": "False when it was already so.",
            "type": "boolean"
          },
          "finalized": {
            "description": "True once finalized; false after a reopen.",
            "type": "boolean"
          },
          "id": {
            "type": "string"
          },
          "version": {
            "description": "Send it back as `version` with the next write, exactly as it is: it stands for the purchase order’s `content_version`, and every write answers the new one, so no read is needed between writes.",
            "type": "string"
          }
        },
        "required": ["id", "finalized", "changed"],
        "type": "object"
      },
      "PurchaseOrderFreedUnitList": {
        "properties": {
          "items": {
            "description": "Oldest first.",
            "items": {
              "properties": {
                "created_at": {
                  "format": "date-time",
                  "type": "string"
                },
                "id": {
                  "description": "`freed_unit_id` in the decision.",
                  "type": "string"
                },
                "line_id": {
                  "description": "The purchase order line they arrived on.",
                  "type": "string"
                },
                "order_name": {
                  "description": "The cancelled order, as `#1042`.",
                  "nullable": true,
                  "type": "string"
                },
                "quantity": {
                  "description": "Units waiting for the decision.",
                  "type": "integer"
                },
                "title": {
                  "type": "string"
                }
              },
              "required": [
                "id",
                "line_id",
                "title",
                "quantity",
                "order_name",
                "created_at"
              ],
              "type": "object"
            },
            "type": "array"
          }
        },
        "required": ["items"],
        "type": "object"
      },
      "PurchaseOrderFreedUnitsDecided": {
        "properties": {
          "decided_at": {
            "format": "date-time",
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "outcome": {
            "enum": ["add_to_stock", "write_off"],
            "type": "string"
          },
          "stock_queued": {
            "description": "True when the units were queued to be added to stock in Shopify.",
            "type": "boolean"
          }
        },
        "required": ["id", "outcome", "decided_at", "stock_queued"],
        "type": "object"
      },
      "PurchaseOrderFreedUnitsDecision": {
        "properties": {
          "freed_unit_id": {
            "description": "An `id` from `GET /purchase-orders/{id}/freed-units`.",
            "type": "string"
          },
          "outcome": {
            "description": "Any casing is accepted.",
            "enum": ["add_to_stock", "write_off"],
            "type": "string"
          }
        },
        "required": ["freed_unit_id", "outcome"],
        "type": "object"
      },
      "PurchaseOrderLinesChanged": {
        "properties": {
          "content_version": {
            "type": "integer"
          },
          "costs_hidden": {
            "description": "Present, with a `reason`, when money was left out.",
            "properties": {
              "reason": {
                "type": "string"
              }
            },
            "required": ["reason"],
            "type": "object"
          },
          "id": {
            "type": "string"
          },
          "lines": {
            "items": {
              "properties": {
                "component_key": {
                  "nullable": true,
                  "type": "string"
                },
                "id": {
                  "type": "string"
                },
                "item_label": {
                  "description": "The line’s Item notes.",
                  "nullable": true,
                  "type": "string"
                },
                "kind": {
                  "enum": ["order_line", "stock", "new_product", "template"],
                  "type": "string"
                },
                "new_product": {
                  "description": "A `new_product` line only: its Shopify product. `creating` while it is being made (seconds), `failed` with the `reason` (`POST /purchase-orders/{id}/new-products/retry` tries again), `not_queued` when it waits for that retry, `made` with the product’s and variant’s ids. `GET /purchase-orders/{id}/new-products` lists only the lines not made yet.",
                  "properties": {
                    "product_id": {
                      "description": "The Shopify product, once made.",
                      "nullable": true,
                      "type": "string"
                    },
                    "reason": {
                      "nullable": true,
                      "type": "string"
                    },
                    "status": {
                      "enum": ["creating", "failed", "not_queued", "made"],
                      "type": "string"
                    },
                    "variant_id": {
                      "description": "Its variant, once made.",
                      "nullable": true,
                      "type": "string"
                    }
                  },
                  "required": ["status", "reason", "product_id", "variant_id"],
                  "type": "object"
                },
                "price": {
                  "description": "Only with “View costs”.",
                  "type": "number"
                },
                "quantity": {
                  "type": "integer"
                },
                "sku": {
                  "nullable": true,
                  "type": "string"
                },
                "source_line_item_id": {
                  "nullable": true,
                  "type": "string"
                },
                "title": {
                  "nullable": true,
                  "type": "string"
                },
                "total_cost": {
                  "description": "Only with “View costs”.",
                  "type": "number"
                }
              },
              "required": [
                "id",
                "kind",
                "source_line_item_id",
                "component_key",
                "title",
                "sku",
                "quantity"
              ],
              "type": "object"
            },
            "type": "array"
          },
          "shipping": {
            "description": "Only with “View costs”.",
            "type": "number"
          },
          "subtotal": {
            "description": "Only with “View costs”.",
            "type": "number"
          },
          "tax": {
            "description": "Only with “View costs”.",
            "type": "number"
          },
          "total_amount": {
            "description": "Only with “View costs”.",
            "type": "number"
          },
          "version": {
            "description": "Send it back as `version` with the next write, exactly as it is: it stands for `content_version`, and every write answers the new one, so no read is needed between writes.",
            "type": "string"
          }
        },
        "required": ["id", "content_version", "lines"],
        "type": "object"
      },
      "PurchaseOrderLinesEdit": {
        "description": "At least one of `lines`, `remove_lines` and `add_lines`.",
        "properties": {
          "add_lines": {
            "description": "Order lines and stock lines to add (`kind` `order_line` or `stock`).",
            "items": {
              "description": "One line, by `kind`: `order_line` (the default) buys an order line (`source_line_item_id`, `component_key` for one of its options); `stock` buys a product the store sells in Shopify, found by its exact `sku` (`variant_id` picks one when several have it) or, for a product with no SKU, by its `variant_id` alone; `new_product` buys a product made in Shopify when the purchase order is created (`title`, `sku`, `category_id` or `category_slug`, `retail_price`, `save_as_template`); `template` buys a configuration of a product template (`template_id`, `selections`). A purchase order is raised for order lines or for stock, not both. New product and template lines need Manage catalog (a key: Change the catalog), a retail price Edit catalog prices too. A new product’s `sku` must be one no product has: a SKU a Shopify product has already, or a new product on another purchase order still waiting for its product, is `409 SKU_EXISTS` (`error.products`, or `error.purchase_order_id`): buy that product with a `stock` line instead. A new product’s name, SKU, category and retail price can’t be changed once the purchase order exists, in the admin either: send them all now.",
              "properties": {
                "category_id": {
                  "description": "`new_product`: the category’s `id`, from `GET /categories` or `POST /categories`; its name becomes the Shopify product’s type. Send this or `category_slug`, not both. Left out, the product has no type, and the line can’t be given one later.",
                  "type": "string"
                },
                "category_slug": {
                  "description": "`new_product`: the category’s `slug`, from `GET /categories`.",
                  "type": "string"
                },
                "component_key": {
                  "description": "`order_line`: an option’s key from the line’s PO components; left out for the product itself.",
                  "type": "string"
                },
                "item_label": {
                  "description": "The line’s Item notes, as the workbench and the edit page take them, shown with the line on the purchase order’s page. Up to 500 characters.",
                  "type": "string"
                },
                "kind": {
                  "description": "Any casing. Default `order_line`.",
                  "enum": ["order_line", "stock", "new_product", "template"],
                  "type": "string"
                },
                "price": {
                  "description": "Unit cost, at most 2 decimals. Needs “Enter costs and charges”; otherwise an order line takes its own cost and any other line 0.",
                  "type": "number"
                },
                "quantity": {
                  "description": "Units to buy, a whole number above 0.",
                  "type": "integer"
                },
                "retail_price": {
                  "description": "`new_product`: its selling price. Needs Edit catalog prices. Left out, the product is made at 0 and the line can’t change it later: set it in Shopify, or send a `products` import draft (`POST /imports`) for the merchant to sign off.",
                  "type": "number"
                },
                "save_as_template": {
                  "description": "`new_product`: also make a product template of it, to quote it again.",
                  "type": "boolean"
                },
                "selections": {
                  "description": "`template`: the options chosen, each by its `field_id` from the template’s `options` in `GET /product-templates/{id}`.",
                  "items": {
                    "properties": {
                      "definition_id": {
                        "description": "The same id as `field_id`, by its first name. Send one of them.",
                        "type": "string"
                      },
                      "field_id": {
                        "description": "The option: its `field_id` from `GET /product-templates/{id}`. Send this or `definition_id`.",
                        "type": "string"
                      },
                      "option_id": {
                        "description": "A dropdown’s value: its `option_id` from the option’s `values`.",
                        "type": "string"
                      },
                      "value": {
                        "description": "A number or text option’s value.",
                        "type": "string"
                      }
                    },
                    "type": "object"
                  },
                  "type": "array"
                },
                "sku": {
                  "description": "`stock`: the SKU of the Shopify variant (exact, any case); send this, `variant_id`, or both. `new_product`, `template`: the new item’s SKU. A `new_product` SKU that a Shopify product has already is `409 SKU_EXISTS`: send a `stock` line with it.",
                  "type": "string"
                },
                "source_line_item_id": {
                  "description": "`order_line`: the order line’s id.",
                  "type": "string"
                },
                "template_id": {
                  "description": "`template`: an active product template.",
                  "type": "string"
                },
                "title": {
                  "description": "`new_product`: the product’s name in Shopify.",
                  "type": "string"
                },
                "variant_id": {
                  "description": "`stock`: the Shopify variant (an id or gid, from `GET /products/{id}`): alone for a product with no SKU, or with `sku` to pick one when several have it.",
                  "type": "string"
                }
              },
              "required": ["quantity"],
              "type": "object"
            },
            "type": "array"
          },
          "content_version": {
            "description": "The `content_version` the purchase order was read with, when you don’t send `version`.",
            "type": "integer"
          },
          "lines": {
            "description": "Lines that change: `{ id, quantity, price?, item_label? }`, the `id` from its `lines`. `price` (the unit cost, at most 2 decimals) needs “Enter costs and charges” (a key: Enter and correct costs) and is ignored without it. A New product line’s name, SKU, category and retail price aren’t changed here, nor on the admin’s edit page.",
            "items": {
              "properties": {
                "id": {
                  "type": "string"
                },
                "item_label": {
                  "description": "The line’s new Item notes, up to 500 characters; empty or null clears them. Left out: kept.",
                  "nullable": true,
                  "type": "string"
                },
                "price": {
                  "description": "The line’s new unit cost.",
                  "type": "number"
                },
                "quantity": {
                  "type": "integer"
                }
              },
              "required": ["id", "quantity"],
              "type": "object"
            },
            "type": "array"
          },
          "remove_lines": {
            "description": "Line ids to take off.",
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "version": {
            "description": "The `version` of the last answer about this record (its read, its list row, its costs or the last change), sent back exactly as it is: no read needed first. A change made since is refused (409) with the current `version` and what `changed`. Send this or `content_version`.",
            "type": "string"
          }
        },
        "type": "object"
      },
      "PurchaseOrderList": {
        "properties": {
          "costs_hidden": {
            "description": "Present, with a `reason`, when money was left out.",
            "properties": {
              "reason": {
                "type": "string"
              }
            },
            "required": ["reason"],
            "type": "object"
          },
          "items": {
            "items": {
              "properties": {
                "content_version": {
                  "description": "Send it back when changing the delivery: the save is refused if the purchase order changed since. `version` holds it.",
                  "type": "integer"
                },
                "cost_status": {
                  "enum": ["planned", "estimated", "final", "missing"],
                  "type": "string"
                },
                "created_at": {
                  "format": "date-time",
                  "type": "string"
                },
                "delivery_type": {
                  "enum": ["store", "customer", "dropship"],
                  "type": "string"
                },
                "finalized_at": {
                  "format": "date-time",
                  "nullable": true,
                  "type": "string"
                },
                "id": {
                  "type": "string"
                },
                "number": {
                  "description": "The PO number as printed.",
                  "type": "string"
                },
                "original_number": {
                  "description": "An imported purchase order’s number in the old system (the PO page’s Original PO number); `q` on the list finds it. Null otherwise.",
                  "nullable": true,
                  "type": "string"
                },
                "received_at": {
                  "format": "date-time",
                  "nullable": true,
                  "type": "string"
                },
                "requested_delivery_date": {
                  "format": "date-time",
                  "nullable": true,
                  "type": "string"
                },
                "sent_at": {
                  "format": "date-time",
                  "nullable": true,
                  "type": "string"
                },
                "shipping": {
                  "description": "Only with “View costs”.",
                  "type": "number"
                },
                "status": {
                  "enum": [
                    "draft",
                    "sending",
                    "sent",
                    "partial",
                    "partially_received",
                    "received",
                    "rejected",
                    "completed"
                  ],
                  "type": "string"
                },
                "subtotal": {
                  "description": "Only with “View costs”.",
                  "type": "number"
                },
                "tax": {
                  "description": "Only with “View costs”.",
                  "type": "number"
                },
                "total_amount": {
                  "description": "Only with “View costs”.",
                  "type": "number"
                },
                "updated_at": {
                  "format": "date-time",
                  "type": "string"
                },
                "vendor": {
                  "properties": {
                    "display_name": {
                      "type": "string"
                    },
                    "id": {
                      "type": "string"
                    }
                  },
                  "required": ["id", "display_name"],
                  "type": "object"
                },
                "version": {
                  "description": "Send it back as `version` with the next write, exactly as it is: it stands for `content_version` (a purchase order write: delivery, lines, tax and shipping, a receipt), and every write answers the new one, so no read is needed between writes.",
                  "type": "string"
                }
              },
              "required": [
                "id",
                "number",
                "original_number",
                "status",
                "vendor",
                "delivery_type",
                "requested_delivery_date",
                "sent_at",
                "received_at",
                "finalized_at",
                "cost_status",
                "created_at",
                "updated_at"
              ],
              "type": "object"
            },
            "type": "array"
          },
          "next_cursor": {
            "nullable": true,
            "type": "string"
          }
        },
        "required": ["items", "next_cursor"],
        "type": "object"
      },
      "PurchaseOrderNewProducts": {
        "properties": {
          "items": {
            "items": {
              "properties": {
                "id": {
                  "description": "The purchase order line’s id.",
                  "type": "string"
                },
                "reason": {
                  "description": "Shopify’s reason, when it failed.",
                  "nullable": true,
                  "type": "string"
                },
                "state": {
                  "enum": ["creating", "failed", "not_queued"],
                  "type": "string"
                }
              },
              "required": ["id", "state", "reason"],
              "type": "object"
            },
            "type": "array"
          }
        },
        "required": ["items"],
        "type": "object"
      },
      "PurchaseOrderNewProductsRetried": {
        "properties": {
          "items": {
            "items": {
              "properties": {
                "id": {
                  "description": "The purchase order line’s id.",
                  "type": "string"
                },
                "reason": {
                  "description": "Shopify’s reason, when it failed.",
                  "nullable": true,
                  "type": "string"
                },
                "state": {
                  "enum": ["creating", "failed", "not_queued"],
                  "type": "string"
                }
              },
              "required": ["id", "state", "reason"],
              "type": "object"
            },
            "type": "array"
          },
          "requeued": {
            "type": "integer"
          }
        },
        "required": ["requeued", "items"],
        "type": "object"
      },
      "PurchaseOrderNewProductsRetry": {
        "properties": {
          "line_id": {
            "description": "One waiting line’s id; left out, every waiting line.",
            "type": "string"
          }
        },
        "type": "object"
      },
      "PurchaseOrderQuickBooksSync": {
        "properties": {
          "id": {
            "type": "string"
          },
          "queued": {
            "type": "boolean"
          },
          "quickbooks_sync_status": {
            "enum": ["not_applicable", "pending", "synced", "failed"],
            "type": "string"
          }
        },
        "required": ["id", "queued", "quickbooks_sync_status"],
        "type": "object"
      },
      "PurchaseOrderReceiptEdit": {
        "description": "One reasoned correction of a posted receipt. Send only what changes: a line, charge or field left out keeps what the receipt has.",
        "properties": {
          "add_lines": {
            "description": "Items that arrived with this delivery but were missed at check-in.",
            "items": {
              "properties": {
                "line_id": {
                  "description": "A purchase order line not yet on this receipt.",
                  "type": "string"
                },
                "received_quantity": {
                  "type": "integer"
                },
                "rejected_quantity": {
                  "type": "integer"
                },
                "rejection_reason": {
                  "nullable": true,
                  "type": "string"
                },
                "vendor_cost_entered_as_total": {
                  "description": "When the cost was typed as the line’s total, that total (for the history).",
                  "nullable": true,
                  "type": "number"
                },
                "vendor_unit_cost": {
                  "description": "The vendor’s price per unit; left out or null, the purchase order’s price. A real change needs “Correct received costs” (a key: Enter and correct costs); sent without “View costs” it is refused.",
                  "nullable": true,
                  "type": "number"
                }
              },
              "required": ["line_id", "received_quantity"],
              "type": "object"
            },
            "type": "array"
          },
          "charges": {
            "description": "The receipt’s own charges to add (no `id`), change (`id`; the fields sent replace the charge’s, and a missing description or reference is cleared) or remove (`id` and `remove: true`). Any charge needs “Correct received costs” (a key: Enter and correct costs) and “View costs”.",
            "items": {
              "properties": {
                "amount": {
                  "description": "Zero or more, two decimals.",
                  "type": "number"
                },
                "description": {
                  "nullable": true,
                  "type": "string"
                },
                "expensed": {
                  "description": "Expensed, not in item cost. Left out, a charge keeps how it is treated, a new one is split by value.",
                  "type": "boolean"
                },
                "id": {
                  "description": "A charge’s `id` from the receipt.",
                  "type": "string"
                },
                "is_estimated": {
                  "type": "boolean"
                },
                "reference": {
                  "nullable": true,
                  "type": "string"
                },
                "remove": {
                  "type": "boolean"
                },
                "targets": {
                  "description": "Lines of this receipt it lands on; empty or left out: every line.",
                  "items": {
                    "properties": {
                      "line_id": {
                        "description": "The purchase order line’s `id`.",
                        "type": "string"
                      },
                      "option_label": {
                        "description": "One option on that line.",
                        "nullable": true,
                        "type": "string"
                      },
                      "option_unit_cost": {
                        "description": "The option’s vendor cost per unit, which a split by value over options needs. Only with “View costs”.",
                        "nullable": true,
                        "type": "number"
                      },
                      "option_value": {
                        "nullable": true,
                        "type": "string"
                      }
                    },
                    "required": ["line_id"],
                    "type": "object"
                  },
                  "nullable": true,
                  "type": "array"
                },
                "type": {
                  "description": "Any casing is accepted.",
                  "enum": [
                    "inbound_shipping",
                    "duty_import",
                    "brokerage",
                    "insurance",
                    "handling",
                    "tariff",
                    "other"
                  ],
                  "type": "string"
                }
              },
              "required": ["type", "amount", "is_estimated"],
              "type": "object"
            },
            "type": "array"
          },
          "expected_updated_at": {
            "description": "The receipt’s `updated_at` as you last read it, when you don’t send `version`. A receipt changed since is `409 PURCHASE_ORDER_STALE`.",
            "format": "date-time",
            "type": "string"
          },
          "lines": {
            "description": "Lines already on the receipt that change.",
            "items": {
              "properties": {
                "receipt_line_id": {
                  "description": "A line’s `id` from the receipt.",
                  "type": "string"
                },
                "received_quantity": {
                  "description": "What this receipt received of the line, corrected.",
                  "type": "integer"
                },
                "rejected_quantity": {
                  "type": "integer"
                },
                "rejection_reason": {
                  "description": "Required when rejected units rise.",
                  "nullable": true,
                  "type": "string"
                },
                "vendor_cost_entered_as_total": {
                  "description": "When the cost was typed as the line’s total, that total (for the history).",
                  "nullable": true,
                  "type": "number"
                },
                "vendor_unit_cost": {
                  "description": "The vendor’s price per unit on this receipt, zero or more. A real change needs “Correct received costs” (a key: Enter and correct costs); sent without “View costs” it is refused.",
                  "type": "number"
                }
              },
              "required": ["receipt_line_id"],
              "type": "object"
            },
            "type": "array"
          },
          "reason": {
            "description": "Why the receipt is changing. Required.",
            "type": "string"
          },
          "version": {
            "description": "The `version` of the last answer about this record (the receipt in `GET /purchase-orders/{id}/receipts`, or the last correction), sent back exactly as it is: no read needed first. A change made since is refused (409) with the current `version` and what `changed`. Send this or `expected_updated_at`.",
            "type": "string"
          }
        },
        "required": ["reason"],
        "type": "object"
      },
      "PurchaseOrderReceiptEdited": {
        "properties": {
          "changes": {
            "description": "One sentence per change, as the activity says. Only with “View costs”.",
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "costs_hidden": {
            "description": "Present, with a `reason`, when money was left out.",
            "properties": {
              "reason": {
                "type": "string"
              }
            },
            "required": ["reason"],
            "type": "object"
          },
          "id": {
            "description": "The receipt’s id.",
            "type": "string"
          },
          "inventory_update_summary": {
            "description": "Stock changes are queued and applied by the worker after the change; failures show on the purchase order.",
            "properties": {
              "failed_count": {
                "type": "integer"
              },
              "skipped_count": {
                "type": "integer"
              },
              "updated_count": {
                "type": "integer"
              },
              "warnings": {
                "items": {
                  "type": "string"
                },
                "type": "array"
              }
            },
            "required": [
              "updated_count",
              "skipped_count",
              "failed_count",
              "warnings"
            ],
            "type": "object"
          },
          "purchase_order_id": {
            "type": "string"
          },
          "purchase_order_status": {
            "enum": [
              "draft",
              "sending",
              "sent",
              "partial",
              "partially_received",
              "received",
              "rejected",
              "completed"
            ],
            "type": "string"
          },
          "receipt_number": {
            "type": "integer"
          },
          "updated_at": {
            "description": "The receipt’s new `updated_at`, for the next correction.",
            "format": "date-time",
            "type": "string"
          },
          "version": {
            "description": "Send it back as `version` with the next write, exactly as it is: it stands for the receipt’s `updated_at`, and every write answers the new one, so no read is needed between writes.",
            "type": "string"
          }
        },
        "required": [
          "id",
          "purchase_order_id",
          "receipt_number",
          "updated_at",
          "purchase_order_status",
          "inventory_update_summary"
        ],
        "type": "object"
      },
      "PurchaseOrderReceiptList": {
        "properties": {
          "costs_hidden": {
            "description": "Present, with a `reason`, when money was left out.",
            "properties": {
              "reason": {
                "type": "string"
              }
            },
            "required": ["reason"],
            "type": "object"
          },
          "items": {
            "description": "Newest first, at most 50.",
            "items": {
              "properties": {
                "adjustments": {
                  "description": "The cost and count changes made to the receipt since it was posted, newest first (at most 50).",
                  "items": {
                    "properties": {
                      "amount": {
                        "description": "Only with “View costs”. Two decimals.",
                        "type": "number"
                      },
                      "created_at": {
                        "format": "date-time",
                        "type": "string"
                      },
                      "description": {
                        "description": "What changed. Without “View costs” only a count correction’s, without its money.",
                        "nullable": true,
                        "type": "string"
                      },
                      "id": {
                        "type": "string"
                      },
                      "kind": {
                        "enum": [
                          "late_charge",
                          "correct_unit_cost",
                          "vendor_credit",
                          "reversal",
                          "quantity_correction"
                        ],
                        "type": "string"
                      },
                      "marks_cost_final": {
                        "type": "boolean"
                      },
                      "new_landed_unit_cost": {
                        "description": "Only with “View costs”. Null when nobody has said what it costs.",
                        "nullable": true,
                        "type": "number"
                      },
                      "previous_landed_unit_cost": {
                        "description": "Only with “View costs”. Null when nobody has said what it costs.",
                        "nullable": true,
                        "type": "number"
                      },
                      "reason": {
                        "type": "string"
                      },
                      "receipt_line_id": {
                        "description": "Null for the whole receipt.",
                        "nullable": true,
                        "type": "string"
                      }
                    },
                    "required": [
                      "id",
                      "kind",
                      "receipt_line_id",
                      "reason",
                      "marks_cost_final",
                      "created_at"
                    ],
                    "type": "object"
                  },
                  "type": "array"
                },
                "adjustments_truncated": {
                  "type": "boolean"
                },
                "allocated_charges": {
                  "description": "Only with “View costs”. Two decimals.",
                  "type": "number"
                },
                "charges": {
                  "description": "The receipt’s own charges, at most 100 (charges on the whole purchase order are not here).",
                  "items": {
                    "properties": {
                      "amount": {
                        "description": "Only with “View costs”. Two decimals.",
                        "type": "number"
                      },
                      "description": {
                        "nullable": true,
                        "type": "string"
                      },
                      "expensed": {
                        "description": "Expensed, not in item cost: it lands on no line.",
                        "type": "boolean"
                      },
                      "id": {
                        "type": "string"
                      },
                      "is_estimated": {
                        "type": "boolean"
                      },
                      "reference": {
                        "nullable": true,
                        "type": "string"
                      },
                      "targets": {
                        "description": "The lines (or options) it lands on; empty: every line of the receipt.",
                        "items": {
                          "properties": {
                            "line_id": {
                              "description": "The purchase order line’s `id`.",
                              "type": "string"
                            },
                            "option_label": {
                              "description": "One option on that line.",
                              "nullable": true,
                              "type": "string"
                            },
                            "option_unit_cost": {
                              "description": "The option’s vendor cost per unit, which a split by value over options needs. Only with “View costs”.",
                              "nullable": true,
                              "type": "number"
                            },
                            "option_value": {
                              "nullable": true,
                              "type": "string"
                            }
                          },
                          "required": ["line_id"],
                          "type": "object"
                        },
                        "type": "array"
                      },
                      "type": {
                        "enum": [
                          "inbound_shipping",
                          "duty_import",
                          "brokerage",
                          "insurance",
                          "handling",
                          "tariff",
                          "other"
                        ],
                        "type": "string"
                      },
                      "updated_at": {
                        "format": "date-time",
                        "type": "string"
                      }
                    },
                    "required": [
                      "id",
                      "type",
                      "description",
                      "reference",
                      "is_estimated",
                      "expensed",
                      "targets",
                      "updated_at"
                    ],
                    "type": "object"
                  },
                  "type": "array"
                },
                "charges_truncated": {
                  "type": "boolean"
                },
                "cost_status": {
                  "enum": ["planned", "estimated", "final", "missing"],
                  "type": "string"
                },
                "currency": {
                  "description": "The shop’s currency when it was received.",
                  "type": "string"
                },
                "id": {
                  "type": "string"
                },
                "landed_total": {
                  "description": "Only with “View costs”. Null when nobody has said what it costs.",
                  "nullable": true,
                  "type": "number"
                },
                "lines": {
                  "description": "At most 300.",
                  "items": {
                    "properties": {
                      "allocated_charge_total": {
                        "description": "Only with “View costs”. Two decimals.",
                        "type": "number"
                      },
                      "cost_status": {
                        "enum": ["planned", "estimated", "final", "missing"],
                        "type": "string"
                      },
                      "id": {
                        "description": "The receipt line’s id: `receipt_line_id` in a correction.",
                        "type": "string"
                      },
                      "landed_unit_cost": {
                        "description": "Only with “View costs”. Null when nobody has said what it costs.",
                        "nullable": true,
                        "type": "number"
                      },
                      "line_id": {
                        "description": "The purchase order line it was received on.",
                        "type": "string"
                      },
                      "received_quantity": {
                        "type": "integer"
                      },
                      "rejected_quantity": {
                        "type": "integer"
                      },
                      "rejection_reason": {
                        "nullable": true,
                        "type": "string"
                      },
                      "sku": {
                        "nullable": true,
                        "type": "string"
                      },
                      "title": {
                        "nullable": true,
                        "type": "string"
                      },
                      "vendor_unit_cost": {
                        "description": "Only with “View costs”. Null when nobody has said what it costs.",
                        "nullable": true,
                        "type": "number"
                      }
                    },
                    "required": [
                      "id",
                      "line_id",
                      "title",
                      "sku",
                      "received_quantity",
                      "rejected_quantity",
                      "rejection_reason",
                      "cost_status"
                    ],
                    "type": "object"
                  },
                  "type": "array"
                },
                "lines_truncated": {
                  "type": "boolean"
                },
                "notes": {
                  "nullable": true,
                  "type": "string"
                },
                "receipt_number": {
                  "description": "1 for the first delivery, and so on.",
                  "type": "integer"
                },
                "received_at": {
                  "format": "date-time",
                  "type": "string"
                },
                "received_by": {
                  "description": "The staff member who posted it; null when none is linked (an API key, or someone who left).",
                  "nullable": true,
                  "type": "string"
                },
                "updated_at": {
                  "description": "Send it as `expected_updated_at` to correct this receipt (`version` holds it).",
                  "format": "date-time",
                  "type": "string"
                },
                "vendor_subtotal": {
                  "description": "Only with “View costs”. Null when nobody has said what it costs.",
                  "nullable": true,
                  "type": "number"
                },
                "version": {
                  "description": "Send it back as `version` with the next write, exactly as it is: it stands for this receipt’s `updated_at` (a correction), and every write answers the new one, so no read is needed between writes.",
                  "type": "string"
                }
              },
              "required": [
                "id",
                "receipt_number",
                "received_at",
                "updated_at",
                "cost_status",
                "currency",
                "notes",
                "received_by",
                "lines",
                "lines_truncated",
                "charges",
                "charges_truncated",
                "adjustments",
                "adjustments_truncated"
              ],
              "type": "object"
            },
            "type": "array"
          },
          "receipts_truncated": {
            "type": "boolean"
          }
        },
        "required": ["items", "receipts_truncated"],
        "type": "object"
      },
      "PurchaseOrderReceive": {
        "description": "Counts are the totals received and rejected so far on each line, not this delivery’s alone.",
        "properties": {
          "delivery_charges": {
            "description": "Charges that came with this delivery. Needs “Enter costs and charges”.",
            "items": {
              "properties": {
                "amount": {
                  "type": "number"
                },
                "description": {
                  "type": "string"
                },
                "is_estimated": {
                  "type": "boolean"
                },
                "reference": {
                  "type": "string"
                },
                "scope": {
                  "description": "Any casing is accepted.",
                  "enum": ["receipt", "purchase_order"],
                  "type": "string"
                },
                "type": {
                  "description": "Any casing is accepted.",
                  "enum": [
                    "inbound_shipping",
                    "duty_import",
                    "brokerage",
                    "insurance",
                    "handling",
                    "tariff",
                    "other"
                  ],
                  "type": "string"
                }
              },
              "required": ["type", "amount", "is_estimated", "scope"],
              "type": "object"
            },
            "type": "array"
          },
          "final_charge_review": {
            "description": "Required on the receipt that settles every line when the purchase order has charges: every charge in `po_charges` on the purchase order, as you last read it. A change since is `409 PURCHASE_ORDER_STALE`.",
            "properties": {
              "cancel_charge_ids": {
                "description": "Charges to cancel with this receipt. Needs “Enter costs and charges”.",
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              "reviewed_charges": {
                "items": {
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "updated_at": {
                      "format": "date-time",
                      "type": "string"
                    }
                  },
                  "required": ["id", "updated_at"],
                  "type": "object"
                },
                "type": "array"
              }
            },
            "required": ["reviewed_charges"],
            "type": "object"
          },
          "items": {
            "items": {
              "properties": {
                "expected_received_quantity": {
                  "description": "The received total you last read; a receipt made from an older read is refused (409). `version` stands for it.",
                  "nullable": true,
                  "type": "number"
                },
                "expected_rejected_quantity": {
                  "nullable": true,
                  "type": "number"
                },
                "id": {
                  "description": "The purchase order line’s id.",
                  "type": "string"
                },
                "received_quantity": {
                  "description": "Good units accepted so far on this line, in total, including this delivery. Rejected units are not in it: 2 arrived and 1 was damaged is `received_quantity: 1, rejected_quantity: 1`. The line is received once this reaches what was ordered, so a rejected unit stays expected (its replacement); send the totals again with the next delivery.",
                  "type": "number"
                },
                "rejected_quantity": {
                  "description": "Units refused so far on this line, in total, including this delivery (not counted in `received_quantity`).",
                  "type": "number"
                },
                "rejection_reason": {
                  "description": "Why, when rejected units rise (or use `rejections`).",
                  "type": "string"
                },
                "rejections": {
                  "items": {
                    "properties": {
                      "quantity": {
                        "type": "integer"
                      },
                      "reason": {
                        "type": "string"
                      }
                    },
                    "required": ["quantity", "reason"],
                    "type": "object"
                  },
                  "type": "array"
                },
                "vendor_unit_cost": {
                  "description": "The vendor’s price for these units when it differs from the PO. Needs “Enter costs and charges”; ignored otherwise.",
                  "nullable": true,
                  "type": "number"
                }
              },
              "required": ["id", "received_quantity", "rejected_quantity"],
              "type": "object"
            },
            "type": "array"
          },
          "notes": {
            "description": "Receiving notes.",
            "type": "string"
          },
          "version": {
            "description": "The purchase order’s `version` from the last answer about it (its read or the last receipt), sent back as it is: a receipt or an edit saved since is refused (409 with the current `version` and what `changed`), and each line sent is held to its totals as they are now (`expected_received_quantity` and `expected_rejected_quantity`, which it stands for). Optional, as those are.",
            "type": "string"
          }
        },
        "required": ["items"],
        "type": "object"
      },
      "PurchaseOrderReceived": {
        "properties": {
          "costs_hidden": {
            "description": "Present, with a `reason`, when money was left out.",
            "properties": {
              "reason": {
                "type": "string"
              }
            },
            "required": ["reason"],
            "type": "object"
          },
          "id": {
            "type": "string"
          },
          "inventory_update_summary": {
            "description": "Stock changes are queued and applied by the worker after the receipt; failures show on the purchase order.",
            "properties": {
              "failed_count": {
                "type": "integer"
              },
              "skipped_count": {
                "type": "integer"
              },
              "updated_count": {
                "type": "integer"
              },
              "warnings": {
                "items": {
                  "type": "string"
                },
                "type": "array"
              }
            },
            "required": [
              "updated_count",
              "skipped_count",
              "failed_count",
              "warnings"
            ],
            "type": "object"
          },
          "lines": {
            "items": {
              "properties": {
                "id": {
                  "type": "string"
                },
                "received_quantity": {
                  "nullable": true,
                  "type": "integer"
                },
                "receiving_status": {
                  "enum": ["pending", "partial", "complete", "rejected", null],
                  "nullable": true,
                  "type": "string"
                },
                "rejected_quantity": {
                  "nullable": true,
                  "type": "integer"
                }
              },
              "required": [
                "id",
                "received_quantity",
                "rejected_quantity",
                "receiving_status"
              ],
              "type": "object"
            },
            "type": "array"
          },
          "received_at": {
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "status": {
            "enum": [
              "draft",
              "sending",
              "sent",
              "partial",
              "partially_received",
              "received",
              "rejected",
              "completed"
            ],
            "type": "string"
          },
          "version": {
            "description": "Send it back as `version` with the next write, exactly as it is: it stands for the purchase order’s `content_version` after this receipt, and every write answers the new one, so no read is needed between writes.",
            "type": "string"
          }
        },
        "required": [
          "id",
          "status",
          "received_at",
          "lines",
          "inventory_update_summary"
        ],
        "type": "object"
      },
      "PurchaseOrderReopen": {
        "properties": {
          "reason": {
            "description": "Why costs are being reopened (up to 500 characters).",
            "type": "string"
          }
        },
        "required": ["reason"],
        "type": "object"
      },
      "PurchaseOrderSend": {
        "description": "Every field is optional: an empty body emails the vendor the store’s template.",
        "properties": {
          "attach_document": {
            "description": "False leaves the purchase order’s PDF off. Default true.",
            "type": "boolean"
          },
          "bcc": {
            "description": "Up to 5 addresses.",
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "cc": {
            "description": "Up to 5 addresses.",
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "message": {
            "description": "Left out: the template’s.",
            "type": "string"
          },
          "reply_to": {
            "description": "Left out: the store’s reply-to.",
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "resend": {
            "description": "True to email a purchase order the vendor already has again (its status stays).",
            "type": "boolean"
          },
          "subject": {
            "description": "Left out: the template’s. Up to 500 characters.",
            "type": "string"
          },
          "template_key": {
            "description": "A vendor email template’s `key`, as `GET /email-templates` lists them with `audience=vendor`. Left out: the store’s purchase order template.",
            "type": "string"
          },
          "to": {
            "description": "Left out: the vendor’s address on file. Up to 5.",
            "items": {
              "type": "string"
            },
            "type": "array"
          }
        },
        "type": "object"
      },
      "PurchaseOrderSent": {
        "properties": {
          "id": {
            "type": "string"
          },
          "queued": {
            "description": "True: the email is queued. False: marked sent with no email.",
            "type": "boolean"
          },
          "status": {
            "description": "`sending` until the email is accepted, then `sent` (read the purchase order again).",
            "enum": [
              "draft",
              "sending",
              "sent",
              "partial",
              "partially_received",
              "received",
              "rejected",
              "completed"
            ],
            "type": "string"
          },
          "to": {
            "items": {
              "type": "string"
            },
            "type": "array"
          }
        },
        "required": ["id", "queued", "status", "to"],
        "type": "object"
      },
      "PurchaseOrderVendorCosts": {
        "properties": {
          "content_version": {
            "type": "integer"
          },
          "id": {
            "type": "string"
          },
          "shipping": {
            "description": "Two decimals.",
            "type": "number"
          },
          "subtotal": {
            "description": "Two decimals.",
            "type": "number"
          },
          "tax": {
            "description": "Two decimals.",
            "type": "number"
          },
          "total_amount": {
            "description": "Two decimals.",
            "type": "number"
          },
          "version": {
            "description": "Send it back as `version` with the next write, exactly as it is: it stands for `content_version`, and every write answers the new one, so no read is needed between writes.",
            "type": "string"
          }
        },
        "required": [
          "id",
          "content_version",
          "subtotal",
          "tax",
          "shipping",
          "total_amount"
        ],
        "type": "object"
      },
      "PurchaseOrderVendorCostsEdit": {
        "properties": {
          "content_version": {
            "description": "The `content_version` the purchase order was read with, when you don’t send `version`.",
            "type": "integer"
          },
          "shipping": {
            "description": "The vendor’s shipping: 0 or more, at most 2 decimals.",
            "type": "number"
          },
          "tax": {
            "description": "0 or more, at most 2 decimals.",
            "type": "number"
          },
          "version": {
            "description": "The `version` of the last answer about this record (its costs, its read, its list row or the last change), sent back exactly as it is: no read needed first. A change made since is refused (409) with the current `version` and what `changed`. Send this or `content_version`.",
            "type": "string"
          }
        },
        "required": ["tax", "shipping"],
        "type": "object"
      },
      "PurchaseOrderVendorPaymentCreate": {
        "properties": {
          "amount": {
            "description": "What was paid, above 0, at most 2 decimals, in the store’s currency.",
            "type": "number"
          },
          "method": {
            "description": "How it was paid. Left out: `bank_transfer`. Any casing is accepted.",
            "enum": ["bank_transfer", "check", "card", "cash", "other"],
            "type": "string"
          },
          "note": {
            "description": "Up to 500 characters.",
            "type": "string"
          },
          "paid_at": {
            "description": "The day it was paid, `YYYY-MM-DD`. Left out: today. Never in the future.",
            "type": "string"
          },
          "reference": {
            "description": "A check number or transfer reference. Up to 60 characters.",
            "type": "string"
          },
          "vendor_id": {
            "description": "The vendor the purchase order had when you read it: refused (`409`) when it has another now.",
            "type": "string"
          }
        },
        "required": ["amount"],
        "type": "object"
      },
      "PurchaseOrderVendorPaymentSaved": {
        "description": "The purchase order’s payments after the change. If reading them back fails: `{ id, payment_id }`.",
        "properties": {
          "id": {
            "description": "The purchase order’s id.",
            "type": "string"
          },
          "items": {
            "description": "The newest 200, oldest first.",
            "items": {
              "properties": {
                "amount": {
                  "description": "Two decimals.",
                  "type": "number"
                },
                "id": {
                  "type": "string"
                },
                "method": {
                  "enum": ["bank_transfer", "check", "card", "cash", "other"],
                  "type": "string"
                },
                "note": {
                  "nullable": true,
                  "type": "string"
                },
                "paid_at": {
                  "format": "date-time",
                  "type": "string"
                },
                "reference": {
                  "nullable": true,
                  "type": "string"
                }
              },
              "required": [
                "id",
                "amount",
                "paid_at",
                "method",
                "reference",
                "note"
              ],
              "type": "object"
            },
            "type": "array"
          },
          "items_truncated": {
            "type": "boolean"
          },
          "paid_total": {
            "description": "Every payment added up, listed or not.",
            "type": "number"
          },
          "payment_count": {
            "type": "integer"
          },
          "payment_id": {
            "description": "The payment recorded or removed.",
            "type": "string"
          },
          "removed": {
            "description": "True when the payment was removed.",
            "type": "boolean"
          }
        },
        "required": [
          "payment_id",
          "id",
          "items",
          "paid_total",
          "payment_count",
          "items_truncated"
        ],
        "type": "object"
      },
      "PurchaseOrderVendorPayments": {
        "properties": {
          "id": {
            "description": "The purchase order’s id.",
            "type": "string"
          },
          "items": {
            "description": "The newest 200, oldest first.",
            "items": {
              "properties": {
                "amount": {
                  "description": "Two decimals.",
                  "type": "number"
                },
                "id": {
                  "type": "string"
                },
                "method": {
                  "enum": ["bank_transfer", "check", "card", "cash", "other"],
                  "type": "string"
                },
                "note": {
                  "nullable": true,
                  "type": "string"
                },
                "paid_at": {
                  "format": "date-time",
                  "type": "string"
                },
                "reference": {
                  "nullable": true,
                  "type": "string"
                }
              },
              "required": [
                "id",
                "amount",
                "paid_at",
                "method",
                "reference",
                "note"
              ],
              "type": "object"
            },
            "type": "array"
          },
          "items_truncated": {
            "type": "boolean"
          },
          "paid_total": {
            "description": "Every payment added up, listed or not.",
            "type": "number"
          },
          "payment_count": {
            "type": "integer"
          }
        },
        "required": [
          "id",
          "items",
          "paid_total",
          "payment_count",
          "items_truncated"
        ],
        "type": "object"
      },
      "QuickBooksAccountsUpdate": {
        "description": "Only the accounts to change; the rest stay. A field the card doesn’t have is `400 INVALID_BODY`.",
        "properties": {
          "ap_account_id": {
            "description": "Accounts payable. A QuickBooks account id, null for none. Ids from `GET /settings/quickbooks` (with `lists=true`) (`lists.accounts[].id`), read from QuickBooks.",
            "nullable": true,
            "type": "string"
          },
          "custom_order_account_id": {
            "description": "Goods bought for a customer order (required to sync). A QuickBooks account id, null for none. Ids from `GET /settings/quickbooks` (with `lists=true`) (`lists.accounts[].id`), read from QuickBooks.",
            "nullable": true,
            "type": "string"
          },
          "duty_account_id": {
            "description": "Duty and brokerage (falls back to other charges). A QuickBooks account id, null for none. Ids from `GET /settings/quickbooks` (with `lists=true`) (`lists.accounts[].id`), read from QuickBooks.",
            "nullable": true,
            "type": "string"
          },
          "freight_account_id": {
            "description": "Freight and shipping (falls back to other charges). A QuickBooks account id, null for none. Ids from `GET /settings/quickbooks` (with `lists=true`) (`lists.accounts[].id`), read from QuickBooks.",
            "nullable": true,
            "type": "string"
          },
          "other_charge_account_id": {
            "description": "Other charges (required to sync). A QuickBooks account id, null for none. Ids from `GET /settings/quickbooks` (with `lists=true`) (`lists.accounts[].id`), read from QuickBooks.",
            "nullable": true,
            "type": "string"
          },
          "stock_account_id": {
            "description": "Goods bought for stock (required to sync). A QuickBooks account id, null for none. Ids from `GET /settings/quickbooks` (with `lists=true`) (`lists.accounts[].id`), read from QuickBooks.",
            "nullable": true,
            "type": "string"
          },
          "tariff_account_id": {
            "description": "Tariffs (falls back to other charges). A QuickBooks account id, null for none. Ids from `GET /settings/quickbooks` (with `lists=true`) (`lists.accounts[].id`), read from QuickBooks.",
            "nullable": true,
            "type": "string"
          },
          "tax_account_id": {
            "description": "Purchase order tax. A QuickBooks account id, null for none. Ids from `GET /settings/quickbooks` (with `lists=true`) (`lists.accounts[].id`), read from QuickBooks.",
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "QuickBooksCostOfGoodsUpdate": {
        "description": "Cost of goods. Only the fields to change; the rest stay as saved. A field it doesn’t have is `400 INVALID_BODY`.",
        "properties": {
          "account_id": {
            "description": "The Cost of goods sold account (needed unless `off`). Ids from `GET /settings/quickbooks` (with `lists=true`) (`lists.accounts[].id`), read from QuickBooks.",
            "nullable": true,
            "type": "string"
          },
          "connector_confirmed": {
            "description": "The merchant’s confirmation that no other app (Intuit’s Shopify connector, A2X, Synder) posts cost of goods into this company: needed to turn it on. Ask the merchant; never confirm it yourself.",
            "type": "boolean"
          },
          "cost_basis": {
            "description": "`current` (the cost at fulfilment, adjusted when it changes) or `final_only` (a unit posts once its cost is final).",
            "enum": ["current", "final_only"],
            "type": "string"
          },
          "mode": {
            "description": "`off`, `daily_summary` (one journal entry a day) or `per_order` (one per order a day).",
            "enum": ["off", "daily_summary", "per_order"],
            "type": "string"
          }
        },
        "type": "object"
      },
      "QuickBooksLocationsUpdate": {
        "properties": {
          "locations": {
            "description": "1–250 locations, each once.",
            "items": {
              "properties": {
                "location_id": {
                  "description": "The Shopify location id, from `connection.locations[].location_id` of `GET /settings/quickbooks`.",
                  "type": "string"
                },
                "quickbooks_location_id": {
                  "description": "From `lists.quickbooks_locations[].id` of `GET /settings/quickbooks` (with `lists=true`); null: stop tagging it.",
                  "nullable": true,
                  "type": "string"
                }
              },
              "required": ["location_id", "quickbooks_location_id"],
              "type": "object"
            },
            "type": "array"
          }
        },
        "required": ["locations"],
        "type": "object"
      },
      "QuickBooksPaymentsUpdate": {
        "description": "Vendor payments. Only the fields to change; the rest stay as saved. A field it doesn’t have is `400 INVALID_BODY`.",
        "properties": {
          "apply_deposits_to_bills": {
            "description": "Deposits are drawn down on the bills when they post.",
            "type": "boolean"
          },
          "bank_account_id": {
            "description": "The bank account payments leave from (needed unless `off`). Ids from `GET /settings/quickbooks` (with `lists=true`) (`lists.accounts[].id`), read from QuickBooks.",
            "nullable": true,
            "type": "string"
          },
          "card_account_id": {
            "description": "The credit card account card payments are charged to. Ids from `GET /settings/quickbooks` (with `lists=true`) (`lists.accounts[].id`), read from QuickBooks.",
            "nullable": true,
            "type": "string"
          },
          "mode": {
            "description": "`off` (kept in OrderPilot only), `deposit` (money out into Vendor deposits, drawn down by the bills) or `bill_payment` (pays the purchase order’s bills, oldest first).",
            "enum": ["off", "deposit", "bill_payment"],
            "type": "string"
          },
          "vendor_deposit_account_id": {
            "description": "The Vendor deposits account (needed unless `off`). Ids from `GET /settings/quickbooks` (with `lists=true`) (`lists.accounts[].id`), read from QuickBooks.",
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "QuickBooksPostNow": {
        "properties": {
          "queued": {
            "description": "The posting is queued: it runs in the next minutes.",
            "type": "boolean"
          },
          "warning": {
            "description": "Queued, but something beside it wasn’t (and what to do); null when all was.",
            "nullable": true,
            "type": "string"
          }
        },
        "required": ["queued", "warning"],
        "type": "object"
      },
      "QuickBooksSalesUpdate": {
        "description": "Customer orders and payments. Only the fields to change; the rest stay as saved. A field it doesn’t have is `400 INVALID_BODY`.",
        "properties": {
          "connector_confirmed": {
            "description": "The merchant’s confirmation that Intuit’s Shopify connector (or any other sales app) doesn’t post these orders to this company: needed to turn it on. Ask the merchant; never confirm it yourself.",
            "type": "boolean"
          },
          "customer_payment_account_id": {
            "description": "The account customer payments deposit to (needed to turn it on). Ids from `GET /settings/quickbooks` (with `lists=true`) (`lists.accounts[].id`), read from QuickBooks.",
            "nullable": true,
            "type": "string"
          },
          "discount_account_id": {
            "description": "Discounts. Ids from `GET /settings/quickbooks` (with `lists=true`) (`lists.accounts[].id`), read from QuickBooks.",
            "nullable": true,
            "type": "string"
          },
          "enabled": {
            "description": "Post customer orders and payments.",
            "type": "boolean"
          },
          "exempt_tax_code_id": {
            "description": "With `tax_codes`, outside the US: the code untaxed lines carry, from `lists.untaxed_tax_codes[].id` of `GET /settings/quickbooks` (with `lists=true`); null for QuickBooks’ Exempt.",
            "nullable": true,
            "type": "string"
          },
          "income_account_id": {
            "description": "Sales income (needed to turn it on). Ids from `GET /settings/quickbooks` (with `lists=true`) (`lists.accounts[].id`), read from QuickBooks.",
            "nullable": true,
            "type": "string"
          },
          "post_online_store_orders": {
            "description": "Also post online-store orders OrderPilot didn’t create, read from Shopify.",
            "type": "boolean"
          },
          "shipping_income_account_id": {
            "description": "Shipping income. Ids from `GET /settings/quickbooks` (with `lists=true`) (`lists.accounts[].id`), read from QuickBooks.",
            "nullable": true,
            "type": "string"
          },
          "start_date": {
            "description": "YYYY-MM-DD, the store’s day: orders first paid that day or later post (needed to turn it on).",
            "nullable": true,
            "type": "string"
          },
          "store_credit_account_id": {
            "description": "Store credit and gift cards owed to customers (a liability); null: those payments wait. Ids from `GET /settings/quickbooks` (with `lists=true`) (`lists.accounts[].id`), read from QuickBooks.",
            "nullable": true,
            "type": "string"
          },
          "tax_account_id": {
            "description": "Sales tax payable (needed with `tax_mode: account_line`). Ids from `GET /settings/quickbooks` (with `lists=true`) (`lists.accounts[].id`), read from QuickBooks.",
            "nullable": true,
            "type": "string"
          },
          "tax_mode": {
            "description": "`account_line` (a row on Sales tax payable) or `tax_codes` (each Shopify tax through its QuickBooks rate, reaching the sales tax centre).",
            "enum": ["account_line", "tax_codes"],
            "type": "string"
          }
        },
        "type": "object"
      },
      "QuickBooksSettings": {
        "description": "Settings › Purchasing and accounting › QuickBooks.",
        "properties": {
          "configured": {
            "description": "QuickBooks is set up on this server (false: nothing can connect).",
            "type": "boolean"
          },
          "connection": {
            "description": "The connected company and its settings; null while none is connected.",
            "nullable": true,
            "properties": {
              "accounts": {
                "description": "The accounts purchases post to.",
                "properties": {
                  "ap_account_id": {
                    "description": "Accounts payable. A QuickBooks account id, null for none. Ids from `GET /settings/quickbooks` (with `lists=true`) (`lists.accounts[].id`), read from QuickBooks.",
                    "nullable": true,
                    "type": "string"
                  },
                  "custom_order_account_id": {
                    "description": "Goods bought for a customer order (required to sync). A QuickBooks account id, null for none. Ids from `GET /settings/quickbooks` (with `lists=true`) (`lists.accounts[].id`), read from QuickBooks.",
                    "nullable": true,
                    "type": "string"
                  },
                  "duty_account_id": {
                    "description": "Duty and brokerage (falls back to other charges). A QuickBooks account id, null for none. Ids from `GET /settings/quickbooks` (with `lists=true`) (`lists.accounts[].id`), read from QuickBooks.",
                    "nullable": true,
                    "type": "string"
                  },
                  "freight_account_id": {
                    "description": "Freight and shipping (falls back to other charges). A QuickBooks account id, null for none. Ids from `GET /settings/quickbooks` (with `lists=true`) (`lists.accounts[].id`), read from QuickBooks.",
                    "nullable": true,
                    "type": "string"
                  },
                  "other_charge_account_id": {
                    "description": "Other charges (required to sync). A QuickBooks account id, null for none. Ids from `GET /settings/quickbooks` (with `lists=true`) (`lists.accounts[].id`), read from QuickBooks.",
                    "nullable": true,
                    "type": "string"
                  },
                  "stock_account_id": {
                    "description": "Goods bought for stock (required to sync). A QuickBooks account id, null for none. Ids from `GET /settings/quickbooks` (with `lists=true`) (`lists.accounts[].id`), read from QuickBooks.",
                    "nullable": true,
                    "type": "string"
                  },
                  "tariff_account_id": {
                    "description": "Tariffs (falls back to other charges). A QuickBooks account id, null for none. Ids from `GET /settings/quickbooks` (with `lists=true`) (`lists.accounts[].id`), read from QuickBooks.",
                    "nullable": true,
                    "type": "string"
                  },
                  "tax_account_id": {
                    "description": "Purchase order tax. A QuickBooks account id, null for none. Ids from `GET /settings/quickbooks` (with `lists=true`) (`lists.accounts[].id`), read from QuickBooks.",
                    "nullable": true,
                    "type": "string"
                  }
                },
                "required": [
                  "ap_account_id",
                  "stock_account_id",
                  "custom_order_account_id",
                  "freight_account_id",
                  "duty_account_id",
                  "tariff_account_id",
                  "other_charge_account_id",
                  "tax_account_id"
                ],
                "type": "object"
              },
              "company_name": {
                "nullable": true,
                "type": "string"
              },
              "connected_at": {
                "format": "date-time",
                "type": "string"
              },
              "cost_of_goods": {
                "description": "Cost of goods.",
                "properties": {
                  "account_id": {
                    "description": "The Cost of goods sold account (needed unless `off`). Ids from `GET /settings/quickbooks` (with `lists=true`) (`lists.accounts[].id`), read from QuickBooks.",
                    "nullable": true,
                    "type": "string"
                  },
                  "connector_confirmed": {
                    "description": "The merchant’s confirmation that no other app (Intuit’s Shopify connector, A2X, Synder) posts cost of goods into this company: needed to turn it on. Ask the merchant; never confirm it yourself.",
                    "type": "boolean"
                  },
                  "cost_basis": {
                    "description": "`current` (the cost at fulfilment, adjusted when it changes) or `final_only` (a unit posts once its cost is final).",
                    "enum": ["current", "final_only"],
                    "type": "string"
                  },
                  "last_error": {
                    "description": "Why the last posting failed, in plain words (QuickBooks’ own are in Settings); null once one gets through.",
                    "nullable": true,
                    "type": "string"
                  },
                  "mode": {
                    "description": "`off`, `daily_summary` (one journal entry a day) or `per_order` (one per order a day).",
                    "enum": ["off", "daily_summary", "per_order"],
                    "type": "string"
                  },
                  "posted_through": {
                    "description": "Fulfilments and cost changes up to here are posted.",
                    "format": "date-time",
                    "nullable": true,
                    "type": "string"
                  },
                  "time_zone": {
                    "description": "The store’s time zone, which days are counted in.",
                    "type": "string"
                  }
                },
                "required": [
                  "mode",
                  "cost_basis",
                  "account_id",
                  "connector_confirmed",
                  "posted_through",
                  "time_zone",
                  "last_error"
                ],
                "type": "object"
              },
              "environment": {
                "enum": ["sandbox", "production"],
                "type": "string"
              },
              "locations": {
                "description": "Each store location (active, and deactivated ones still tagged) and the QuickBooks Location it is tagged with.",
                "items": {
                  "properties": {
                    "active": {
                      "type": "boolean"
                    },
                    "location_id": {
                      "description": "The Shopify location id, as `GET /locations` lists it.",
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    },
                    "quickbooks_location_id": {
                      "nullable": true,
                      "type": "string"
                    },
                    "quickbooks_location_name": {
                      "nullable": true,
                      "type": "string"
                    }
                  },
                  "required": [
                    "location_id",
                    "name",
                    "active",
                    "quickbooks_location_id",
                    "quickbooks_location_name"
                  ],
                  "type": "object"
                },
                "type": "array"
              },
              "needs_reconnect": {
                "description": "Why Intuit ended the connection (a person must connect again in the admin); null while it works.",
                "nullable": true,
                "type": "string"
              },
              "payments": {
                "description": "Vendor payments.",
                "properties": {
                  "apply_deposits_to_bills": {
                    "description": "Deposits are drawn down on the bills when they post.",
                    "type": "boolean"
                  },
                  "bank_account_id": {
                    "description": "The bank account payments leave from (needed unless `off`). Ids from `GET /settings/quickbooks` (with `lists=true`) (`lists.accounts[].id`), read from QuickBooks.",
                    "nullable": true,
                    "type": "string"
                  },
                  "card_account_id": {
                    "description": "The credit card account card payments are charged to. Ids from `GET /settings/quickbooks` (with `lists=true`) (`lists.accounts[].id`), read from QuickBooks.",
                    "nullable": true,
                    "type": "string"
                  },
                  "mode": {
                    "description": "`off` (kept in OrderPilot only), `deposit` (money out into Vendor deposits, drawn down by the bills) or `bill_payment` (pays the purchase order’s bills, oldest first).",
                    "enum": ["off", "deposit", "bill_payment"],
                    "type": "string"
                  },
                  "vendor_deposit_account_id": {
                    "description": "The Vendor deposits account (needed unless `off`). Ids from `GET /settings/quickbooks` (with `lists=true`) (`lists.accounts[].id`), read from QuickBooks.",
                    "nullable": true,
                    "type": "string"
                  }
                },
                "required": [
                  "mode",
                  "bank_account_id",
                  "card_account_id",
                  "vendor_deposit_account_id",
                  "apply_deposits_to_bills"
                ],
                "type": "object"
              },
              "realm_id": {
                "description": "The QuickBooks company’s id.",
                "type": "string"
              },
              "sales": {
                "description": "Customer orders and payments.",
                "properties": {
                  "connector_confirmed": {
                    "description": "The merchant’s confirmation that Intuit’s Shopify connector (or any other sales app) doesn’t post these orders to this company: needed to turn it on. Ask the merchant; never confirm it yourself.",
                    "type": "boolean"
                  },
                  "customer_payment_account_id": {
                    "description": "The account customer payments deposit to (needed to turn it on). Ids from `GET /settings/quickbooks` (with `lists=true`) (`lists.accounts[].id`), read from QuickBooks.",
                    "nullable": true,
                    "type": "string"
                  },
                  "discount_account_id": {
                    "description": "Discounts. Ids from `GET /settings/quickbooks` (with `lists=true`) (`lists.accounts[].id`), read from QuickBooks.",
                    "nullable": true,
                    "type": "string"
                  },
                  "enabled": {
                    "description": "Post customer orders and payments.",
                    "type": "boolean"
                  },
                  "exempt_tax_code_id": {
                    "description": "With `tax_codes`, outside the US: the code untaxed lines carry, from `lists.untaxed_tax_codes[].id` of `GET /settings/quickbooks` (with `lists=true`); null for QuickBooks’ Exempt.",
                    "nullable": true,
                    "type": "string"
                  },
                  "income_account_id": {
                    "description": "Sales income (needed to turn it on). Ids from `GET /settings/quickbooks` (with `lists=true`) (`lists.accounts[].id`), read from QuickBooks.",
                    "nullable": true,
                    "type": "string"
                  },
                  "online_store_error": {
                    "description": "Set while the online-store orders sweep is failing (while they post): a fixed sentence, the details being in Settings; null once one gets through.",
                    "nullable": true,
                    "type": "string"
                  },
                  "post_online_store_orders": {
                    "description": "Also post online-store orders OrderPilot didn’t create, read from Shopify.",
                    "type": "boolean"
                  },
                  "shipping_income_account_id": {
                    "description": "Shipping income. Ids from `GET /settings/quickbooks` (with `lists=true`) (`lists.accounts[].id`), read from QuickBooks.",
                    "nullable": true,
                    "type": "string"
                  },
                  "start_date": {
                    "description": "YYYY-MM-DD, the store’s day: orders first paid that day or later post (needed to turn it on).",
                    "nullable": true,
                    "type": "string"
                  },
                  "store_credit_account_id": {
                    "description": "Store credit and gift cards owed to customers (a liability); null: those payments wait. Ids from `GET /settings/quickbooks` (with `lists=true`) (`lists.accounts[].id`), read from QuickBooks.",
                    "nullable": true,
                    "type": "string"
                  },
                  "tax_account_id": {
                    "description": "Sales tax payable (needed with `tax_mode: account_line`). Ids from `GET /settings/quickbooks` (with `lists=true`) (`lists.accounts[].id`), read from QuickBooks.",
                    "nullable": true,
                    "type": "string"
                  },
                  "tax_mode": {
                    "description": "`account_line` (a row on Sales tax payable) or `tax_codes` (each Shopify tax through its QuickBooks rate, reaching the sales tax centre).",
                    "enum": ["account_line", "tax_codes"],
                    "type": "string"
                  }
                },
                "required": [
                  "enabled",
                  "start_date",
                  "income_account_id",
                  "shipping_income_account_id",
                  "tax_account_id",
                  "tax_mode",
                  "exempt_tax_code_id",
                  "discount_account_id",
                  "customer_payment_account_id",
                  "store_credit_account_id",
                  "post_online_store_orders",
                  "connector_confirmed",
                  "online_store_error"
                ],
                "type": "object"
              },
              "sync_enabled": {
                "description": "Purchase orders, bills and payments post.",
                "type": "boolean"
              },
              "sync_started_at": {
                "description": "When sync was first turned on: what was sent before it isn’t posted.",
                "format": "date-time",
                "nullable": true,
                "type": "string"
              },
              "taxes": {
                "description": "Each Shopify tax seen so far, the QuickBooks code it posts to with tax codes and its liability account.",
                "items": {
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "liability_account_id": {
                      "description": "Its own liability account; null: Sales tax payable.",
                      "nullable": true,
                      "type": "string"
                    },
                    "quickbooks_tax_code_id": {
                      "description": "Null until an order posts it with tax codes.",
                      "nullable": true,
                      "type": "string"
                    },
                    "quickbooks_tax_code_name": {
                      "nullable": true,
                      "type": "string"
                    },
                    "rate_percent": {
                      "type": "number"
                    },
                    "source": {
                      "description": "`matched` (an existing rate), `auto_created` (made by OrderPilot) or `merchant` (chosen in Settings).",
                      "enum": ["matched", "auto_created", "merchant", null],
                      "nullable": true,
                      "type": "string"
                    },
                    "title": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "id",
                    "title",
                    "rate_percent",
                    "quickbooks_tax_code_id",
                    "quickbooks_tax_code_name",
                    "source",
                    "liability_account_id"
                  ],
                  "type": "object"
                },
                "type": "array"
              }
            },
            "required": [
              "company_name",
              "realm_id",
              "environment",
              "connected_at",
              "needs_reconnect",
              "sync_enabled",
              "sync_started_at",
              "accounts",
              "payments",
              "cost_of_goods",
              "sales",
              "locations",
              "taxes"
            ],
            "type": "object"
          },
          "environment": {
            "description": "The QuickBooks environment this server connects to.",
            "enum": ["sandbox", "production"],
            "type": "string"
          },
          "lists": {
            "description": "With `lists=true` and a working connection: what QuickBooks and the store hold, for the saves’ ids. Null otherwise.",
            "nullable": true,
            "properties": {
              "accounts": {
                "description": "The company’s active accounts: what every `*_account_id` takes.",
                "items": {
                  "properties": {
                    "account_subtype_name": {
                      "nullable": true,
                      "type": "string"
                    },
                    "account_type_name": {
                      "description": "QuickBooks’ own word for its type (`Expense`, `Cost of Goods Sold`, `Bank`…): a save refuses an account of the wrong type.",
                      "type": "string"
                    },
                    "id": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "id",
                    "name",
                    "account_type_name",
                    "account_subtype_name"
                  ],
                  "type": "object"
                },
                "type": "array"
              },
              "company": {
                "description": "What Settings warns about before anything syncs; null when QuickBooks couldn’t be read.",
                "nullable": true,
                "properties": {
                  "automated_sales_tax": {
                    "description": "QuickBooks works out sales tax itself: `tax_codes` is refused.",
                    "type": "boolean"
                  },
                  "book_close_date": {
                    "description": "QuickBooks’ closing date, YYYY-MM-DD, or null.",
                    "nullable": true,
                    "type": "string"
                  },
                  "country": {
                    "nullable": true,
                    "type": "string"
                  },
                  "currency_problem": {
                    "description": "Why nothing can sync to this company (another currency), or null.",
                    "nullable": true,
                    "type": "string"
                  },
                  "home_currency": {
                    "nullable": true,
                    "type": "string"
                  },
                  "inventory_items": {
                    "description": "Active inventory items: something here posts its own cost of goods.",
                    "type": "integer"
                  },
                  "recent_sales_receipts": {
                    "description": "Sales receipts in the last 30 days: another app (Intuit’s Shopify connector) posts sales.",
                    "type": "integer"
                  },
                  "shop_currency": {
                    "nullable": true,
                    "type": "string"
                  },
                  "track_locations": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "home_currency",
                  "shop_currency",
                  "currency_problem",
                  "book_close_date",
                  "track_locations",
                  "country",
                  "automated_sales_tax",
                  "inventory_items",
                  "recent_sales_receipts"
                ],
                "type": "object"
              },
              "error": {
                "description": "Set when QuickBooks couldn’t be read (its lists are then empty; `vendors` still lists the store’s): what to do, in words; null when it was read.",
                "nullable": true,
                "type": "string"
              },
              "quickbooks_locations": {
                "description": "Active Locations; empty while location tracking is off in QuickBooks.",
                "items": {
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    }
                  },
                  "required": ["id", "name"],
                  "type": "object"
                },
                "type": "array"
              },
              "quickbooks_vendors": {
                "items": {
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    }
                  },
                  "required": ["id", "name"],
                  "type": "object"
                },
                "type": "array"
              },
              "quickbooks_vendors_matched_elsewhere": {
                "description": "QuickBooks vendor ids matched to a vendor not listed (never offered again).",
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              "rate_tax_codes": {
                "description": "Codes holding one sales rate: what a tax’s `quickbooks_tax_code_id` takes.",
                "items": {
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    },
                    "percent": {
                      "description": "Its sales rates added up (0 for Exempt).",
                      "type": "number"
                    }
                  },
                  "required": ["id", "name", "percent"],
                  "type": "object"
                },
                "type": "array"
              },
              "untaxed_tax_codes": {
                "description": "Codes that charge nothing: what `exempt_tax_code_id` takes (outside the US).",
                "items": {
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    },
                    "percent": {
                      "description": "Its sales rates added up (0 for Exempt).",
                      "type": "number"
                    }
                  },
                  "required": ["id", "name", "percent"],
                  "type": "object"
                },
                "type": "array"
              },
              "vendors": {
                "description": "The store’s active vendors (up to 500, by name) and their QuickBooks match.",
                "items": {
                  "properties": {
                    "name": {
                      "type": "string"
                    },
                    "quickbooks_vendor_id": {
                      "description": "Null: matched by name, or created, at the next push.",
                      "nullable": true,
                      "type": "string"
                    },
                    "quickbooks_vendor_name": {
                      "nullable": true,
                      "type": "string"
                    },
                    "vendor_id": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "vendor_id",
                    "name",
                    "quickbooks_vendor_id",
                    "quickbooks_vendor_name"
                  ],
                  "type": "object"
                },
                "type": "array"
              },
              "vendors_partial": {
                "description": "More vendors than `vendors` lists.",
                "type": "boolean"
              }
            },
            "required": [
              "accounts",
              "quickbooks_vendors",
              "quickbooks_locations",
              "untaxed_tax_codes",
              "rate_tax_codes",
              "company",
              "vendors",
              "vendors_partial",
              "quickbooks_vendors_matched_elsewhere",
              "error"
            ],
            "type": "object"
          },
          "pending_connection": {
            "description": "A company Intuit granted that waits for a person to confirm it in the admin; null when none.",
            "nullable": true,
            "properties": {
              "company_name": {
                "nullable": true,
                "type": "string"
              }
            },
            "required": ["company_name"],
            "type": "object"
          },
          "warning": {
            "description": "A save only, when something after it couldn’t be queued: saved, and what happens instead.",
            "type": "string"
          }
        },
        "required": [
          "configured",
          "environment",
          "pending_connection",
          "connection",
          "lists"
        ],
        "type": "object"
      },
      "QuickBooksSyncLog": {
        "properties": {
          "entries": {
            "items": {
              "properties": {
                "at": {
                  "format": "date-time",
                  "type": "string"
                },
                "detail": {
                  "description": "What a sale’s credit memo, refund or zero payment did (`Store credit used`); null: the type says it.",
                  "nullable": true,
                  "type": "string"
                },
                "doc_number": {
                  "nullable": true,
                  "type": "string"
                },
                "id": {
                  "type": "string"
                },
                "orders": {
                  "description": "A cost of goods journal entry: the orders it carries (as many as the log reads) and how many in all.",
                  "nullable": true,
                  "properties": {
                    "count": {
                      "type": "integer"
                    },
                    "shown": {
                      "items": {
                        "properties": {
                          "id": {
                            "description": "Null when this key can’t open it.",
                            "nullable": true,
                            "type": "string"
                          },
                          "label": {
                            "type": "string"
                          }
                        },
                        "required": ["id", "label"],
                        "type": "object"
                      },
                      "type": "array"
                    }
                  },
                  "required": ["count", "shown"],
                  "type": "object"
                },
                "quickbooks_id": {
                  "description": "QuickBooks’ own id: the reference to find it there.",
                  "type": "string"
                },
                "source": {
                  "nullable": true,
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "kind": {
                      "description": "`online`: an online-store order OrderPilot didn’t create (its id is Shopify’s).",
                      "enum": ["order", "purchase_order", "online"],
                      "type": "string"
                    },
                    "label": {
                      "type": "string"
                    }
                  },
                  "required": ["kind", "id", "label"],
                  "type": "object"
                },
                "total": {
                  "description": "Null when hidden (a purchase-order document without See costs).",
                  "nullable": true,
                  "type": "number"
                },
                "type": {
                  "enum": [
                    "purchase_order",
                    "bill",
                    "vendor_credit",
                    "supplemental_bill",
                    "vendor_payment",
                    "bill_payment",
                    "journal_entry",
                    "invoice",
                    "receive_payment",
                    "credit_memo",
                    "refund_receipt",
                    "refund_journal"
                  ],
                  "type": "string"
                }
              },
              "required": [
                "id",
                "type",
                "detail",
                "doc_number",
                "quickbooks_id",
                "total",
                "at",
                "source",
                "orders"
              ],
              "type": "object"
            },
            "type": "array"
          },
          "has_more": {
            "type": "boolean"
          },
          "page": {
            "type": "integer"
          },
          "page_size": {
            "type": "integer"
          },
          "total": {
            "description": "Matching documents, up to the 1,000 the log reaches.",
            "type": "integer"
          },
          "unsynced": {
            "properties": {
              "failed_orders": {
                "type": "integer"
              },
              "failed_purchase_orders": {
                "type": "integer"
              },
              "online_orders": {
                "description": "Online-store orders that failed for good (empty for a location-limited key).",
                "items": {
                  "properties": {
                    "message": {
                      "type": "string"
                    },
                    "shopify_order_id": {
                      "type": "string"
                    }
                  },
                  "required": ["shopify_order_id", "message"],
                  "type": "object"
                },
                "type": "array"
              },
              "orders": {
                "description": "The latest failed or waiting orders, newest first.",
                "items": {
                  "properties": {
                    "change_refusal": {
                      "description": "Why this key can’t change the order (outside its locations), or null.",
                      "nullable": true,
                      "type": "string"
                    },
                    "id": {
                      "type": "string"
                    },
                    "label": {
                      "type": "string"
                    },
                    "message": {
                      "nullable": true,
                      "type": "string"
                    },
                    "status": {
                      "enum": ["failed", "waiting"],
                      "type": "string"
                    }
                  },
                  "required": [
                    "id",
                    "label",
                    "status",
                    "message",
                    "change_refusal"
                  ],
                  "type": "object"
                },
                "type": "array"
              },
              "waiting_orders": {
                "type": "integer"
              }
            },
            "required": [
              "failed_orders",
              "waiting_orders",
              "failed_purchase_orders",
              "orders",
              "online_orders"
            ],
            "type": "object"
          }
        },
        "required": [
          "entries",
          "page",
          "has_more",
          "total",
          "page_size",
          "unsynced"
        ],
        "type": "object"
      },
      "QuickBooksSyncSet": {
        "properties": {
          "enabled": {
            "description": "true: sync on; false: off.",
            "type": "boolean"
          }
        },
        "required": ["enabled"],
        "type": "object"
      },
      "QuickBooksTaxesUpdate": {
        "properties": {
          "taxes": {
            "description": "1–200 taxes, each once, each with at least one of the two fields.",
            "items": {
              "properties": {
                "id": {
                  "description": "From `connection.taxes[].id` of `GET /settings/quickbooks`.",
                  "type": "string"
                },
                "liability_account_id": {
                  "description": "Its own liability account; null: back to Sales tax payable. Ids from `GET /settings/quickbooks` (with `lists=true`) (`lists.accounts[].id`), read from QuickBooks.",
                  "nullable": true,
                  "type": "string"
                },
                "quickbooks_tax_code_id": {
                  "description": "A code holding one sales rate, from `lists.rate_tax_codes[].id` of `GET /settings/quickbooks` (with `lists=true`).",
                  "type": "string"
                }
              },
              "required": ["id"],
              "type": "object"
            },
            "type": "array"
          }
        },
        "required": ["taxes"],
        "type": "object"
      },
      "QuickBooksVendorMatch": {
        "properties": {
          "quickbooks_vendor_id": {
            "nullable": true,
            "type": "string"
          },
          "quickbooks_vendor_name": {
            "nullable": true,
            "type": "string"
          },
          "vendor_id": {
            "type": "string"
          }
        },
        "required": [
          "vendor_id",
          "quickbooks_vendor_id",
          "quickbooks_vendor_name"
        ],
        "type": "object"
      },
      "QuickBooksVendorMatchUpdate": {
        "properties": {
          "quickbooks_vendor_id": {
            "description": "From `lists.quickbooks_vendors[].id` of `GET /settings/quickbooks` (with `lists=true`); null: back to automatic.",
            "nullable": true,
            "type": "string"
          },
          "quickbooks_vendor_name": {
            "description": "Ignored: the match keeps QuickBooks’ own name for the vendor, read from QuickBooks when it saves.",
            "type": "string"
          }
        },
        "required": ["quickbooks_vendor_id"],
        "type": "object"
      },
      "QuickBooksVendorMatches": {
        "properties": {
          "matches": {
            "description": "1–100 matches; each vendor once, each QuickBooks vendor once.",
            "items": {
              "properties": {
                "quickbooks_vendor_id": {
                  "description": "From `lists.quickbooks_vendors[].id` of `GET /settings/quickbooks` (with `lists=true`).",
                  "type": "string"
                },
                "quickbooks_vendor_name": {
                  "description": "Ignored: the match keeps QuickBooks’ own name for the vendor, read from QuickBooks when it saves.",
                  "type": "string"
                },
                "vendor_id": {
                  "description": "From `lists.vendors[].vendor_id` of `GET /settings/quickbooks` (with `lists=true`).",
                  "type": "string"
                }
              },
              "required": ["vendor_id", "quickbooks_vendor_id"],
              "type": "object"
            },
            "type": "array"
          }
        },
        "required": ["matches"],
        "type": "object"
      },
      "QuickBooksVendorsMatched": {
        "properties": {
          "matched": {
            "description": "How many vendors of the store were matched.",
            "type": "integer"
          }
        },
        "required": ["matched"],
        "type": "object"
      },
      "QuickReplies": {
        "properties": {
          "items": {
            "items": {
              "properties": {
                "body": {
                  "type": "string"
                },
                "id": {
                  "type": "string"
                },
                "title": {
                  "type": "string"
                }
              },
              "type": "object"
            },
            "type": "array"
          },
          "reply_goal_hours": {
            "type": "integer"
          }
        },
        "required": ["items", "reply_goal_hours"],
        "type": "object"
      },
      "QuickRepliesSaved": {
        "properties": {
          "items": {
            "items": {
              "properties": {
                "body": {
                  "type": "string"
                },
                "id": {
                  "type": "string"
                },
                "title": {
                  "type": "string"
                }
              },
              "required": ["id", "title", "body"],
              "type": "object"
            },
            "type": "array"
          },
          "reply_goal_hours": {
            "type": "integer"
          },
          "saved_id": {
            "description": "The quick reply just saved.",
            "type": "string"
          }
        },
        "required": ["items", "reply_goal_hours"],
        "type": "object"
      },
      "QuickReplyWrite": {
        "properties": {
          "body": {
            "description": "Up to 2,000 characters; placeholders as the composer fills them.",
            "type": "string"
          },
          "title": {
            "description": "Up to 60 characters.",
            "type": "string"
          }
        },
        "type": "object"
      },
      "QuoteConvert": {
        "properties": {
          "note": {
            "description": "A note kept with the order’s payment request (up to 255 characters).",
            "type": "string"
          },
          "override_requirements": {
            "description": "Place it even without what it usually needs (a signature, a deposit). Needs the right to place anyway; the activity says what it went without.",
            "type": "boolean"
          }
        },
        "type": "object"
      },
      "QuoteCreate": {
        "properties": {
          "custom_fields": {
            "description": "Order-level custom fields [{ field_id, value }]; the shop required ones must be sent (see GET /custom-fields), and every one missing is listed in the refusal (`error.missing`, with each one’s choices). A text-and-image field takes its text in `value` and its picture in `image_url`.",
            "items": {
              "properties": {
                "field_id": {
                  "type": "string"
                },
                "image_file_id": {
                  "description": "The picture’s Shopify file id, the `shopify_file_id` `POST /files` answered. Optional; sent with `image_url`.",
                  "nullable": true,
                  "type": "string"
                },
                "image_url": {
                  "description": "A text-and-image option’s or field’s picture: its Shopify Files URL, the `url` `POST /files` answered (another host is refused). Its text is `value`.",
                  "nullable": true,
                  "type": "string"
                },
                "value": {
                  "type": "string"
                }
              },
              "type": "object"
            },
            "type": "array"
          },
          "customer_email": {
            "description": "The customer by their email (any case), instead of `customer_id`: the one customer with it is quoted. None is `404 CUSTOMER_NOT_FOUND` (find them with `GET /customers` or make them with `POST /customers` first) and several `409 CUSTOMER_AMBIGUOUS`, listed in `error.matches`.",
            "type": "string"
          },
          "customer_id": {
            "description": "An id from `GET /customers` (or `POST /customers`). Or send `customer_email` instead.",
            "type": "string"
          },
          "discount": {
            "description": "The quote’s discount, as `PATCH /quotes/{id}` sets it: `{ type, value, reason, scope? }`. Needs Prices and exceptions (`PRICING_WRITE`); a role’s discount limit applies.",
            "properties": {
              "reason": {
                "type": "string"
              },
              "scope": {
                "enum": ["products_and_fees", "products_only"],
                "type": "string"
              },
              "type": {
                "enum": ["percentage", "fixed_amount"],
                "type": "string"
              },
              "value": {
                "type": "number"
              }
            },
            "type": "object"
          },
          "fees": {
            "description": "Fees to add, as `PATCH /quotes/{id}` adds them: `{ add: [...] }`, a saved one `{ template_id, quantity? }` (`GET /fee-templates`) or a custom one `{ name, type, value, quantity?, taxable?, physical? }` (needs Prices and exceptions).",
            "properties": {
              "add": {
                "items": {
                  "properties": {
                    "name": {
                      "type": "string"
                    },
                    "physical": {
                      "type": "boolean"
                    },
                    "quantity": {
                      "type": "integer"
                    },
                    "taxable": {
                      "type": "boolean"
                    },
                    "template_id": {
                      "type": "string"
                    },
                    "type": {
                      "enum": [
                        "fixed_amount",
                        "percent_of_discounted_price",
                        "percent_of_total",
                        "percent_of_retail_price"
                      ],
                      "type": "string"
                    },
                    "value": {
                      "type": "number"
                    }
                  },
                  "type": "object"
                },
                "type": "array"
              }
            },
            "type": "object"
          },
          "lines": {
            "description": "At least one. Each is a product template (`template_id`, with its `options`), a Shopify product (`shopify_variant_id`, `shopify_product_id` optional, or its `sku` alone) or a custom item (`title` and `price`, with `sku` optional). The server prices a template line from the template and a Shopify product line at its variant’s catalog price. A `price` each on a template or Shopify product line, and a custom item, set the price by hand: they need the right to change item prices (a key: Prices and exceptions, `PRICING_WRITE`), and a role’s discount limit applies as in OrderPilot. A line also takes its own `discount` and `fulfillment`, as `PATCH /quotes/{id}` sets them. A Shopify product that is a composition goes on as its pieces, as the order screens add one: each piece its own line at its quantity times the line’s, at its catalog price (a piece also sent as a plain line raises that line’s quantity); the composition line takes no `price`, `note`, `discount` or `fulfillment`, and one whose pieces can’t all be sold is refused, naming them.",
            "items": {
              "properties": {
                "discount": {
                  "description": "The line’s own discount: a percent, or an amount off each unit (up to its price each, 2 decimals). Needs Prices and exceptions (`PRICING_WRITE`); a reason is required unless the store turned that off; a role’s discount limit applies.",
                  "properties": {
                    "reason": {
                      "type": "string"
                    },
                    "type": {
                      "enum": ["percentage", "fixed_amount"],
                      "type": "string"
                    },
                    "value": {
                      "type": "number"
                    }
                  },
                  "type": "object"
                },
                "fulfillment": {
                  "description": "The line’s fulfillment, as `PATCH /quotes/{id}`’s `line_fulfillment` sets it: one part, or two to split the line (their quantities add up to the line’s; one part may leave its quantity out).",
                  "properties": {
                    "parts": {
                      "items": {
                        "properties": {
                          "how": {
                            "description": "Store pickup today, pickup on a later day, or delivery. Made to order is never `pickup`.",
                            "enum": ["pickup", "later", "delivery"],
                            "type": "string"
                          },
                          "location_id": {
                            "description": "Inventory from another store: its Shopify location id (`GET /locations`), one this caller may use. Left out: the quote’s own location.",
                            "nullable": true,
                            "type": "string"
                          },
                          "quantity": {
                            "type": "integer"
                          },
                          "source": {
                            "description": "From stock, or made (or ordered) for this order.",
                            "enum": ["inventory", "made_to_order"],
                            "type": "string"
                          }
                        },
                        "type": "object"
                      },
                      "type": "array"
                    }
                  },
                  "type": "object"
                },
                "note": {
                  "type": "string"
                },
                "options": {
                  "description": "A template line’s option values: `[{ field_id, value }]` or `[{ option, value }]` (the option by its name, as `GET /product-templates/{id}` labels it), 1 to 30, each option once. `value` is text, a number, a dropdown value’s `option_id`, `value` or label (spacing and capitals don’t count), or a size as text such as `96 × 38 × 30`; a text-and-image option takes its text in `value` and its picture in `image_url`. A name two options or values answer to is `409 OPTION_AMBIGUOUS`; an unknown one lists the template’s options and values in the refusal. Required options are checked as in the admin, every missing one in `error.missing`. The server prices the line with them. Not on a Shopify product line.",
                  "items": {
                    "properties": {
                      "field_id": {
                        "type": "string"
                      },
                      "image_file_id": {
                        "description": "The picture’s Shopify file id, the `shopify_file_id` `POST /files` answered. Optional; sent with `image_url`.",
                        "nullable": true,
                        "type": "string"
                      },
                      "image_url": {
                        "description": "A text-and-image option’s or field’s picture: its Shopify Files URL, the `url` `POST /files` answered (another host is refused). Its text is `value`.",
                        "nullable": true,
                        "type": "string"
                      },
                      "option": {
                        "description": "The option’s name (its `label` on `GET /product-templates/{id}`), instead of `field_id`.",
                        "type": "string"
                      },
                      "value": {
                        "type": "string"
                      }
                    },
                    "type": "object"
                  },
                  "type": "array"
                },
                "price": {
                  "description": "The price each, set by hand (from 0, 2 decimals). Optional on a template or Shopify product line; required for a custom item. Needs Prices and exceptions.",
                  "type": "number"
                },
                "quantity": {
                  "description": "1–9999 (default 1).",
                  "type": "integer"
                },
                "shopify_product_id": {
                  "description": "Optional with `shopify_variant_id`: the variant’s own product.",
                  "type": "string"
                },
                "shopify_variant_id": {
                  "description": "A Shopify product’s variant; its product is read with it. A composition’s goes on as its pieces.",
                  "type": "string"
                },
                "sku": {
                  "description": "A custom item’s SKU (optional, with its `title`). Without a `title`: the Shopify product’s variant with this SKU (exact, any case); none is `422 SKU_NOT_FOUND` and several `409 SKU_AMBIGUOUS`, listed in `error.matches`.",
                  "type": "string"
                },
                "template_id": {
                  "type": "string"
                },
                "title": {
                  "description": "A custom item’s name (up to 255 characters), with its `price`.",
                  "type": "string"
                }
              },
              "type": "object"
            },
            "type": "array"
          },
          "location_id": {
            "description": "A Shopify location id from `GET /locations`. Defaults to the first active location.",
            "type": "string"
          },
          "note": {
            "type": "string"
          },
          "payment_terms_due_date": {
            "description": "The day fixed-date terms fall due (`YYYY-MM-DD`), with their `payment_terms_id`.",
            "format": "date",
            "type": "string"
          },
          "payment_terms_id": {
            "description": "A template id from `GET /payment-terms`. Needs the right to set payment terms (a key: Prices and exceptions, `PRICING_WRITE`). Terms with a fixed date need `payment_terms_due_date`.",
            "type": "string"
          },
          "salesperson_ids": {
            "description": "Staff ids credited with the sale (up to 5; the first is the primary and takes the assignment). Other than the create’s own needs Change sales credit (`COMMISSION_WRITE`).",
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "ship_to_address_id": {
            "description": "Deliver to one of the customer’s saved addresses (an `id` from `GET /customers/{id}/addresses`), instead of `shipping_address`.",
            "type": "string"
          },
          "shipping": {
            "description": "Delivery charges `[{ title, price }]` (up to 5), as `PATCH /quotes/{id}` sets them. Needs Prices and exceptions (`PRICING_WRITE`). Not on a quote whose every line is picked up.",
            "items": {
              "properties": {
                "price": {
                  "type": "number"
                },
                "title": {
                  "type": "string"
                }
              },
              "type": "object"
            },
            "type": "array"
          },
          "shipping_address": {
            "properties": {
              "address1": {
                "type": "string"
              },
              "address2": {
                "type": "string"
              },
              "city": {
                "type": "string"
              },
              "company": {
                "type": "string"
              },
              "country": {
                "type": "string"
              },
              "phone": {
                "type": "string"
              },
              "province": {
                "type": "string"
              },
              "zip": {
                "type": "string"
              }
            },
            "type": "object"
          },
          "tags": {
            "description": "The quote’s tags (up to 250, 40 characters each).",
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "tax_mode": {
            "description": "The tax choice, as `PATCH /quotes/{id}` sets it: `default`, `exempt` or `charge`.",
            "enum": ["default", "exempt", "charge"],
            "type": "string"
          },
          "tax_mode_reason": {
            "description": "Why (up to 200 characters): required for `exempt` and `charge` unless the store turned that off.",
            "nullable": true,
            "type": "string"
          }
        },
        "required": ["lines"],
        "type": "object"
      },
      "QuoteDeleted": {
        "properties": {
          "deleted": {
            "type": "boolean"
          },
          "id": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "QuoteDuplicate": {
        "properties": {
          "location_id": {
            "description": "Where the copy is made when the caller can’t use the source’s location (a location-limited key): one of `GET /locations` (`id`). Left out: the source’s location, else the first the caller may use.",
            "type": "string"
          }
        },
        "type": "object"
      },
      "QuoteExpiry": {
        "description": "As `expiry` on `GET /quotes/{id}`.",
        "properties": {
          "expired": {
            "type": "boolean"
          },
          "own_date": {
            "type": "boolean"
          },
          "signed": {
            "type": "boolean"
          },
          "valid_for_days": {
            "type": "integer"
          },
          "valid_until": {
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "QuoteExpiryChange": {
        "properties": {
          "note": {
            "description": "Shown under the activity entry. At most 500 characters.",
            "type": "string"
          },
          "valid_until": {
            "description": "The last day the quote is valid, YYYY-MM-DD in the store’s time zone, at most three years ahead; null puts it back on the store’s default.",
            "nullable": true,
            "type": "string"
          }
        },
        "required": ["valid_until"],
        "type": "object"
      },
      "QuoteExpirySet": {
        "properties": {
          "expiry": {
            "$ref": "#/components/schemas/QuoteExpiry"
          },
          "id": {
            "type": "string"
          },
          "updated_at": {
            "format": "date-time",
            "type": "string"
          }
        },
        "type": "object"
      },
      "QuoteRuleCollections": {
        "properties": {
          "items": {
            "description": "Up to 50, by title.",
            "items": {
              "properties": {
                "id": {
                  "description": "The collection’s GID: what a condition’s `shopify_collection_id` takes.",
                  "type": "string"
                },
                "on_online_store": {
                  "description": "Published to the Online Store; null when Shopify couldn’t say.",
                  "nullable": true,
                  "type": "boolean"
                },
                "title": {
                  "type": "string"
                }
              },
              "required": ["id", "title", "on_online_store"],
              "type": "object"
            },
            "type": "array"
          }
        },
        "required": ["items"],
        "type": "object"
      },
      "QuoteRuleGroup": {
        "properties": {
          "active": {
            "description": "Applied on the storefront.",
            "type": "boolean"
          },
          "conditions": {
            "items": {
              "properties": {
                "effect": {
                  "description": "`include` makes a matching product eligible; `exclude` takes it out.",
                  "enum": ["include", "exclude"],
                  "type": "string"
                },
                "id": {
                  "type": "string"
                },
                "off_online_store": {
                  "description": "A collection the last check found off the Online Store (unpublished from it, or deleted): the storefront isn’t given the rules while an active group has one.",
                  "type": "boolean"
                },
                "shopify_category_id": {
                  "description": "`category`: the Shopify product category’s `id` from `GET /product-categories` (its GID, or the taxonomy id).",
                  "nullable": true,
                  "type": "string"
                },
                "shopify_category_name": {
                  "description": "`category`: its `full_name`, shown on the rule.",
                  "nullable": true,
                  "type": "string"
                },
                "shopify_collection_id": {
                  "description": "`collection`: the collection’s `id` from `GET /settings/quote-rules/collections` (one on the Online Store).",
                  "nullable": true,
                  "type": "string"
                },
                "shopify_collection_title": {
                  "description": "`collection`: its `title`, shown on the rule.",
                  "nullable": true,
                  "type": "string"
                },
                "sort_order": {
                  "description": "Its place in the group (default: the order sent).",
                  "type": "integer"
                },
                "tag": {
                  "description": "`tag`: the product tag (matched in any case).",
                  "nullable": true,
                  "type": "string"
                },
                "type": {
                  "description": "What it matches: a product `tag`, a Shopify product `category` (standard taxonomy, its subcategories too) or a `collection`.",
                  "enum": ["tag", "category", "collection"],
                  "type": "string"
                }
              },
              "required": [
                "id",
                "effect",
                "type",
                "tag",
                "shopify_category_id",
                "shopify_category_name",
                "shopify_collection_id",
                "shopify_collection_title",
                "off_online_store",
                "sort_order"
              ],
              "type": "object"
            },
            "type": "array"
          },
          "conditions_combine": {
            "description": "How a group’s `include` conditions combine: `and` or `or`.",
            "enum": ["and", "or"],
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "sort_order": {
            "type": "integer"
          },
          "updated_at": {
            "format": "date-time",
            "type": "string"
          }
        },
        "required": [
          "id",
          "name",
          "active",
          "conditions_combine",
          "sort_order",
          "conditions",
          "updated_at"
        ],
        "type": "object"
      },
      "QuoteRuleGroupCreate": {
        "properties": {
          "active": {
            "description": "Default true.",
            "type": "boolean"
          },
          "conditions": {
            "description": "The group’s conditions, at least one `include`, up to 50.",
            "items": {
              "properties": {
                "effect": {
                  "description": "`include` makes a matching product eligible; `exclude` takes it out.",
                  "enum": ["include", "exclude"],
                  "type": "string"
                },
                "shopify_category_id": {
                  "description": "`category`: the Shopify product category’s `id` from `GET /product-categories` (its GID, or the taxonomy id).",
                  "nullable": true,
                  "type": "string"
                },
                "shopify_category_name": {
                  "description": "`category`: its `full_name`, shown on the rule.",
                  "nullable": true,
                  "type": "string"
                },
                "shopify_collection_id": {
                  "description": "`collection`: the collection’s `id` from `GET /settings/quote-rules/collections` (one on the Online Store).",
                  "nullable": true,
                  "type": "string"
                },
                "shopify_collection_title": {
                  "description": "`collection`: its `title`, shown on the rule.",
                  "nullable": true,
                  "type": "string"
                },
                "sort_order": {
                  "description": "Its place in the group (default: the order sent).",
                  "type": "integer"
                },
                "tag": {
                  "description": "`tag`: the product tag (matched in any case).",
                  "nullable": true,
                  "type": "string"
                },
                "type": {
                  "description": "What it matches: a product `tag`, a Shopify product `category` (standard taxonomy, its subcategories too) or a `collection`.",
                  "enum": ["tag", "category", "collection"],
                  "type": "string"
                }
              },
              "required": ["effect", "type"],
              "type": "object"
            },
            "type": "array"
          },
          "conditions_combine": {
            "description": "How a group’s `include` conditions combine: `and` or `or`. Default `or`.",
            "enum": ["and", "or"],
            "type": "string"
          },
          "name": {
            "description": "Up to 120 characters.",
            "type": "string"
          },
          "sort_order": {
            "description": "Its place among the groups (default 0).",
            "type": "integer"
          }
        },
        "required": ["name", "conditions"],
        "type": "object"
      },
      "QuoteRuleGroupUpdate": {
        "properties": {
          "active": {
            "type": "boolean"
          },
          "conditions": {
            "description": "The whole list, replacing the saved one: at least one `include`, up to 50.",
            "items": {
              "properties": {
                "effect": {
                  "description": "`include` makes a matching product eligible; `exclude` takes it out.",
                  "enum": ["include", "exclude"],
                  "type": "string"
                },
                "shopify_category_id": {
                  "description": "`category`: the Shopify product category’s `id` from `GET /product-categories` (its GID, or the taxonomy id).",
                  "nullable": true,
                  "type": "string"
                },
                "shopify_category_name": {
                  "description": "`category`: its `full_name`, shown on the rule.",
                  "nullable": true,
                  "type": "string"
                },
                "shopify_collection_id": {
                  "description": "`collection`: the collection’s `id` from `GET /settings/quote-rules/collections` (one on the Online Store).",
                  "nullable": true,
                  "type": "string"
                },
                "shopify_collection_title": {
                  "description": "`collection`: its `title`, shown on the rule.",
                  "nullable": true,
                  "type": "string"
                },
                "sort_order": {
                  "description": "Its place in the group (default: the order sent).",
                  "type": "integer"
                },
                "tag": {
                  "description": "`tag`: the product tag (matched in any case).",
                  "nullable": true,
                  "type": "string"
                },
                "type": {
                  "description": "What it matches: a product `tag`, a Shopify product `category` (standard taxonomy, its subcategories too) or a `collection`.",
                  "enum": ["tag", "category", "collection"],
                  "type": "string"
                }
              },
              "required": ["effect", "type"],
              "type": "object"
            },
            "type": "array"
          },
          "conditions_combine": {
            "description": "How a group’s `include` conditions combine: `and` or `or`.",
            "enum": ["and", "or"],
            "type": "string"
          },
          "name": {
            "description": "Up to 120 characters.",
            "type": "string"
          },
          "sort_order": {
            "description": "Its place among the groups.",
            "type": "integer"
          }
        },
        "type": "object"
      },
      "QuoteRules": {
        "properties": {
          "groups": {
            "description": "Every rule group, in order.",
            "items": {
              "$ref": "#/components/schemas/QuoteRuleGroup"
            },
            "type": "array"
          },
          "groups_combine": {
            "description": "How the active groups combine: `any` (eligible under one of them) or `all` (under every one).",
            "enum": ["any", "all"],
            "type": "string"
          },
          "limits": {
            "properties": {
              "active_groups": {
                "description": "Active groups the storefront takes.",
                "type": "integer"
              },
              "conditions_per_group": {
                "type": "integer"
              },
              "groups": {
                "description": "Rule groups a store can have.",
                "type": "integer"
              }
            },
            "required": ["groups", "active_groups", "conditions_per_group"],
            "type": "object"
          },
          "saved_id": {
            "description": "A group just added: its `id`; null otherwise.",
            "nullable": true,
            "type": "string"
          }
        },
        "required": ["groups_combine", "groups", "limits", "saved_id"],
        "type": "object"
      },
      "QuoteRulesCheckStarted": {
        "properties": {
          "started": {
            "description": "The check is queued; it runs in a few seconds.",
            "type": "boolean"
          }
        },
        "required": ["started"],
        "type": "object"
      },
      "QuoteRulesPolicyUpdate": {
        "properties": {
          "groups_combine": {
            "description": "How the active groups combine: `any` (eligible under one of them) or `all` (under every one).",
            "enum": ["any", "all"],
            "type": "string"
          }
        },
        "required": ["groups_combine"],
        "type": "object"
      },
      "ReadBackPending": {
        "description": "Accepted (`202`): the write is done, but OrderPilot couldn’t read its record back just now. Don’t send it again: read the record with `read`. The write’s `200` or `201` always carries the whole record.",
        "properties": {
          "charge_id": {
            "description": "A purchase order’s charge: its id.",
            "type": "string"
          },
          "content_version": {
            "description": "Tax and shipping: the purchase order’s `content_version` after the change, for its next edit.",
            "type": "integer"
          },
          "done": {
            "description": "What the write did.",
            "enum": [
              "created",
              "updated",
              "deleted",
              "converted",
              "payment_recorded",
              "refunded"
            ],
            "type": "string"
          },
          "id": {
            "description": "The record’s id: the quote’s, order’s, customer’s, vendor’s, category’s or purchase order’s (a purchase order’s lines, charges, tax and shipping and vendor payments are under it). Null only for a customer whose row couldn’t be read: find it by `shopify_id`.",
            "nullable": true,
            "type": "string"
          },
          "message": {
            "description": "For people. It can change at any time.",
            "type": "string"
          },
          "number": {
            "description": "A purchase order: its number.",
            "type": "string"
          },
          "payment_id": {
            "description": "A payment to the vendor: its id.",
            "type": "string"
          },
          "read": {
            "description": "The path of the GET that reads the record, under `/connect/v1` (`/quotes/{id}`).",
            "type": "string"
          },
          "refund": {
            "description": "A refund: each leg made, as the whole answer’s `refund`.",
            "properties": {
              "done": {
                "items": {
                  "properties": {
                    "amount": {
                      "type": "number"
                    },
                    "name": {
                      "type": "string"
                    },
                    "pending": {
                      "type": "boolean"
                    },
                    "recorded": {
                      "type": "boolean"
                    },
                    "row_id": {
                      "type": "string"
                    }
                  },
                  "required": ["row_id", "amount", "name"],
                  "type": "object"
                },
                "type": "array"
              }
            },
            "type": "object"
          },
          "reopened": {
            "description": "A charge added with `reopen: true`: whether the purchase order was reopened (and finalized again) for it.",
            "type": "boolean"
          },
          "shopify_id": {
            "description": "A customer: its Shopify id.",
            "type": "string"
          }
        },
        "required": ["id", "done", "read", "message"],
        "type": "object"
      },
      "RecordActivityEntry": {
        "properties": {
          "action": {
            "description": "What happened, in words (“Vendor updated”).",
            "type": "string"
          },
          "actor": {
            "properties": {
              "name": {
                "description": "A person, “API key: <name>”, or “System”.",
                "type": "string"
              },
              "staff_id": {
                "description": "The staff member, when a person.",
                "nullable": true,
                "type": "string"
              }
            },
            "type": "object"
          },
          "changes": {
            "description": "Each field it changed, as the card lists it.",
            "items": {
              "properties": {
                "after": {
                  "type": "string"
                },
                "before": {
                  "description": "Null for a first value.",
                  "nullable": true,
                  "type": "string"
                },
                "label": {
                  "description": "The field (“Email”, “Unit price — Oak”).",
                  "type": "string"
                },
                "more": {
                  "description": "On the last row only, when the list is cut short: how many more.",
                  "nullable": true,
                  "type": "integer"
                }
              },
              "type": "object"
            },
            "type": "array"
          },
          "comment": {
            "nullable": true,
            "type": "string"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "detail": {
            "description": "More about it, in words, when there is any.",
            "nullable": true,
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "is_creation": {
            "description": "The entry that created the record (its changes are its first values).",
            "type": "boolean"
          },
          "kind": {
            "description": "`comment`: a comment someone added. `event`: a change or a notice.",
            "enum": ["event", "comment"],
            "type": "string"
          },
          "restorable": {
            "description": "For an entry with a `version`: whether the record can be restored to it (the newest is the record as it is). Null otherwise.",
            "nullable": true,
            "type": "boolean"
          },
          "restore_blocked_reason": {
            "description": "Why it can’t be restored to, when `restorable` is false.",
            "nullable": true,
            "type": "string"
          },
          "restored_from_version": {
            "description": "The version this entry restored the record to, when it was a restore.",
            "nullable": true,
            "type": "integer"
          },
          "version": {
            "description": "The version of the record this entry produced, when it did: what `revision` takes to restore it.",
            "nullable": true,
            "type": "integer"
          }
        },
        "type": "object"
      },
      "RecordActivityList": {
        "properties": {
          "costs_hidden": {
            "description": "Why cost changes are left out (this caller can’t see costs), or null.",
            "nullable": true,
            "type": "string"
          },
          "items": {
            "items": {
              "$ref": "#/components/schemas/RecordActivityEntry"
            },
            "type": "array"
          },
          "next_cursor": {
            "nullable": true,
            "type": "string"
          },
          "record_type": {
            "enum": [
              "purchase_order",
              "product_template",
              "option",
              "category",
              "vendor",
              "brand",
              "location"
            ],
            "type": "string"
          }
        },
        "type": "object"
      },
      "RecordCommentCreate": {
        "properties": {
          "record_id": {
            "description": "The record’s id, from its own list (the purchase orders, product templates, options, categories, vendors or brands); a location’s is its Shopify location id, as the locations list gives it (`gid://shopify/Location/123`, or `123`).",
            "type": "string"
          },
          "record_type": {
            "description": "Which kind of record: `purchase_order`, `product_template`, `option`, `category`, `vendor`, `brand` or `location`.",
            "enum": [
              "purchase_order",
              "product_template",
              "option",
              "category",
              "vendor",
              "brand",
              "location"
            ],
            "type": "string"
          },
          "text": {
            "description": "The comment, 1–2000 characters.",
            "type": "string"
          }
        },
        "required": ["record_type", "record_id", "text"],
        "type": "object"
      },
      "RecordRestoreInput": {
        "properties": {
          "record_id": {
            "description": "The record’s id, from its own list (the purchase orders, product templates, options, categories, vendors or brands); a location’s is its Shopify location id, as the locations list gives it (`gid://shopify/Location/123`, or `123`).",
            "type": "string"
          },
          "record_type": {
            "description": "Which kind of record: `purchase_order`, `product_template`, `option`, `category`, `vendor`, `brand` or `location`.",
            "enum": [
              "purchase_order",
              "product_template",
              "option",
              "category",
              "vendor",
              "brand",
              "location"
            ],
            "type": "string"
          },
          "revision": {
            "description": "The version to go back to, as previewed (an entry’s `version`), with `token`, when you don’t send `version`.",
            "type": "integer"
          },
          "token": {
            "description": "The preview’s `token` for that `revision`.",
            "type": "string"
          },
          "version": {
            "description": "The restore preview’s `version`, sent back as it is: it holds the version to go back to and the preview’s token. A change made since is `409 CONFLICT` with the preview’s `version` now and what `changed`. Send this, or `revision` and `token`.",
            "type": "string"
          }
        },
        "required": ["record_type", "record_id"],
        "type": "object"
      },
      "RefundCreate": {
        "description": "Send `legs`, or `amount` when the order has one refundable payment method.",
        "properties": {
          "amount": {
            "description": "What to refund on the order’s one refundable method: above 0, at most 2 decimals, no more than what was paid and not yet refunded.",
            "type": "number"
          },
          "legs": {
            "description": "One to four entries, one per payment method to refund to, each a different row.",
            "items": {
              "properties": {
                "amount": {
                  "description": "Above 0, at most 2 decimals, no more than that row’s `maximum`.",
                  "type": "number"
                },
                "row_id": {
                  "description": "A `row_id` from `GET /orders/{id}/refund-options`, the Store credit row’s included.",
                  "type": "string"
                }
              },
              "required": ["row_id", "amount"],
              "type": "object"
            },
            "type": "array"
          }
        },
        "type": "object"
      },
      "RefundOptions": {
        "properties": {
          "maximum": {
            "description": "The most all rows together can still refund.",
            "type": "number"
          },
          "paid_left": {
            "description": "Paid and not yet refunded.",
            "type": "number"
          },
          "rows": {
            "items": {
              "properties": {
                "blocked_reason": {
                  "description": "Why this row can’t take a refund now, with what to do (the order has no customer, the store hasn’t turned on new customer accounts, the order is in another currency than the store’s). Null when it can.",
                  "nullable": true,
                  "type": "string"
                },
                "deposit": {
                  "type": "boolean"
                },
                "gateway": {
                  "nullable": true,
                  "type": "string"
                },
                "maximum": {
                  "description": "The most this row can still refund.",
                  "type": "number"
                },
                "name": {
                  "description": "The payment as the order shows it.",
                  "type": "string"
                },
                "payment_request": {
                  "type": "boolean"
                },
                "recorded": {
                  "description": "Whether the app already holds this payment as a row.",
                  "type": "boolean"
                },
                "row_id": {
                  "description": "What a refund’s `legs[].row_id` takes.",
                  "type": "string"
                },
                "store_credit": {
                  "description": "The Store credit row: the refund goes to the customer’s Shopify store credit, not back to a payment. It is never picked for a refund sent as `amount`.",
                  "type": "boolean"
                }
              },
              "type": "object"
            },
            "type": "array"
          },
          "store_credit": {
            "description": "Whether part of the payment was store credit.",
            "type": "boolean"
          },
          "unreadable": {
            "description": "Payments Shopify wouldn’t let the app read.",
            "type": "integer"
          }
        },
        "type": "object"
      },
      "ResaleCertificateFromUrl": {
        "properties": {
          "expires_on": {
            "description": "The certificate’s last day, `YYYY-MM-DD`, or null for none. Left out: a replaced certificate’s expiry stays, a new one has none.",
            "nullable": true,
            "type": "string"
          },
          "file_name": {
            "description": "The name to keep it under (up to 255 characters; its extension becomes the one its bytes are). Default: the address’s last part.",
            "nullable": true,
            "type": "string"
          },
          "state": {
            "description": "The US state’s two-letter code, such as `CA`.",
            "type": "string"
          },
          "url": {
            "description": "Where the certificate is: a public https address (up to 2,048 characters). A key fetches at most 50 files from web addresses a day, each counted before it is fetched (`403 CAP_EXCEEDED`, `reason` `daily_url_fetches`).",
            "type": "string"
          }
        },
        "required": ["url", "state"],
        "type": "object"
      },
      "ReturnAmounts": {
        "properties": {
          "currency": {
            "nullable": true,
            "type": "string"
          },
          "fees_total": {
            "description": "The restocking fee the store keeps.",
            "type": "number"
          },
          "items_total": {
            "description": "What Shopify takes off for the returned units, tax included.",
            "type": "number"
          },
          "owed": {
            "description": "What the customer is owed back: `items_total` less `fees_total`, never below 0.",
            "type": "number"
          }
        },
        "type": "object"
      },
      "ReturnCreate": {
        "properties": {
          "lines": {
            "description": "The items to return, each an order line once (at most 50). Required unless `shopify_return_id` is sent.",
            "items": {
              "properties": {
                "line_id": {
                  "description": "A `lines[].line_id` from `GET /orders/{id}/return-options`.",
                  "type": "string"
                },
                "quantity": {
                  "description": "Units to return: 1 to that line’s `returnable`.",
                  "type": "integer"
                },
                "reason_id": {
                  "description": "One of that line’s `reasons[].id`. A reason with `note_required` needs `note` (the return’s); left out, Shopify records none.",
                  "type": "string"
                }
              },
              "required": ["line_id", "quantity"],
              "type": "object"
            },
            "type": "array"
          },
          "note": {
            "description": "Up to 255 characters, on the Shopify return. Needed with a reason that has `note_required`.",
            "type": "string"
          },
          "refund": {
            "description": "What happens to the money after the return: `legs`, or `amount` on an order with one refundable payment method, or `later: true` to refund afterwards (`POST /orders/{id}/refunds`). Exactly one.",
            "properties": {
              "amount": {
                "description": "What to refund on the order’s one refundable method: above 0, at most 2 decimals.",
                "type": "number"
              },
              "later": {
                "description": "`true`: the return only; the money goes back later, or not at all.",
                "type": "boolean"
              },
              "legs": {
                "description": "One to four entries, one per payment method, each a different row.",
                "items": {
                  "properties": {
                    "amount": {
                      "description": "Above 0, at most 2 decimals, no more than that row’s `maximum`.",
                      "type": "number"
                    },
                    "row_id": {
                      "description": "A `row_id` from `GET /orders/{id}/refund-options`, the Store credit row’s included.",
                      "type": "string"
                    }
                  },
                  "required": ["row_id", "amount"],
                  "type": "object"
                },
                "type": "array"
              }
            },
            "type": "object"
          },
          "restock": {
            "description": "Put the units back into stock where they shipped from (default true); false keeps them out of stock.",
            "type": "boolean"
          },
          "restocking_fee_percent": {
            "description": "A restocking fee the store keeps, as a percentage of the returned items: 0 to 100, at most 2 decimals (default 0).",
            "type": "number"
          },
          "shopify_return_id": {
            "description": "Process a return opened in Shopify instead (`open_returns[].shopify_return_id` of `GET /orders/{id}/return-options`); send no `lines`.",
            "type": "string"
          }
        },
        "required": ["refund"],
        "type": "object"
      },
      "ReturnMade": {
        "properties": {
          "order": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Order"
              }
            ],
            "description": "The order after the return and refund; null when it couldn’t be read back.",
            "nullable": true
          },
          "refund": {
            "description": "The refund made after the return; null with `refund.later`.",
            "nullable": true,
            "properties": {
              "done": {
                "items": {
                  "properties": {
                    "amount": {
                      "description": "What Shopify refunded to this payment method.",
                      "type": "number"
                    },
                    "name": {
                      "description": "The payment method as the order shows it.",
                      "type": "string"
                    },
                    "pending": {
                      "description": "Shopify took the refund but the payment provider hasn’t confirmed it yet.",
                      "type": "boolean"
                    },
                    "recorded": {
                      "description": "A payment recorded by hand: the refund is recorded in Shopify, and the money goes back outside it.",
                      "type": "boolean"
                    },
                    "row_id": {
                      "type": "string"
                    }
                  },
                  "type": "object"
                },
                "type": "array"
              }
            },
            "type": "object"
          },
          "return": {
            "description": "The Shopify return, processed.",
            "properties": {
              "name": {
                "description": "Shopify’s name for it (`#1001-R1`).",
                "nullable": true,
                "type": "string"
              },
              "owed": {
                "description": "What the customer is owed back after it: paid and not refunded, less the order’s new total (before this call’s refund).",
                "type": "number"
              },
              "restocked": {
                "description": "Its units went back into stock.",
                "type": "boolean"
              },
              "shopify_return_id": {
                "type": "string"
              }
            },
            "type": "object"
          }
        },
        "type": "object"
      },
      "ReturnOptions": {
        "properties": {
          "blocked_reason": {
            "description": "Why items can’t be returned here now (not placed in Shopify yet, OrderPilot lacks Shopify’s returns permission, still syncing, a paid deposit order, another currency than the shop’s), with what to do; null when they can. While it is set the lists are empty.",
            "nullable": true,
            "type": "string"
          },
          "currency": {
            "nullable": true,
            "type": "string"
          },
          "lines": {
            "items": {
              "properties": {
                "line_id": {
                  "description": "What a return’s `lines[].line_id` takes.",
                  "type": "string"
                },
                "locations": {
                  "description": "Where its units shipped from, where they go back to.",
                  "items": {
                    "type": "string"
                  },
                  "type": "array"
                },
                "prices": {
                  "description": "What returning 1, 2, … units comes to, from one Shopify calculation (at most 100 entries); null when Shopify didn’t price it (ask for a preview).",
                  "items": {
                    "properties": {
                      "subtotal": {
                        "description": "What a restocking fee is a percentage of.",
                        "type": "number"
                      },
                      "total": {
                        "description": "What Shopify takes off, tax included.",
                        "type": "number"
                      },
                      "units": {
                        "type": "integer"
                      }
                    },
                    "type": "object"
                  },
                  "nullable": true,
                  "type": "array"
                },
                "reasons": {
                  "description": "Shopify’s return reasons for this line, in Shopify’s order.",
                  "items": {
                    "properties": {
                      "id": {
                        "description": "What a return’s `lines[].reason_id` takes.",
                        "type": "string"
                      },
                      "name": {
                        "type": "string"
                      },
                      "note_required": {
                        "description": "Shopify refuses this reason without the return’s `note`.",
                        "type": "boolean"
                      }
                    },
                    "type": "object"
                  },
                  "type": "array"
                },
                "restockable": {
                  "description": "Shopify can put its units back into stock (it tracks the item).",
                  "type": "boolean"
                },
                "returnable": {
                  "description": "Units that can still come back (fulfilled and not returned yet).",
                  "type": "integer"
                },
                "title": {
                  "type": "string"
                }
              },
              "type": "object"
            },
            "type": "array"
          },
          "open_returns": {
            "description": "Returns opened in Shopify that wait to be processed: a return’s `shopify_return_id` processes one.",
            "items": {
              "properties": {
                "name": {
                  "nullable": true,
                  "type": "string"
                },
                "requested": {
                  "description": "The customer asked for it and it isn’t approved yet: approve it in Shopify before it can be processed.",
                  "type": "boolean"
                },
                "shopify_return_id": {
                  "type": "string"
                }
              },
              "type": "object"
            },
            "type": "array"
          },
          "restock_location": {
            "description": "Where returned units go back into stock (the first line’s).",
            "nullable": true,
            "type": "string"
          },
          "taxes_included": {
            "description": "Prices on the order include tax.",
            "type": "boolean"
          }
        },
        "type": "object"
      },
      "ReturnPreview": {
        "properties": {
          "lines": {
            "description": "The items to return, each an order line once (at most 50).",
            "items": {
              "properties": {
                "line_id": {
                  "description": "A `lines[].line_id` from `GET /orders/{id}/return-options`.",
                  "type": "string"
                },
                "quantity": {
                  "description": "Units to return: 1 to that line’s `returnable`.",
                  "type": "integer"
                },
                "reason_id": {
                  "description": "One of that line’s `reasons[].id`. A reason with `note_required` needs `note` (the return’s); left out, Shopify records none.",
                  "type": "string"
                }
              },
              "required": ["line_id", "quantity"],
              "type": "object"
            },
            "type": "array"
          },
          "restocking_fee_percent": {
            "description": "A restocking fee the store keeps, as a percentage of the returned items: 0 to 100, at most 2 decimals (default 0).",
            "type": "number"
          }
        },
        "required": ["lines"],
        "type": "object"
      },
      "ReviewDecided": {
        "properties": {
          "decision": {
            "enum": ["approve", "reject", "request_changes"],
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "kind": {
            "description": "What the record is now (a signed quote approved with payment due later is placed as an order).",
            "enum": ["quote", "order"],
            "type": "string"
          },
          "message": {
            "type": "string"
          },
          "status_id": {
            "description": "Its status now (`GET /statuses` names it).",
            "nullable": true,
            "type": "string"
          },
          "unchanged": {
            "description": "True when the record already had this decision and note: nothing was done.",
            "type": "boolean"
          },
          "version": {
            "description": "The record’s `version` after the decision: what its next change sends back. Null when it couldn’t be read just now (the decision stands).",
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "ReviewDecision": {
        "properties": {
          "decision": {
            "description": "`approve` keeps the record its kind (a quote a Quote, an order an Order); `reject` and `request_changes` use its kind’s Rejected and Changes Requested statuses.",
            "enum": ["approve", "reject", "request_changes"],
            "type": "string"
          },
          "expected_updated_at": {
            "description": "The record’s `updated_at` as you last read it (its own read), when you don’t send `version`: a record changed since is refused.",
            "format": "date-time",
            "type": "string"
          },
          "note": {
            "description": "The reviewer’s feedback (up to 2,000 characters): kept on the record and written to its activity. Usually sent with `reject` and `request_changes`.",
            "type": "string"
          },
          "version": {
            "description": "The record’s `version` as the last answer about it gave it (its read, a list row or your last change), sent back as it is. A record changed since is refused with the current `version`. Send this or `expected_updated_at`.",
            "type": "string"
          }
        },
        "required": ["decision"],
        "type": "object"
      },
      "Role": {
        "properties": {
          "change_scope": {
            "description": "Which quotes and orders it changes (never more than it sees).",
            "enum": ["assigned", "locations", "shop"],
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "max_discount_percent": {
            "description": "The largest discount it may give, a percentage; null for no limit.",
            "nullable": true,
            "type": "number"
          },
          "name": {
            "type": "string"
          },
          "permissions": {
            "description": "The permission ids it holds, lowercase (as `GET /me` names them).",
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "purchase_order_scope": {
            "description": "Which purchase orders it reaches.",
            "enum": ["locations", "shop"],
            "type": "string"
          },
          "see_scope": {
            "description": "Which quotes and orders it sees.",
            "enum": ["assigned", "locations", "shop"],
            "type": "string"
          },
          "staff_ids": {
            "description": "Who has it.",
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "starter": {
            "description": "One of the roles every store starts with (it can still be edited).",
            "type": "boolean"
          },
          "store_administrator": {
            "description": "The Store administrator: it holds every permission, whatever is sent.",
            "type": "boolean"
          },
          "updated_at": {
            "format": "date-time",
            "type": "string"
          },
          "updated_by_name": {
            "nullable": true,
            "type": "string"
          },
          "use_admin": {
            "description": "It opens OrderPilot in the Shopify admin.",
            "type": "boolean"
          },
          "use_pos": {
            "description": "It opens OrderPilot on Shopify POS.",
            "type": "boolean"
          }
        },
        "required": [
          "id",
          "name",
          "description",
          "store_administrator",
          "permissions",
          "see_scope",
          "change_scope",
          "purchase_order_scope",
          "use_admin",
          "use_pos",
          "max_discount_percent",
          "staff_ids"
        ],
        "type": "object"
      },
      "RoleCreate": {
        "properties": {
          "change_scope": {
            "description": "Which it changes; narrowed to `see_scope` when wider.",
            "enum": ["assigned", "locations", "shop"],
            "type": "string"
          },
          "description": {
            "description": "At most 300 characters.",
            "type": "string"
          },
          "max_discount_percent": {
            "description": "The largest discount it may give, 0 to 100; null for no limit.",
            "nullable": true,
            "type": "number"
          },
          "name": {
            "description": "At most 60 characters; no other role may have it.",
            "type": "string"
          },
          "permissions": {
            "description": "Permission ids, any casing (`orders_view`). What a permission needs comes with it. Unknown ids are refused.",
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "purchase_order_scope": {
            "enum": ["locations", "shop"],
            "type": "string"
          },
          "see_scope": {
            "description": "Which quotes and orders it sees. New roles default to `locations`.",
            "enum": ["assigned", "locations", "shop"],
            "type": "string"
          },
          "use_admin": {
            "description": "Opens OrderPilot in the Shopify admin. A new role defaults to what the caller has.",
            "type": "boolean"
          },
          "use_pos": {
            "description": "Opens OrderPilot on Shopify POS. A new role defaults to what the caller has.",
            "type": "boolean"
          }
        },
        "required": ["name"],
        "type": "object"
      },
      "RoleDeleted": {
        "properties": {
          "deleted": {
            "type": "boolean"
          },
          "id": {
            "type": "string"
          }
        },
        "required": ["id", "deleted"],
        "type": "object"
      },
      "RoleEdit": {
        "properties": {
          "change_scope": {
            "description": "Which it changes; narrowed to `see_scope` when wider.",
            "enum": ["assigned", "locations", "shop"],
            "type": "string"
          },
          "description": {
            "description": "At most 300 characters.",
            "type": "string"
          },
          "max_discount_percent": {
            "description": "The largest discount it may give, 0 to 100; null for no limit.",
            "nullable": true,
            "type": "number"
          },
          "name": {
            "description": "At most 60 characters; no other role may have it.",
            "type": "string"
          },
          "permissions": {
            "description": "Permission ids, any casing (`orders_view`). What a permission needs comes with it. Unknown ids are refused.",
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "purchase_order_scope": {
            "enum": ["locations", "shop"],
            "type": "string"
          },
          "see_scope": {
            "description": "Which quotes and orders it sees. New roles default to `locations`.",
            "enum": ["assigned", "locations", "shop"],
            "type": "string"
          },
          "use_admin": {
            "description": "Opens OrderPilot in the Shopify admin. A new role defaults to what the caller has.",
            "type": "boolean"
          },
          "use_pos": {
            "description": "Opens OrderPilot on Shopify POS. A new role defaults to what the caller has.",
            "type": "boolean"
          }
        },
        "type": "object"
      },
      "RoleList": {
        "properties": {
          "items": {
            "items": {
              "properties": {
                "change_scope": {
                  "description": "Which quotes and orders it changes (never more than it sees).",
                  "enum": ["assigned", "locations", "shop"],
                  "type": "string"
                },
                "description": {
                  "type": "string"
                },
                "id": {
                  "type": "string"
                },
                "max_discount_percent": {
                  "description": "The largest discount it may give, a percentage; null for no limit.",
                  "nullable": true,
                  "type": "number"
                },
                "name": {
                  "type": "string"
                },
                "permissions": {
                  "description": "The permission ids it holds, lowercase (as `GET /me` names them).",
                  "items": {
                    "type": "string"
                  },
                  "type": "array"
                },
                "purchase_order_scope": {
                  "description": "Which purchase orders it reaches.",
                  "enum": ["locations", "shop"],
                  "type": "string"
                },
                "see_scope": {
                  "description": "Which quotes and orders it sees.",
                  "enum": ["assigned", "locations", "shop"],
                  "type": "string"
                },
                "staff_ids": {
                  "description": "Who has it.",
                  "items": {
                    "type": "string"
                  },
                  "type": "array"
                },
                "starter": {
                  "description": "One of the roles every store starts with (it can still be edited).",
                  "type": "boolean"
                },
                "store_administrator": {
                  "description": "The Store administrator: it holds every permission, whatever is sent.",
                  "type": "boolean"
                },
                "updated_at": {
                  "format": "date-time",
                  "type": "string"
                },
                "updated_by_name": {
                  "nullable": true,
                  "type": "string"
                },
                "use_admin": {
                  "description": "It opens OrderPilot in the Shopify admin.",
                  "type": "boolean"
                },
                "use_pos": {
                  "description": "It opens OrderPilot on Shopify POS.",
                  "type": "boolean"
                }
              },
              "required": [
                "id",
                "name",
                "description",
                "store_administrator",
                "permissions",
                "see_scope",
                "change_scope",
                "purchase_order_scope",
                "use_admin",
                "use_pos",
                "max_discount_percent",
                "staff_ids"
              ],
              "type": "object"
            },
            "type": "array"
          },
          "people_without_a_role": {
            "properties": {
              "role_id": {
                "description": "The role people without one get, at every location (Access rules); null: they get no access.",
                "nullable": true,
                "type": "string"
              }
            },
            "required": ["role_id"],
            "type": "object"
          }
        },
        "required": ["items", "people_without_a_role"],
        "type": "object"
      },
      "SalesCreditCodeAssign": {
        "properties": {
          "code_id": {
            "description": "A `GET /sales-credit/codes` id; null takes the code off. Required: a missing key is refused.",
            "nullable": true,
            "type": "string"
          },
          "id": {
            "description": "The template’s, category’s or vendor’s id.",
            "type": "string"
          },
          "target": {
            "enum": ["template", "category", "vendor"],
            "type": "string"
          }
        },
        "required": ["target", "id", "code_id"],
        "type": "object"
      },
      "SalesCreditCodes": {
        "properties": {
          "items": {
            "items": {
              "properties": {
                "description": {
                  "nullable": true,
                  "type": "string"
                },
                "id": {
                  "type": "string"
                },
                "name": {
                  "type": "string"
                },
                "rate_percent": {
                  "description": "A percentage, two decimals. Null for a viewer who may not see rates.",
                  "nullable": true,
                  "type": "number"
                },
                "usage": {
                  "description": "Only in the answer to a save: how many templates, categories, vendors and order lines carry the code.",
                  "properties": {
                    "categories": {
                      "type": "integer"
                    },
                    "lines": {
                      "type": "integer"
                    },
                    "templates": {
                      "type": "integer"
                    },
                    "vendors": {
                      "type": "integer"
                    }
                  },
                  "required": ["templates", "categories", "vendors", "lines"],
                  "type": "object"
                }
              },
              "required": ["id", "name", "description", "rate_percent"],
              "type": "object"
            },
            "type": "array"
          }
        },
        "required": ["items"],
        "type": "object"
      },
      "SalesCreditCodesBatch": {
        "properties": {
          "changes": {
            "description": "Up to 100 of each `op`, applied together. A deleted code leaves the items that carried it blank; earned commission keeps what it earned with.",
            "items": {
              "properties": {
                "description": {
                  "description": "Up to 80 characters.",
                  "nullable": true,
                  "type": "string"
                },
                "id": {
                  "description": "The code’s id: needed for update and delete.",
                  "type": "string"
                },
                "name": {
                  "description": "The code, up to 40 characters. Needed for create and update.",
                  "type": "string"
                },
                "op": {
                  "description": "Any casing is accepted.",
                  "enum": ["create", "update", "delete"],
                  "type": "string"
                },
                "rate_percent": {
                  "description": "0 to 100, up to two decimals. Needed for create and update. Decimal text (\"8.00\") is accepted too.",
                  "type": "number"
                }
              },
              "required": ["op"],
              "type": "object"
            },
            "type": "array"
          }
        },
        "required": ["changes"],
        "type": "object"
      },
      "SalesCreditLines": {
        "properties": {
          "credited_hidden": {
            "description": "True when credited figures are null because they would reveal cost (a gross-profit store, a viewer without “View costs”).",
            "type": "boolean"
          },
          "items": {
            "items": {
              "properties": {
                "code_name": {
                  "nullable": true,
                  "type": "string"
                },
                "commission": {
                  "description": "An amount in the row’s currency, two decimals.",
                  "type": "number"
                },
                "credited": {
                  "description": "An amount, two decimals. Null when `credited_hidden` is true.",
                  "nullable": true,
                  "type": "number"
                },
                "credited_refund": {
                  "description": "An amount, two decimals. Null when `credited_hidden` is true.",
                  "nullable": true,
                  "type": "number"
                },
                "earned": {
                  "description": "An amount in the row’s currency, two decimals.",
                  "type": "number"
                },
                "line_item_id": {
                  "type": "string"
                },
                "net": {
                  "description": "An amount, two decimals. Null when `credited_hidden` is true.",
                  "nullable": true,
                  "type": "number"
                },
                "quantity": {
                  "type": "integer"
                },
                "rate_percent": {
                  "description": "A percentage, two decimals.",
                  "nullable": true,
                  "type": "number"
                },
                "rate_source": {
                  "description": "Where the rate came from: the line, its commission code, the person, or none.",
                  "enum": ["line", "code", "staff", "none"],
                  "type": "string"
                },
                "refund": {
                  "description": "An amount in the row’s currency, two decimals.",
                  "type": "number"
                },
                "share_percent": {
                  "description": "A percentage, two decimals.",
                  "type": "number"
                },
                "title": {
                  "type": "string"
                }
              },
              "required": [
                "line_item_id",
                "title",
                "quantity",
                "net",
                "share_percent",
                "rate_source",
                "commission",
                "refund",
                "earned"
              ],
              "type": "object"
            },
            "type": "array"
          }
        },
        "required": ["items", "credited_hidden"],
        "type": "object"
      },
      "SalesCreditOrders": {
        "properties": {
          "credited_hidden": {
            "description": "True when credited figures are null because they would reveal cost (a gross-profit store, a viewer without “View costs”).",
            "type": "boolean"
          },
          "items": {
            "items": {
              "properties": {
                "commission": {
                  "description": "An amount in the row’s currency, two decimals.",
                  "type": "number"
                },
                "credited": {
                  "description": "An amount, two decimals. Null when `credited_hidden` is true.",
                  "nullable": true,
                  "type": "number"
                },
                "credited_net": {
                  "description": "An amount, two decimals. Null when `credited_hidden` is true.",
                  "nullable": true,
                  "type": "number"
                },
                "credited_refund": {
                  "description": "An amount, two decimals. Null when `credited_hidden` is true.",
                  "nullable": true,
                  "type": "number"
                },
                "currency": {
                  "type": "string"
                },
                "customer": {
                  "nullable": true,
                  "type": "string"
                },
                "customer_id": {
                  "nullable": true,
                  "type": "string"
                },
                "earned": {
                  "description": "An amount in the row’s currency, two decimals.",
                  "type": "number"
                },
                "earned_at": {
                  "format": "date-time",
                  "nullable": true,
                  "type": "string"
                },
                "fully_refunded": {
                  "type": "boolean"
                },
                "is_quote": {
                  "type": "boolean"
                },
                "number": {
                  "type": "string"
                },
                "order_id": {
                  "type": "string"
                },
                "people": {
                  "items": {
                    "properties": {
                      "name": {
                        "type": "string"
                      },
                      "share_percent": {
                        "description": "A percentage, two decimals.",
                        "nullable": true,
                        "type": "number"
                      },
                      "staff_id": {
                        "type": "string"
                      }
                    },
                    "required": ["staff_id", "name", "share_percent"],
                    "type": "object"
                  },
                  "type": "array"
                },
                "refund": {
                  "description": "An amount in the row’s currency, two decimals.",
                  "type": "number"
                },
                "share_percent": {
                  "description": "A percentage, two decimals.",
                  "nullable": true,
                  "type": "number"
                }
              },
              "required": [
                "order_id",
                "number",
                "is_quote",
                "earned_at",
                "currency",
                "commission",
                "refund",
                "earned",
                "fully_refunded",
                "people"
              ],
              "type": "object"
            },
            "type": "array"
          },
          "next_cursor": {
            "nullable": true,
            "type": "string"
          },
          "total": {
            "type": "integer"
          }
        },
        "required": ["items", "total", "next_cursor", "credited_hidden"],
        "type": "object"
      },
      "SalesCreditReport": {
        "properties": {
          "credited_hidden": {
            "description": "True when credited figures are null because they would reveal cost (a gross-profit store, a viewer without “View costs”).",
            "type": "boolean"
          },
          "from": {
            "format": "date-time",
            "type": "string"
          },
          "items": {
            "items": {
              "description": "One row of the report. The fields that belong to another `by` are null.",
              "properties": {
                "category_name": {
                  "nullable": true,
                  "type": "string"
                },
                "category_parent": {
                  "nullable": true,
                  "type": "string"
                },
                "code_name": {
                  "nullable": true,
                  "type": "string"
                },
                "code_rate_percent": {
                  "description": "A percentage, two decimals.",
                  "nullable": true,
                  "type": "number"
                },
                "commission": {
                  "description": "An amount in the row’s currency, two decimals.",
                  "type": "number"
                },
                "credited": {
                  "description": "An amount, two decimals. Null when `credited_hidden` is true.",
                  "nullable": true,
                  "type": "number"
                },
                "credited_net": {
                  "description": "An amount, two decimals. Null when `credited_hidden` is true.",
                  "nullable": true,
                  "type": "number"
                },
                "credited_refund": {
                  "description": "An amount, two decimals. Null when `credited_hidden` is true.",
                  "nullable": true,
                  "type": "number"
                },
                "currency": {
                  "type": "string"
                },
                "customer": {
                  "nullable": true,
                  "type": "string"
                },
                "customer_id": {
                  "nullable": true,
                  "type": "string"
                },
                "date": {
                  "format": "date-time",
                  "nullable": true,
                  "type": "string"
                },
                "earned": {
                  "description": "An amount in the row’s currency, two decimals.",
                  "type": "number"
                },
                "email": {
                  "nullable": true,
                  "type": "string"
                },
                "image": {
                  "nullable": true,
                  "type": "string"
                },
                "is_quote": {
                  "type": "boolean"
                },
                "key": {
                  "description": "A staff id, an order id, a product key or a category id.",
                  "type": "string"
                },
                "label": {
                  "type": "string"
                },
                "orders": {
                  "type": "integer"
                },
                "people": {
                  "type": "integer"
                },
                "pipeline_commission": {
                  "description": "An amount in the row’s currency, two decimals.",
                  "type": "number"
                },
                "pipeline_credited": {
                  "description": "An amount, two decimals. Null when `credited_hidden` is true.",
                  "nullable": true,
                  "type": "number"
                },
                "pipeline_records": {
                  "type": "integer"
                },
                "products": {
                  "type": "integer"
                },
                "rate_percent": {
                  "description": "A salesperson’s rate today.",
                  "nullable": true,
                  "type": "number"
                },
                "refund": {
                  "description": "An amount in the row’s currency, two decimals.",
                  "type": "number"
                },
                "role_name": {
                  "nullable": true,
                  "type": "string"
                },
                "units": {
                  "type": "integer"
                }
              },
              "required": [
                "key",
                "label",
                "currency",
                "credited",
                "credited_refund",
                "credited_net",
                "commission",
                "refund",
                "earned",
                "orders",
                "people",
                "units",
                "pipeline_credited",
                "pipeline_commission",
                "pipeline_records"
              ],
              "type": "object"
            },
            "type": "array"
          },
          "matches": {
            "description": "Rows matching the search, over every page.",
            "type": "integer"
          },
          "next_cursor": {
            "nullable": true,
            "type": "string"
          },
          "to": {
            "format": "date-time",
            "type": "string"
          },
          "totals": {
            "description": "The “All” row, one per currency, whatever the search.",
            "items": {
              "properties": {
                "commission": {
                  "description": "An amount in the row’s currency, two decimals.",
                  "type": "number"
                },
                "credited": {
                  "description": "An amount, two decimals. Null when `credited_hidden` is true.",
                  "nullable": true,
                  "type": "number"
                },
                "credited_net": {
                  "description": "An amount, two decimals. Null when `credited_hidden` is true.",
                  "nullable": true,
                  "type": "number"
                },
                "credited_refund": {
                  "description": "An amount, two decimals. Null when `credited_hidden` is true.",
                  "nullable": true,
                  "type": "number"
                },
                "currency": {
                  "type": "string"
                },
                "earned": {
                  "description": "An amount in the row’s currency, two decimals.",
                  "type": "number"
                },
                "groups": {
                  "type": "integer"
                },
                "orders": {
                  "type": "integer"
                },
                "people": {
                  "type": "integer"
                },
                "pipeline_commission": {
                  "description": "An amount in the row’s currency, two decimals.",
                  "type": "number"
                },
                "pipeline_credited": {
                  "description": "An amount, two decimals. Null when `credited_hidden` is true.",
                  "nullable": true,
                  "type": "number"
                },
                "pipeline_records": {
                  "type": "integer"
                },
                "refund": {
                  "description": "An amount in the row’s currency, two decimals.",
                  "type": "number"
                },
                "units": {
                  "type": "integer"
                }
              },
              "required": [
                "groups",
                "currency",
                "credited",
                "credited_refund",
                "credited_net",
                "commission",
                "refund",
                "earned",
                "orders",
                "people",
                "units",
                "pipeline_credited",
                "pipeline_commission",
                "pipeline_records"
              ],
              "type": "object"
            },
            "type": "array"
          }
        },
        "required": [
          "items",
          "totals",
          "matches",
          "next_cursor",
          "credited_hidden",
          "from",
          "to"
        ],
        "type": "object"
      },
      "SalesPeoplePage": {
        "properties": {
          "items": {
            "items": {
              "properties": {
                "average_order": {
                  "description": "Two decimals.",
                  "nullable": true,
                  "type": "number"
                },
                "conversion_percent": {
                  "description": "A percentage to one place or two; null when there is nothing to divide by.",
                  "nullable": true,
                  "type": "number"
                },
                "converted": {
                  "type": "integer"
                },
                "name": {
                  "type": "string"
                },
                "orders": {
                  "type": "integer"
                },
                "quotes": {
                  "type": "integer"
                },
                "revenue": {
                  "description": "Two decimals.",
                  "type": "number"
                },
                "staff_id": {
                  "description": "Null for `unassigned`.",
                  "nullable": true,
                  "type": "string"
                }
              },
              "type": "object"
            },
            "type": "array"
          },
          "next_cursor": {
            "nullable": true,
            "type": "string"
          },
          "total": {
            "description": "Salespeople matching the search, on every page.",
            "type": "integer"
          },
          "unassigned": {
            "description": "What no one is credited with (on every page; never while searching). Null when there is none.",
            "nullable": true,
            "properties": {
              "average_order": {
                "description": "Two decimals.",
                "nullable": true,
                "type": "number"
              },
              "conversion_percent": {
                "description": "A percentage to one place or two; null when there is nothing to divide by.",
                "nullable": true,
                "type": "number"
              },
              "converted": {
                "type": "integer"
              },
              "name": {
                "type": "string"
              },
              "orders": {
                "type": "integer"
              },
              "quotes": {
                "type": "integer"
              },
              "revenue": {
                "description": "Two decimals.",
                "type": "number"
              },
              "staff_id": {
                "description": "Null for `unassigned`.",
                "nullable": true,
                "type": "string"
              }
            },
            "type": "object"
          }
        },
        "type": "object"
      },
      "SalesReport": {
        "properties": {
          "buckets": {
            "description": "The chart, in order: one per day, week or month of the period.",
            "items": {
              "properties": {
                "days": {
                  "type": "integer"
                },
                "end": {
                  "description": "YYYY-MM-DD, a day of the store’s.",
                  "type": "string"
                },
                "orders": {
                  "type": "integer"
                },
                "previous": {
                  "properties": {
                    "days": {
                      "type": "integer"
                    },
                    "end": {
                      "description": "YYYY-MM-DD, a day of the store’s.",
                      "type": "string"
                    },
                    "orders": {
                      "type": "integer"
                    },
                    "revenue": {
                      "description": "Two decimals.",
                      "type": "number"
                    },
                    "start": {
                      "description": "YYYY-MM-DD, a day of the store’s.",
                      "type": "string"
                    }
                  },
                  "type": "object"
                },
                "quotes_converted": {
                  "description": "Quotes created in the bucket that have been placed since.",
                  "type": "integer"
                },
                "revenue": {
                  "description": "Two decimals.",
                  "type": "number"
                },
                "start": {
                  "description": "YYYY-MM-DD, a day of the store’s.",
                  "type": "string"
                }
              },
              "type": "object"
            },
            "type": "array"
          },
          "compare": {
            "enum": ["previous", "year"],
            "type": "string"
          },
          "currencies": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "currency": {
            "description": "The currency of every amount; null when the period sold nothing.",
            "nullable": true,
            "type": "string"
          },
          "current": {
            "properties": {
              "average_order": {
                "description": "Revenue ÷ orders; null with none.",
                "nullable": true,
                "type": "number"
              },
              "conversion_percent": {
                "description": "A percentage to one place or two; null when there is nothing to divide by.",
                "nullable": true,
                "type": "number"
              },
              "orders": {
                "description": "Orders placed in the period, not cancelled.",
                "type": "integer"
              },
              "quotes_converted": {
                "description": "Of those, how many have been placed since and are orders, not cancelled. A recent period reads low until its quotes are placed.",
                "type": "integer"
              },
              "quotes_created": {
                "description": "Records that became quotes in the period (never in a Draft status).",
                "type": "integer"
              },
              "revenue": {
                "description": "Two decimals.",
                "type": "number"
              }
            },
            "type": "object"
          },
          "open_quotes": {
            "description": "Quotes now (not placed, cancelled, rejected or in Draft), whenever they were made: how many, and their net merchandise.",
            "properties": {
              "count": {
                "type": "integer"
              },
              "value": {
                "description": "Two decimals.",
                "type": "number"
              }
            },
            "type": "object"
          },
          "period": {
            "properties": {
              "from": {
                "description": "YYYY-MM-DD, a day of the store’s.",
                "type": "string"
              },
              "to": {
                "description": "YYYY-MM-DD, a day of the store’s.",
                "type": "string"
              }
            },
            "type": "object"
          },
          "previous": {
            "properties": {
              "average_order": {
                "description": "Revenue ÷ orders; null with none.",
                "nullable": true,
                "type": "number"
              },
              "conversion_percent": {
                "description": "A percentage to one place or two; null when there is nothing to divide by.",
                "nullable": true,
                "type": "number"
              },
              "orders": {
                "description": "Orders placed in the period, not cancelled.",
                "type": "integer"
              },
              "quotes_converted": {
                "description": "Of those, how many have been placed since and are orders, not cancelled. A recent period reads low until its quotes are placed.",
                "type": "integer"
              },
              "quotes_created": {
                "description": "Records that became quotes in the period (never in a Draft status).",
                "type": "integer"
              },
              "revenue": {
                "description": "Two decimals.",
                "type": "number"
              }
            },
            "type": "object"
          },
          "previous_period": {
            "properties": {
              "from": {
                "description": "YYYY-MM-DD, a day of the store’s.",
                "type": "string"
              },
              "to": {
                "description": "YYYY-MM-DD, a day of the store’s.",
                "type": "string"
              }
            },
            "type": "object"
          },
          "salespeople": {
            "$ref": "#/components/schemas/SalesPeoplePage"
          },
          "time_zone": {
            "description": "The store’s time zone the days are in.",
            "type": "string"
          },
          "top_products": {
            "description": "The period’s best products by revenue (up to 4).",
            "items": {
              "properties": {
                "key": {
                  "type": "string"
                },
                "label": {
                  "type": "string"
                },
                "product_template_id": {
                  "nullable": true,
                  "type": "string"
                },
                "revenue": {
                  "description": "Two decimals.",
                  "type": "number"
                },
                "share_percent": {
                  "description": "A percentage to one place or two; null when there is nothing to divide by.",
                  "nullable": true,
                  "type": "number"
                },
                "shopify_product_id": {
                  "nullable": true,
                  "type": "string"
                }
              },
              "type": "object"
            },
            "type": "array"
          },
          "unit": {
            "enum": ["day", "week", "month"],
            "type": "string"
          }
        },
        "type": "object"
      },
      "SalesSplit": {
        "properties": {
          "assigned_to_staff_id": {
            "nullable": true,
            "type": "string"
          },
          "basis": {
            "enum": ["net_merchandise", "gross_profit"],
            "type": "string"
          },
          "can_set_rates": {
            "type": "boolean"
          },
          "credit_hidden": {
            "description": "On a gross-profit store the credited base is left out without “View costs”.",
            "type": "boolean"
          },
          "default_split": {
            "enum": ["even", "primary_all"],
            "type": "string"
          },
          "earned": {
            "description": "The order has already earned its commission.",
            "type": "boolean"
          },
          "lines": {
            "description": "Every line.",
            "items": {
              "properties": {
                "commission_code_id": {
                  "nullable": true,
                  "type": "string"
                },
                "credit_base": {
                  "description": "What credit splits on this line. Null when `credit_hidden` is true.",
                  "nullable": true,
                  "type": "number"
                },
                "custom": {
                  "description": "The line has its own split.",
                  "type": "boolean"
                },
                "earned": {
                  "type": "boolean"
                },
                "inherited_code": {
                  "description": "The code the line takes without one of its own.",
                  "nullable": true,
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    },
                    "rate_percent": {
                      "description": "A percentage, two decimals.",
                      "nullable": true,
                      "type": "number"
                    }
                  },
                  "required": ["id", "name", "rate_percent"],
                  "type": "object"
                },
                "line_item_id": {
                  "type": "string"
                },
                "name": {
                  "type": "string"
                },
                "net": {
                  "description": "Net merchandise, two decimals.",
                  "type": "number"
                },
                "order_id": {
                  "description": "The order (or the split order’s part) the line is on.",
                  "type": "string"
                },
                "quantity": {
                  "type": "integer"
                },
                "rate_locked_staff_ids": {
                  "description": "People whose rate on this line the caller can’t change.",
                  "items": {
                    "type": "string"
                  },
                  "type": "array"
                },
                "shares": {
                  "items": {
                    "properties": {
                      "name": {
                        "type": "string"
                      },
                      "rate_percent": {
                        "description": "A percentage, two decimals.",
                        "nullable": true,
                        "type": "number"
                      },
                      "share_percent": {
                        "description": "A percentage, two decimals.",
                        "type": "number"
                      },
                      "staff_id": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "staff_id",
                      "name",
                      "share_percent",
                      "rate_percent"
                    ],
                    "type": "object"
                  },
                  "type": "array"
                },
                "title": {
                  "type": "string"
                },
                "variant": {
                  "nullable": true,
                  "type": "string"
                }
              },
              "required": [
                "line_item_id",
                "order_id",
                "title",
                "name",
                "variant",
                "quantity",
                "net",
                "credit_base",
                "earned",
                "custom",
                "commission_code_id",
                "inherited_code",
                "shares",
                "rate_locked_staff_ids"
              ],
              "type": "object"
            },
            "type": "array"
          },
          "mode": {
            "description": "order: one split for the whole order. item: a split per item.",
            "enum": ["order", "item"],
            "type": "string"
          },
          "order_split_set": {
            "type": "boolean"
          },
          "others": {
            "description": "People named in `with`, who are not on the order yet.",
            "items": {
              "properties": {
                "available": {
                  "description": "Whether they can be credited on new sales now.",
                  "type": "boolean"
                },
                "name": {
                  "type": "string"
                },
                "rate_percent": {
                  "description": "A percentage, two decimals. Left null for a viewer who may not see rates.",
                  "nullable": true,
                  "type": "number"
                },
                "share_percent": {
                  "description": "A percentage, two decimals.",
                  "type": "number"
                },
                "staff_id": {
                  "type": "string"
                }
              },
              "required": ["staff_id", "name", "share_percent", "rate_percent"],
              "type": "object"
            },
            "type": "array"
          },
          "primary_staff_id": {
            "nullable": true,
            "type": "string"
          },
          "quick_picks": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "salespeople": {
            "description": "Who is credited, primary first.",
            "items": {
              "properties": {
                "available": {
                  "description": "Whether they can be credited on new sales now.",
                  "type": "boolean"
                },
                "name": {
                  "type": "string"
                },
                "rate_percent": {
                  "description": "A percentage, two decimals. Left null for a viewer who may not see rates.",
                  "nullable": true,
                  "type": "number"
                },
                "share_percent": {
                  "description": "A percentage, two decimals.",
                  "type": "number"
                },
                "staff_id": {
                  "type": "string"
                }
              },
              "required": ["staff_id", "name", "share_percent", "rate_percent"],
              "type": "object"
            },
            "type": "array"
          },
          "version": {
            "description": "A token for the split as stored (mode, shares, codes), the same whoever reads it. Send it back as `version` (or `expected_version`) to refuse a save over a change made since: every save answers the new one, so no read is needed between saves.",
            "type": "string"
          }
        },
        "required": [
          "mode",
          "earned",
          "primary_staff_id",
          "salespeople",
          "order_split_set",
          "quick_picks",
          "default_split",
          "basis",
          "assigned_to_staff_id",
          "can_set_rates",
          "version",
          "credit_hidden",
          "others",
          "lines"
        ],
        "type": "object"
      },
      "SalesSplitSave": {
        "properties": {
          "codes": {
            "description": "Lines whose own commission code changes.",
            "items": {
              "properties": {
                "code_id": {
                  "description": "A `GET /sales-credit/codes` id; null clears the item’s own code. Required: a missing key is refused.",
                  "nullable": true,
                  "type": "string"
                },
                "line_item_id": {
                  "type": "string"
                }
              },
              "required": ["line_item_id", "code_id"],
              "type": "object"
            },
            "type": "array"
          },
          "confirm_replace": {
            "description": "Needed to go back to one split when items have their own.",
            "type": "boolean"
          },
          "expected_version": {
            "description": "The `version` you last read, by its older name (send one of the two). A split changed since is `409 STALE_VERSION`.",
            "type": "string"
          },
          "lines": {
            "description": "Per item: the lines whose split changes, each with its whole split. Up to 500 lines, 10 people each.",
            "items": {
              "properties": {
                "line_item_id": {
                  "type": "string"
                },
                "shares": {
                  "items": {
                    "properties": {
                      "share_percent": {
                        "description": "A percentage from 0 to 100, up to two decimals; a split totals 100. Decimal text (\"50.00\") is accepted too.",
                        "type": "number"
                      },
                      "staff_id": {
                        "type": "string"
                      }
                    },
                    "required": ["staff_id", "share_percent"],
                    "type": "object"
                  },
                  "type": "array"
                }
              },
              "required": ["line_item_id", "shares"],
              "type": "object"
            },
            "type": "array"
          },
          "mode": {
            "description": "Omit to keep the current mode (any casing is accepted). Switching to order replaces every item’s own split and needs `confirm_replace`.",
            "enum": ["order", "item"],
            "type": "string"
          },
          "shares": {
            "description": "One split for the order (mode order): every credited person with a share totalling 100. Null leaves it as stored.",
            "items": {
              "properties": {
                "share_percent": {
                  "description": "A percentage from 0 to 100, up to two decimals; a split totals 100. Decimal text (\"50.00\") is accepted too.",
                  "type": "number"
                },
                "staff_id": {
                  "type": "string"
                }
              },
              "required": ["staff_id", "share_percent"],
              "type": "object"
            },
            "nullable": true,
            "type": "array"
          },
          "version": {
            "description": "The `version` of the last answer (the read or the last save), sent back as it is. A split changed since is `409 STALE_VERSION` with the current `version` and which parts `changed`. Left out (with `expected_version`), the save is last-write-wins on what is stored now.",
            "type": "string"
          }
        },
        "type": "object"
      },
      "SalesSplitSaved": {
        "properties": {
          "assigned_to_staff_id": {
            "nullable": true,
            "type": "string"
          },
          "basis": {
            "enum": ["net_merchandise", "gross_profit"],
            "type": "string"
          },
          "can_set_rates": {
            "type": "boolean"
          },
          "changed": {
            "description": "False when nothing differed from what was stored.",
            "type": "boolean"
          },
          "credit_hidden": {
            "description": "On a gross-profit store the credited base is left out without “View costs”.",
            "type": "boolean"
          },
          "default_split": {
            "enum": ["even", "primary_all"],
            "type": "string"
          },
          "earned": {
            "description": "The order has already earned its commission.",
            "type": "boolean"
          },
          "lines": {
            "description": "Every line.",
            "items": {
              "properties": {
                "commission_code_id": {
                  "nullable": true,
                  "type": "string"
                },
                "credit_base": {
                  "description": "What credit splits on this line. Null when `credit_hidden` is true.",
                  "nullable": true,
                  "type": "number"
                },
                "custom": {
                  "description": "The line has its own split.",
                  "type": "boolean"
                },
                "earned": {
                  "type": "boolean"
                },
                "inherited_code": {
                  "description": "The code the line takes without one of its own.",
                  "nullable": true,
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    },
                    "rate_percent": {
                      "description": "A percentage, two decimals.",
                      "nullable": true,
                      "type": "number"
                    }
                  },
                  "required": ["id", "name", "rate_percent"],
                  "type": "object"
                },
                "line_item_id": {
                  "type": "string"
                },
                "name": {
                  "type": "string"
                },
                "net": {
                  "description": "Net merchandise, two decimals.",
                  "type": "number"
                },
                "order_id": {
                  "description": "The order (or the split order’s part) the line is on.",
                  "type": "string"
                },
                "quantity": {
                  "type": "integer"
                },
                "rate_locked_staff_ids": {
                  "description": "People whose rate on this line the caller can’t change.",
                  "items": {
                    "type": "string"
                  },
                  "type": "array"
                },
                "shares": {
                  "items": {
                    "properties": {
                      "name": {
                        "type": "string"
                      },
                      "rate_percent": {
                        "description": "A percentage, two decimals.",
                        "nullable": true,
                        "type": "number"
                      },
                      "share_percent": {
                        "description": "A percentage, two decimals.",
                        "type": "number"
                      },
                      "staff_id": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "staff_id",
                      "name",
                      "share_percent",
                      "rate_percent"
                    ],
                    "type": "object"
                  },
                  "type": "array"
                },
                "title": {
                  "type": "string"
                },
                "variant": {
                  "nullable": true,
                  "type": "string"
                }
              },
              "required": [
                "line_item_id",
                "order_id",
                "title",
                "name",
                "variant",
                "quantity",
                "net",
                "credit_base",
                "earned",
                "custom",
                "commission_code_id",
                "inherited_code",
                "shares",
                "rate_locked_staff_ids"
              ],
              "type": "object"
            },
            "type": "array"
          },
          "mode": {
            "description": "order: one split for the whole order. item: a split per item.",
            "enum": ["order", "item"],
            "type": "string"
          },
          "order_split_set": {
            "type": "boolean"
          },
          "others": {
            "description": "People named in `with`, who are not on the order yet.",
            "items": {
              "properties": {
                "available": {
                  "description": "Whether they can be credited on new sales now.",
                  "type": "boolean"
                },
                "name": {
                  "type": "string"
                },
                "rate_percent": {
                  "description": "A percentage, two decimals. Left null for a viewer who may not see rates.",
                  "nullable": true,
                  "type": "number"
                },
                "share_percent": {
                  "description": "A percentage, two decimals.",
                  "type": "number"
                },
                "staff_id": {
                  "type": "string"
                }
              },
              "required": ["staff_id", "name", "share_percent", "rate_percent"],
              "type": "object"
            },
            "type": "array"
          },
          "primary_staff_id": {
            "nullable": true,
            "type": "string"
          },
          "quick_picks": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "salespeople": {
            "description": "Who is credited, primary first.",
            "items": {
              "properties": {
                "available": {
                  "description": "Whether they can be credited on new sales now.",
                  "type": "boolean"
                },
                "name": {
                  "type": "string"
                },
                "rate_percent": {
                  "description": "A percentage, two decimals. Left null for a viewer who may not see rates.",
                  "nullable": true,
                  "type": "number"
                },
                "share_percent": {
                  "description": "A percentage, two decimals.",
                  "type": "number"
                },
                "staff_id": {
                  "type": "string"
                }
              },
              "required": ["staff_id", "name", "share_percent", "rate_percent"],
              "type": "object"
            },
            "type": "array"
          },
          "version": {
            "description": "A token for the split as stored (mode, shares, codes), the same whoever reads it. Send it back as `version` (or `expected_version`) to refuse a save over a change made since: every save answers the new one, so no read is needed between saves.",
            "type": "string"
          }
        },
        "required": [
          "changed",
          "mode",
          "earned",
          "primary_staff_id",
          "salespeople",
          "order_split_set",
          "quick_picks",
          "default_split",
          "basis",
          "assigned_to_staff_id",
          "can_set_rates",
          "version",
          "credit_hidden",
          "others",
          "lines"
        ],
        "type": "object"
      },
      "ScanFile": {
        "description": "A paper scan: a JPEG, PNG, WebP or HEIC photo, or a PDF (`Content-Type` says which).",
        "format": "binary",
        "type": "string"
      },
      "ScheduledEmail": {
        "properties": {
          "bcc": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "can_cancel": {
            "description": "Still waiting, and not due yet.",
            "type": "boolean"
          },
          "cc": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "channel": {
            "enum": ["email", "sms"],
            "type": "string"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "error": {
            "nullable": true,
            "type": "string"
          },
          "id": {
            "description": "What `DELETE …/scheduled-emails/{scheduleId}` takes.",
            "type": "string"
          },
          "scheduled_at": {
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "sent_at": {
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "status": {
            "description": "`scheduled` until it goes; then `sent`, `failed`, `cancelled`, …",
            "enum": [
              "queued",
              "scheduled",
              "pending",
              "sending",
              "sent",
              "failed",
              "cancelled",
              "uncertain"
            ],
            "type": "string"
          },
          "subject": {
            "type": "string"
          },
          "template_key": {
            "type": "string"
          },
          "template_name": {
            "type": "string"
          },
          "to": {
            "items": {
              "type": "string"
            },
            "type": "array"
          }
        },
        "type": "object"
      },
      "ScheduledEmailCancelled": {
        "properties": {
          "cancelled": {
            "type": "boolean"
          },
          "channel": {
            "enum": ["email", "sms"],
            "type": "string"
          },
          "id": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "ScheduledEmailList": {
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/ScheduledEmail"
            },
            "type": "array"
          }
        },
        "type": "object"
      },
      "ScheduledPaymentRequest": {
        "properties": {
          "bcc": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "can_cancel": {
            "description": "Still waiting and not yet due: a cancel stops it.",
            "type": "boolean"
          },
          "cc": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "error": {
            "nullable": true,
            "type": "string"
          },
          "id": {
            "description": "What a cancel’s `scheduleId` takes.",
            "type": "string"
          },
          "scheduled_at": {
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "sent_at": {
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "status": {
            "description": "The send log’s state: `scheduled` while it waits, `sent` once it went, `cancelled`, `failed`, …",
            "enum": [
              "queued",
              "scheduled",
              "pending",
              "sending",
              "sent",
              "failed",
              "cancelled",
              "uncertain"
            ],
            "type": "string"
          },
          "subject": {
            "type": "string"
          },
          "template_key": {
            "type": "string"
          },
          "template_name": {
            "type": "string"
          },
          "to": {
            "items": {
              "type": "string"
            },
            "type": "array"
          }
        },
        "type": "object"
      },
      "ScheduledPaymentRequestCancelled": {
        "properties": {
          "cancelled": {
            "type": "boolean"
          },
          "id": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "ScheduledPaymentRequestList": {
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/ScheduledPaymentRequest"
            },
            "type": "array"
          }
        },
        "type": "object"
      },
      "SearchResults": {
        "properties": {
          "correction": {
            "description": "Set when nothing matched as typed and the corrected words did.",
            "nullable": true,
            "properties": {
              "from": {
                "type": "string"
              },
              "message": {
                "description": "“No exact matches for … Showing results for …”.",
                "type": "string"
              },
              "to": {
                "type": "string"
              }
            },
            "type": "object"
          },
          "items": {
            "description": "Every kind in one list, the closest match first.",
            "items": {
              "properties": {
                "id": {
                  "type": "string"
                },
                "kind": {
                  "description": "`product` is a product template; `shopify_product` one of the store’s Shopify products; `import_record` a record still in an import that isn’t imported yet, so not in the store; `option_value` one value of an option (a fabric, a finish).",
                  "enum": [
                    "customer",
                    "order",
                    "quote",
                    "product",
                    "shopify_product",
                    "vendor",
                    "purchase_order",
                    "import_record",
                    "location",
                    "warehouse",
                    "category",
                    "option",
                    "option_value",
                    "status",
                    "staff",
                    "warranty_claim"
                  ],
                  "type": "string"
                },
                "matched_on": {
                  "description": "Which fields the words were found in, each with its value (up to 2 values a field), so a match can be judged: `[{ \"field\": \"vendor\", \"value\": \"Harlow & Finch Interiors\" }]`. Fields: a customer’s `name`, `email`, `phone`, `company`, `address`, `city`, `postal_code`; an order’s or quote’s `number`, `original_number`, `customer`, `customer_email`, `customer_phone`, `customer_company` (contacts only to a caller who may read customers), `line`, `sku`, `purchase_order`, `salesperson`, `tag`; a product’s `name`, `handle`, `sku`, `vendor`, `category` or `product_type`, `tag`; a vendor’s `name`, `email`, `phone`, `contact`, `address`, `city`; a purchase order’s `number`, `original_number`, `vendor`, `item`, `sku`, `customer_order`, `deliver_to`; an import record’s `title`, `subtitle`; a location’s `name`, `address`, `city`; a warehouse’s `name`, `address`; a category’s, option’s or status’s `name` (an option’s `label` too); a value’s `value`, `label`, `sku`; staff `first_name`, `last_name`; a claim’s `claim_number`, `original_number`, `customer`, `customer_email`, `customer_phone`, `order`, `product`, `serial_number`. It reads the facts a result carries (a product’s first 20 vendors and categories, an order’s first 100 lines, a Shopify product’s variants when it has 10 or fewer), so it can be empty when the match came from something beyond them, or from another order of its group.",
                  "items": {
                    "properties": {
                      "field": {
                        "type": "string"
                      },
                      "value": {
                        "type": "string"
                      }
                    },
                    "type": "object"
                  },
                  "type": "array"
                },
                "record": {
                  "description": "The record as its own list gives it (`GET /customers`, `/quotes`, `/orders`, `/product-templates`, `/products` with `variants` when it has 10 or fewer, `/vendors`, `/purchase-orders`, `/locations`, `/warehouses`, `/categories`, `/options`, `/statuses`, `/staff`, `/warranty/claims`). An option value: `{ option_id, value, label, sku, option: { id, name } }`, as `GET /options/{id}` lists it under `values`, with its option. An import record: `{ id, kind, title, subtitle, rows, in_store: false, import: { id, status, mine, review_url } }`, from a key’s own drafts and the store’s imports it may see (`GET /imports`), drafting to sent.",
                  "type": "object"
                },
                "subtitle": {
                  "description": "A second line to tell results apart: an order’s customer, a customer’s email, a template’s SKU prefix, a Shopify product’s vendor, a vendor’s email or contact, a purchase order’s vendor, a location’s or warehouse’s address, a category’s full path, a value’s option, a status’s group, a claim’s customer; for an import record, “In an import (Products), not in the store yet”.",
                  "nullable": true,
                  "type": "string"
                },
                "title": {
                  "description": "The number of an order, quote, purchase order or claim; otherwise the name (a customer, vendor, product, location, category, option or value, status, person).",
                  "type": "string"
                }
              },
              "type": "object"
            },
            "type": "array"
          },
          "not_searched": {
            "description": "Kinds the caller may read that couldn’t be searched just now, with why (Shopify busy, or the kind hadn’t answered within the search’s 8 seconds). Empty when every kind was searched.",
            "items": {
              "properties": {
                "kind": {
                  "enum": [
                    "customer",
                    "order",
                    "quote",
                    "product",
                    "shopify_product",
                    "vendor",
                    "purchase_order",
                    "import_record",
                    "location",
                    "warehouse",
                    "category",
                    "option",
                    "option_value",
                    "status",
                    "staff",
                    "warranty_claim"
                  ],
                  "type": "string"
                },
                "reason": {
                  "type": "string"
                }
              },
              "type": "object"
            },
            "type": "array"
          },
          "query": {
            "description": "What was searched: the corrected words when `correction` is set.",
            "type": "string"
          }
        },
        "type": "object"
      },
      "SendEmail": {
        "description": "With a template every other field is optional; with none, `subject` and `message` are required.",
        "properties": {
          "attach_document": {
            "description": "Attach the PDF where the template does (default true); false sends none.",
            "type": "boolean"
          },
          "bcc": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "cc": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "include_what_changed": {
            "description": "False leaves out the list of the quote’s changes an email that delivers the quote shows. Default true.",
            "type": "boolean"
          },
          "message": {
            "description": "Your message, up to 50,000 characters, with merge fields (blank lines start paragraphs). Left out: the template’s own.",
            "type": "string"
          },
          "plain_text": {
            "description": "True: this one email as plain text; false: designed. Left out: the template’s own setting.",
            "type": "boolean"
          },
          "reply_to": {
            "description": "Up to 10 Reply-To addresses. Left out: the store’s Reply-to.",
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "send_at": {
            "description": "Schedule the email: at least a minute from now and at most 90 days ahead. Listed and cancelled with `GET /orders/{id}/scheduled-emails`. Left out: now.",
            "format": "date-time",
            "type": "string"
          },
          "subject": {
            "description": "Your subject, up to 200 characters, with merge fields (`GET /orders/{id}/email-placeholders`). Left out: the template’s own.",
            "type": "string"
          },
          "template_key": {
            "description": "A key from `GET /email-templates`. The payment request template is not sent from here. Left out: your own email, `subject` and `message` as typed, with no template.",
            "type": "string"
          },
          "to": {
            "description": "Up to 5 addresses; the customer’s own address when left out.",
            "items": {
              "type": "string"
            },
            "type": "array"
          }
        },
        "type": "object"
      },
      "SerialsSave": {
        "properties": {
          "serials": {
            "description": "Up to 1,000 units, each once.",
            "items": {
              "properties": {
                "line_id": {
                  "type": "string"
                },
                "previous_serial": {
                  "description": "The serial the unit showed when you read it (null for none): a different one now refuses this unit. Required unless `version` is sent.",
                  "nullable": true,
                  "type": "string"
                },
                "serial": {
                  "description": "The serial (up to 100 characters); an empty one clears the unit’s.",
                  "type": "string"
                },
                "unit_number": {
                  "description": "From 1, as `GET /orders/{id}/serials`.",
                  "type": "integer"
                }
              },
              "required": ["line_id", "unit_number", "serial"],
              "type": "object"
            },
            "type": "array"
          },
          "version": {
            "description": "The serials’ `version` from the last answer (`GET /orders/{id}/serials` or the last save), sent back as it is: any serial changed since is `409 STALE_VERSION` with the current `version`, and each unit sent without `previous_serial` is held to its serial as it is now. Send this or every unit’s `previous_serial`.",
            "type": "string"
          }
        },
        "required": ["serials"],
        "type": "object"
      },
      "SettingsApproval": {
        "description": "Settings › Quotes and orders › Defaults › Before an order is placed.",
        "properties": {
          "review_flag_default": {
            "description": "New orders start with “Requires review” on.",
            "type": "boolean"
          },
          "review_required": {
            "description": "Every order goes through review.",
            "type": "boolean"
          },
          "reviews": {
            "description": "Reviews: puts Review in the menus. Off saves both rules below off.",
            "type": "boolean"
          }
        },
        "required": ["reviews", "review_flag_default", "review_required"],
        "type": "object"
      },
      "SettingsApprovalUpdate": {
        "description": "Only the fields to change. A field the card doesn’t have is `400 INVALID_BODY`; a read-only one is ignored when sent unchanged.",
        "properties": {
          "review_flag_default": {
            "description": "New orders start with “Requires review” on.",
            "type": "boolean"
          },
          "review_required": {
            "description": "Every order goes through review.",
            "type": "boolean"
          },
          "reviews": {
            "description": "Reviews: puts Review in the menus. Off saves both rules below off.",
            "type": "boolean"
          }
        },
        "type": "object"
      },
      "SettingsBrandGrouping": {
        "description": "Settings › Business and locations › Locations › Brand grouping.",
        "properties": {
          "group_locations_by_brand": {
            "description": "Group locations by brand (`POST /brands` needs it on). Off: one list of locations.",
            "type": "boolean"
          }
        },
        "required": ["group_locations_by_brand"],
        "type": "object"
      },
      "SettingsBrandGroupingUpdate": {
        "description": "Only the fields to change. A field the card doesn’t have is `400 INVALID_BODY`; a read-only one is ignored when sent unchanged.",
        "properties": {
          "group_locations_by_brand": {
            "description": "Group locations by brand (`POST /brands` needs it on). Off: one list of locations.",
            "type": "boolean"
          }
        },
        "type": "object"
      },
      "SettingsBranding": {
        "description": "Settings › Branding › Brand.",
        "properties": {
          "accent_color": {
            "description": "The accent colour, `#RRGGBB`.",
            "nullable": true,
            "type": "string"
          },
          "brand_color": {
            "description": "The brand colour customer pages and emails share, `#RRGGBB`.",
            "nullable": true,
            "type": "string"
          },
          "logo_url": {
            "description": "The logo. Read-only here. The logo is uploaded: `POST /settings/branding/logo`.",
            "nullable": true,
            "type": "string"
          },
          "slogan": {
            "description": "The slogan.",
            "nullable": true,
            "type": "string"
          },
          "square_logo_url": {
            "description": "The square logo. Read-only here. The square logo is uploaded: `POST /settings/branding/logo`.",
            "nullable": true,
            "type": "string"
          },
          "text_color": {
            "description": "The text colour, from the theme. Read-only. The text colour is read from the theme (Update from theme, `POST /settings/branding/theme-import`), never typed in.",
            "nullable": true,
            "type": "string"
          }
        },
        "required": [
          "brand_color",
          "accent_color",
          "text_color",
          "slogan",
          "logo_url",
          "square_logo_url"
        ],
        "type": "object"
      },
      "SettingsBrandingLogo": {
        "properties": {
          "logo": {
            "description": "`logo` (the store logo) or `square_logo`.",
            "enum": ["logo", "square_logo"],
            "type": "string"
          },
          "url": {
            "description": "The picture’s public https address (JPEG, PNG, WebP or GIF, up to 5 MB); null removes the logo. A key fetches at most 50 files from web addresses a day, each counted before it is fetched (`403 CAP_EXCEEDED`, `reason` `daily_url_fetches`).",
            "nullable": true,
            "type": "string"
          }
        },
        "required": ["logo", "url"],
        "type": "object"
      },
      "SettingsBrandingThemeImport": {
        "properties": {
          "changes": {
            "description": "Each field whose theme value differs from what is saved.",
            "items": {
              "properties": {
                "current": {
                  "nullable": true,
                  "type": "string"
                },
                "field": {
                  "type": "string"
                },
                "from_theme": {
                  "nullable": true,
                  "type": "string"
                },
                "label": {
                  "type": "string"
                }
              },
              "required": ["field", "label", "current", "from_theme"],
              "type": "object"
            },
            "type": "array"
          },
          "theme_name": {
            "type": "string"
          },
          "values": {
            "description": "Everything read from the theme, as the brand kit and the page look take it.",
            "properties": {
              "accent_color": {
                "nullable": true,
                "type": "string"
              },
              "background": {
                "nullable": true,
                "type": "string"
              },
              "body_font": {
                "nullable": true,
                "type": "string"
              },
              "brand_color": {
                "nullable": true,
                "type": "string"
              },
              "buttons": {
                "type": "string"
              },
              "corners": {
                "type": "string"
              },
              "heading_font": {
                "nullable": true,
                "type": "string"
              },
              "logo_url": {
                "nullable": true,
                "type": "string"
              },
              "slogan": {
                "nullable": true,
                "type": "string"
              },
              "square_logo_url": {
                "nullable": true,
                "type": "string"
              },
              "store_name": {
                "type": "string"
              },
              "text_color": {
                "nullable": true,
                "type": "string"
              }
            },
            "type": "object"
          }
        },
        "required": ["theme_name", "values", "changes"],
        "type": "object"
      },
      "SettingsBrandingThemeImportApplied": {
        "properties": {
          "brand_kit": {
            "$ref": "#/components/schemas/SettingsBranding"
          },
          "saved": {
            "description": "The fields saved (none when nothing differed).",
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "theme_import_recorded": {
            "description": "False when the theme couldn’t be read again to record the import.",
            "type": "boolean"
          }
        },
        "required": ["saved", "brand_kit", "theme_import_recorded"],
        "type": "object"
      },
      "SettingsBrandingThemeImportApply": {
        "properties": {
          "kit_fields": {
            "description": "The brand kit fields to take from the theme; left out: every one that differs.",
            "items": {
              "enum": [
                "logo_url",
                "square_logo_url",
                "brand_color",
                "accent_color",
                "text_color",
                "store_name",
                "slogan"
              ],
              "type": "string"
            },
            "type": "array"
          }
        },
        "type": "object"
      },
      "SettingsBrandingUpdate": {
        "description": "Only the fields to change. A field the card doesn’t have is `400 INVALID_BODY`; a read-only one is ignored when sent unchanged.",
        "properties": {
          "accent_color": {
            "description": "The accent colour, `#RRGGBB`.",
            "nullable": true,
            "type": "string"
          },
          "brand_color": {
            "description": "The brand colour customer pages and emails share, `#RRGGBB`.",
            "nullable": true,
            "type": "string"
          },
          "slogan": {
            "description": "The slogan.",
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "SettingsBusinessDetails": {
        "description": "Settings › Business and locations › Business details.",
        "properties": {
          "company_name": {
            "description": "The company name (Branding calls it the store name).",
            "type": "string"
          },
          "support_email": {
            "description": "The support email customers see.",
            "type": "string"
          }
        },
        "required": ["company_name", "support_email"],
        "type": "object"
      },
      "SettingsBusinessDetailsUpdate": {
        "description": "Only the fields to change. A field the card doesn’t have is `400 INVALID_BODY`; a read-only one is ignored when sent unchanged.",
        "properties": {
          "company_name": {
            "description": "The company name (Branding calls it the store name).",
            "type": "string"
          },
          "support_email": {
            "description": "The support email customers see.",
            "type": "string"
          }
        },
        "type": "object"
      },
      "SettingsChangeHistory": {
        "properties": {
          "items": {
            "items": {
              "properties": {
                "actor_kind": {
                  "enum": ["staff", "system", "support"],
                  "type": "string"
                },
                "actor_name": {
                  "description": "The person, \"OrderPilot\", \"Bevy support\" or \"API key: <name>\".",
                  "type": "string"
                },
                "area": {
                  "description": "The Settings page, as `area` takes it.",
                  "type": "string"
                },
                "changes": {
                  "items": {
                    "properties": {
                      "after": {
                        "nullable": true,
                        "type": "string"
                      },
                      "before": {
                        "nullable": true,
                        "type": "string"
                      },
                      "commission": {
                        "type": "boolean"
                      },
                      "cost": {
                        "type": "boolean"
                      },
                      "hidden": {
                        "description": "This caller may not see the values (a cost or a rate).",
                        "type": "boolean"
                      },
                      "label": {
                        "type": "string"
                      },
                      "secret": {
                        "description": "A secret: it changed; no values are kept.",
                        "type": "boolean"
                      }
                    },
                    "required": ["label", "before", "after"],
                    "type": "object"
                  },
                  "type": "array"
                },
                "created_at": {
                  "format": "date-time",
                  "type": "string"
                },
                "focus": {
                  "nullable": true,
                  "type": "string"
                },
                "id": {
                  "type": "string"
                },
                "note": {
                  "nullable": true,
                  "type": "string"
                },
                "record": {
                  "description": "The record changed, by its name then.",
                  "nullable": true,
                  "type": "string"
                },
                "source": {
                  "enum": ["settings", "access", "record"],
                  "type": "string"
                },
                "summary": {
                  "type": "string"
                },
                "view": {
                  "nullable": true,
                  "type": "string"
                }
              },
              "required": [
                "id",
                "source",
                "created_at",
                "actor_kind",
                "actor_name",
                "area",
                "summary",
                "changes"
              ],
              "type": "object"
            },
            "type": "array"
          },
          "next_cursor": {
            "nullable": true,
            "type": "string"
          },
          "people": {
            "description": "The staff `who` can name (`staff:<id>`).",
            "items": {
              "properties": {
                "id": {
                  "type": "string"
                },
                "name": {
                  "type": "string"
                }
              },
              "required": ["id", "name"],
              "type": "object"
            },
            "type": "array"
          }
        },
        "required": ["items", "next_cursor", "people"],
        "type": "object"
      },
      "SettingsCommissionCredit": {
        "description": "Settings › Purchasing and accounting › Commissions › Sales credit.",
        "properties": {
          "default_split": {
            "description": "When a salesperson is added or removed: `even` (split equally) or `primary_all` (all to the primary salesperson).",
            "enum": ["even", "primary_all"],
            "type": "string"
          },
          "names_on_documents": {
            "description": "Salespeople named on customer documents: the `primary`, `all` of them or `none`.",
            "enum": ["primary", "all", "none"],
            "type": "string"
          },
          "pos_quick_picks": {
            "description": "The split quick picks on POS, as the screen writes them: `100` (all to the primary), or shares such as `75/25` and `50/50`.",
            "items": {
              "type": "string"
            },
            "type": "array"
          }
        },
        "required": ["default_split", "pos_quick_picks", "names_on_documents"],
        "type": "object"
      },
      "SettingsCommissionCreditUpdate": {
        "description": "Only the fields to change. A field the card doesn’t have is `400 INVALID_BODY`; a read-only one is ignored when sent unchanged.",
        "properties": {
          "default_split": {
            "description": "When a salesperson is added or removed: `even` (split equally) or `primary_all` (all to the primary salesperson).",
            "enum": ["even", "primary_all"],
            "type": "string"
          },
          "names_on_documents": {
            "description": "Salespeople named on customer documents: the `primary`, `all` of them or `none`.",
            "enum": ["primary", "all", "none"],
            "type": "string"
          },
          "pos_quick_picks": {
            "description": "The split quick picks on POS, as the screen writes them: `100` (all to the primary), or shares such as `75/25` and `50/50`.",
            "items": {
              "type": "string"
            },
            "type": "array"
          }
        },
        "type": "object"
      },
      "SettingsCommissionEarning": {
        "description": "Settings › Purchasing and accounting › Commissions › Earning.",
        "properties": {
          "earned_when": {
            "description": "Commission is earned when the order is `placed`, `paid_in_full` or `fully_delivered`.",
            "enum": ["placed", "paid_in_full", "fully_delivered"],
            "type": "string"
          },
          "paid_on": {
            "description": "Commission is paid on `net_merchandise` or `gross_profit`.",
            "enum": ["net_merchandise", "gross_profit"],
            "type": "string"
          },
          "refunds": {
            "description": "Refunds `deduct` (take commission back) or are `show_only`.",
            "enum": ["deduct", "show_only"],
            "type": "string"
          },
          "when_a_rate_changes": {
            "description": "A changed rate applies to `new_only` commission, or will `recalculate` earned commission too.",
            "enum": ["new_only", "recalculate"],
            "type": "string"
          }
        },
        "required": [
          "earned_when",
          "paid_on",
          "refunds",
          "when_a_rate_changes"
        ],
        "type": "object"
      },
      "SettingsCommissionEarningUpdate": {
        "description": "Only the fields to change. A field the card doesn’t have is `400 INVALID_BODY`; a read-only one is ignored when sent unchanged.",
        "properties": {
          "earned_when": {
            "description": "Commission is earned when the order is `placed`, `paid_in_full` or `fully_delivered`.",
            "enum": ["placed", "paid_in_full", "fully_delivered"],
            "type": "string"
          },
          "paid_on": {
            "description": "Commission is paid on `net_merchandise` or `gross_profit`.",
            "enum": ["net_merchandise", "gross_profit"],
            "type": "string"
          },
          "refunds": {
            "description": "Refunds `deduct` (take commission back) or are `show_only`.",
            "enum": ["deduct", "show_only"],
            "type": "string"
          },
          "when_a_rate_changes": {
            "description": "A changed rate applies to `new_only` commission, or will `recalculate` earned commission too.",
            "enum": ["new_only", "recalculate"],
            "type": "string"
          }
        },
        "type": "object"
      },
      "SettingsCosting": {
        "description": "Settings › Purchasing and accounting › Purchase orders and costing › Costing.",
        "properties": {
          "costing_method": {
            "description": "How stock draws its cost: `moving_weighted_average` (recommended), `fifo` or `lifo`.",
            "enum": ["moving_weighted_average", "fifo", "lifo"],
            "type": "string"
          },
          "default_charge_split": {
            "description": "How a charge is split over items by default: `by_value`, `by_quantity`, `by_weight` or `manual`. `expense` may be read, never set: expensing is not a split.",
            "enum": [
              "by_value",
              "by_quantity",
              "by_weight",
              "manual",
              "expense"
            ],
            "type": "string"
          },
          "expense_inbound_shipping": {
            "description": "New inbound shipping charges start expensed (their own line in QuickBooks) instead of spread over item cost.",
            "type": "boolean"
          },
          "publish_cost_to_shopify": {
            "description": "Keep Shopify’s Cost per item updated for stocked products (the average cost).",
            "type": "boolean"
          },
          "record_exchange_rate_per_receipt": {
            "description": "Record the exchange rate on each receipt.",
            "type": "boolean"
          },
          "shopify_cost_conflict": {
            "description": "When the cost was changed in Shopify: `flag_and_pause` (flag it and stop publishing that item) or `overwrite`.",
            "enum": ["flag_and_pause", "overwrite"],
            "type": "string"
          },
          "show_cost_on_order": {
            "description": "Show cost in the order page’s price breakdown.",
            "type": "boolean"
          },
          "tax_in_landed_cost": {
            "description": "Purchase tax is part of landed cost (the screen’s “Purchase tax isn’t part of landed cost” unticked). Off for tax you reclaim.",
            "type": "boolean"
          }
        },
        "required": [
          "costing_method",
          "default_charge_split",
          "expense_inbound_shipping",
          "tax_in_landed_cost",
          "record_exchange_rate_per_receipt",
          "show_cost_on_order",
          "publish_cost_to_shopify",
          "shopify_cost_conflict"
        ],
        "type": "object"
      },
      "SettingsCostingUpdate": {
        "description": "Only the fields to change. A field the card doesn’t have is `400 INVALID_BODY`; a read-only one is ignored when sent unchanged.",
        "properties": {
          "costing_method": {
            "description": "How stock draws its cost: `moving_weighted_average` (recommended), `fifo` or `lifo`.",
            "enum": ["moving_weighted_average", "fifo", "lifo"],
            "type": "string"
          },
          "default_charge_split": {
            "description": "How a charge is split over items by default: `by_value`, `by_quantity`, `by_weight` or `manual`. `expense` may be read, never set: expensing is not a split.",
            "enum": ["by_value", "by_quantity", "by_weight", "manual"],
            "type": "string"
          },
          "expense_inbound_shipping": {
            "description": "New inbound shipping charges start expensed (their own line in QuickBooks) instead of spread over item cost.",
            "type": "boolean"
          },
          "publish_cost_to_shopify": {
            "description": "Keep Shopify’s Cost per item updated for stocked products (the average cost).",
            "type": "boolean"
          },
          "record_exchange_rate_per_receipt": {
            "description": "Record the exchange rate on each receipt.",
            "type": "boolean"
          },
          "shopify_cost_conflict": {
            "description": "When the cost was changed in Shopify: `flag_and_pause` (flag it and stop publishing that item) or `overwrite`.",
            "enum": ["flag_and_pause", "overwrite"],
            "type": "string"
          },
          "show_cost_on_order": {
            "description": "Show cost in the order page’s price breakdown.",
            "type": "boolean"
          },
          "tax_in_landed_cost": {
            "description": "Purchase tax is part of landed cost (the screen’s “Purchase tax isn’t part of landed cost” unticked). Off for tax you reclaim.",
            "type": "boolean"
          }
        },
        "type": "object"
      },
      "SettingsCustomerPagesLook": {
        "description": "Settings › Branding › Customer portal, Quote request page and Request sent page › Look.",
        "properties": {
          "background": {
            "description": "The background colour, `#RRGGBB`; null for the default.",
            "nullable": true,
            "type": "string"
          },
          "body_font": {
            "description": "With `fonts: custom`: the body font.",
            "nullable": true,
            "type": "string"
          },
          "buttons": {
            "description": "The buttons: `filled` or `outline`.",
            "enum": ["filled", "outline"],
            "type": "string"
          },
          "corners": {
            "description": "The corners: `square`, `rounded` or `pill`.",
            "enum": ["rounded", "square", "pill"],
            "type": "string"
          },
          "custom_css": {
            "description": "Custom CSS for the customer pages.",
            "nullable": true,
            "type": "string"
          },
          "fonts": {
            "description": "The fonts: `orderpilot`’s, the `theme`’s, or `custom` (`heading_font`, `body_font`).",
            "enum": ["orderpilot", "theme", "custom"],
            "type": "string"
          },
          "heading_font": {
            "description": "With `fonts: custom`: the heading font.",
            "nullable": true,
            "type": "string"
          }
        },
        "required": [
          "background",
          "fonts",
          "heading_font",
          "body_font",
          "corners",
          "buttons",
          "custom_css"
        ],
        "type": "object"
      },
      "SettingsCustomerPagesLookUpdate": {
        "description": "Only the fields to change. A field the card doesn’t have is `400 INVALID_BODY`; a read-only one is ignored when sent unchanged.",
        "properties": {
          "background": {
            "description": "The background colour, `#RRGGBB`; null for the default.",
            "nullable": true,
            "type": "string"
          },
          "body_font": {
            "description": "With `fonts: custom`: the body font.",
            "nullable": true,
            "type": "string"
          },
          "buttons": {
            "description": "The buttons: `filled` or `outline`.",
            "enum": ["filled", "outline"],
            "type": "string"
          },
          "corners": {
            "description": "The corners: `square`, `rounded` or `pill`.",
            "enum": ["rounded", "square", "pill"],
            "type": "string"
          },
          "custom_css": {
            "description": "Custom CSS for the customer pages.",
            "nullable": true,
            "type": "string"
          },
          "fonts": {
            "description": "The fonts: `orderpilot`’s, the `theme`’s, or `custom` (`heading_font`, `body_font`).",
            "enum": ["orderpilot", "theme", "custom"],
            "type": "string"
          },
          "heading_font": {
            "description": "With `fonts: custom`: the heading font.",
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "SettingsCustomerPagesThemeFonts": {
        "properties": {
          "body_font": {
            "nullable": true,
            "type": "string"
          },
          "heading_font": {
            "nullable": true,
            "type": "string"
          },
          "problem": {
            "description": "Why nothing new was read (null: read and stored).",
            "enum": [
              "no_main_theme",
              "needs_approval",
              "failed",
              "no_fonts",
              null
            ],
            "nullable": true,
            "type": "string"
          }
        },
        "required": ["heading_font", "body_font", "problem"],
        "type": "object"
      },
      "SettingsCustomersPage": {
        "description": "Settings › Customers › Customers page.",
        "properties": {
          "customers_page": {
            "description": "Put Customers in the menus.",
            "type": "boolean"
          }
        },
        "required": ["customers_page"],
        "type": "object"
      },
      "SettingsCustomersPageUpdate": {
        "description": "Only the fields to change. A field the card doesn’t have is `400 INVALID_BODY`; a read-only one is ignored when sent unchanged.",
        "properties": {
          "customers_page": {
            "description": "Put Customers in the menus.",
            "type": "boolean"
          }
        },
        "type": "object"
      },
      "SettingsDeleted": {
        "properties": {
          "deleted": {
            "type": "boolean"
          },
          "id": {
            "type": "string"
          }
        },
        "required": ["id", "deleted"],
        "type": "object"
      },
      "SettingsDeliveryStock": {
        "description": "Settings › Quotes and orders › Defaults › Delivery and stock.",
        "properties": {
          "delivery_lead_days": {
            "description": "Delivery to customer: the days delivery takes once an item is ready at the store. Null when unknown.",
            "nullable": true,
            "type": "integer"
          },
          "deposit_line_title": {
            "description": "The item name on the deposit order; `{number}` is replaced with the quote or order number.",
            "type": "string"
          },
          "deposit_orders": {
            "description": "Request deposit makes a separate Shopify order for the deposit.",
            "type": "boolean"
          },
          "fulfill_only_what_leaves": {
            "description": "Mark items fulfilled only when taken, collected or delivered. Off: every item is marked fulfilled when the order is fully paid.",
            "type": "boolean"
          },
          "hide_out_of_stock_on_pos": {
            "description": "The POS product picker hides Shopify products with no stock at the register.",
            "type": "boolean"
          },
          "new_admin_order_delivery": {
            "description": "What a new admin order’s items start as: `delivery` or `store_pickup`.",
            "enum": ["delivery", "store_pickup"],
            "type": "string"
          },
          "pos_pickup_default": {
            "description": "The default pickup choice when taking POS payment: `in_stock_here` (today, when in stock here) or `none` (pick up later).",
            "enum": ["in_stock_here", "none"],
            "type": "string"
          },
          "sell_when_out_of_stock": {
            "description": "Enable selling when out of stock (the default for new products).",
            "type": "boolean"
          },
          "tax_change_needs_reason": {
            "description": "Charging or exempting one order’s tax needs a reason.",
            "type": "boolean"
          }
        },
        "required": [
          "sell_when_out_of_stock",
          "hide_out_of_stock_on_pos",
          "tax_change_needs_reason",
          "deposit_orders",
          "deposit_line_title",
          "pos_pickup_default",
          "fulfill_only_what_leaves",
          "new_admin_order_delivery",
          "delivery_lead_days"
        ],
        "type": "object"
      },
      "SettingsDeliveryStockUpdate": {
        "description": "Only the fields to change. A field the card doesn’t have is `400 INVALID_BODY`; a read-only one is ignored when sent unchanged.",
        "properties": {
          "delivery_lead_days": {
            "description": "Delivery to customer: the days delivery takes once an item is ready at the store. Null when unknown.",
            "nullable": true,
            "type": "integer"
          },
          "deposit_line_title": {
            "description": "The item name on the deposit order; `{number}` is replaced with the quote or order number.",
            "type": "string"
          },
          "deposit_orders": {
            "description": "Request deposit makes a separate Shopify order for the deposit.",
            "type": "boolean"
          },
          "fulfill_only_what_leaves": {
            "description": "Mark items fulfilled only when taken, collected or delivered. Off: every item is marked fulfilled when the order is fully paid.",
            "type": "boolean"
          },
          "hide_out_of_stock_on_pos": {
            "description": "The POS product picker hides Shopify products with no stock at the register.",
            "type": "boolean"
          },
          "new_admin_order_delivery": {
            "description": "What a new admin order’s items start as: `delivery` or `store_pickup`.",
            "enum": ["delivery", "store_pickup"],
            "type": "string"
          },
          "pos_pickup_default": {
            "description": "The default pickup choice when taking POS payment: `in_stock_here` (today, when in stock here) or `none` (pick up later).",
            "enum": ["in_stock_here", "none"],
            "type": "string"
          },
          "sell_when_out_of_stock": {
            "description": "Enable selling when out of stock (the default for new products).",
            "type": "boolean"
          },
          "tax_change_needs_reason": {
            "description": "Charging or exempting one order’s tax needs a reason.",
            "type": "boolean"
          }
        },
        "type": "object"
      },
      "SettingsDiscounts": {
        "description": "Settings › Quotes and orders › Discounts.",
        "properties": {
          "item_discount_needs_reason": {
            "description": "On POS, staff say why they discount an item (always optional in the admin).",
            "type": "boolean"
          },
          "new_item_discounts_start_as": {
            "description": "What an item’s discount opens on: `fixed_amount` or `percentage`.",
            "enum": ["fixed_amount", "percentage"],
            "type": "string"
          },
          "new_order_discounts_start_as": {
            "description": "What Add order discount opens on: `fixed_amount` or `percentage`.",
            "enum": ["fixed_amount", "percentage"],
            "type": "string"
          },
          "order_discount_applies_to": {
            "description": "What a new order discount applies to: `products_and_fees` or `products_only`.",
            "enum": ["products_and_fees", "products_only"],
            "type": "string"
          }
        },
        "required": [
          "item_discount_needs_reason",
          "order_discount_applies_to",
          "new_order_discounts_start_as",
          "new_item_discounts_start_as"
        ],
        "type": "object"
      },
      "SettingsDiscountsUpdate": {
        "description": "Only the fields to change. A field the card doesn’t have is `400 INVALID_BODY`; a read-only one is ignored when sent unchanged.",
        "properties": {
          "item_discount_needs_reason": {
            "description": "On POS, staff say why they discount an item (always optional in the admin).",
            "type": "boolean"
          },
          "new_item_discounts_start_as": {
            "description": "What an item’s discount opens on: `fixed_amount` or `percentage`.",
            "enum": ["fixed_amount", "percentage"],
            "type": "string"
          },
          "new_order_discounts_start_as": {
            "description": "What Add order discount opens on: `fixed_amount` or `percentage`.",
            "enum": ["fixed_amount", "percentage"],
            "type": "string"
          },
          "order_discount_applies_to": {
            "description": "What a new order discount applies to: `products_and_fees` or `products_only`.",
            "enum": ["products_and_fees", "products_only"],
            "type": "string"
          }
        },
        "type": "object"
      },
      "SettingsDocumentAssign": {
        "properties": {
          "brand_id": {
            "description": "A brand’s `id` from `GET /brands`, or null for the store’s own.",
            "nullable": true,
            "type": "string"
          },
          "design_id": {
            "description": "A design of that document from `GET /settings/documents`, or null for the built-in one.",
            "nullable": true,
            "type": "string"
          },
          "document_type": {
            "enum": [
              "sales_order",
              "invoice",
              "purchase_order",
              "product_spec",
              "job_sheet"
            ],
            "type": "string"
          }
        },
        "required": ["document_type", "brand_id", "design_id"],
        "type": "object"
      },
      "SettingsDocumentBrands": {
        "properties": {
          "brand_ids": {
            "description": "The brands (from `GET /brands`), at most 200; empty: none.",
            "items": {
              "type": "string"
            },
            "type": "array"
          }
        },
        "required": ["brand_ids"],
        "type": "object"
      },
      "SettingsDocumentCreate": {
        "properties": {
          "brand_ids": {
            "description": "Brands that print it from now on (from `GET /brands`).",
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "name": {
            "description": "The theme’s name, 1–80 characters.",
            "type": "string"
          },
          "options": {
            "description": "The theme editor’s controls. A part left out stays as the source design has it; in a part sent, the fields left out do too (`{ appearance: { heading_color } }` changes one colour). `header`, `block_order` and `hidden_blocks` are replaced whole. Fonts are family names and colours `#RRGGBB`; every fixed choice (block ids, header fields, sizes, date formats) is snake_case.",
            "properties": {
              "appearance": {
                "description": "Colours and fonts.",
                "properties": {
                  "body_color": {
                    "description": "A six-digit hex colour, `#RRGGBB`.",
                    "type": "string"
                  },
                  "body_font": {
                    "description": "A font family, one of the design’s `fonts` (`Inter`, `Times New Roman`).",
                    "type": "string"
                  },
                  "border_color": {
                    "description": "A six-digit hex colour, `#RRGGBB`.",
                    "type": "string"
                  },
                  "header_color": {
                    "description": "A six-digit hex colour, `#RRGGBB`.",
                    "type": "string"
                  },
                  "heading_color": {
                    "description": "A six-digit hex colour, `#RRGGBB`.",
                    "type": "string"
                  },
                  "heading_font": {
                    "description": "A font family, one of the design’s `fonts` (`Inter`, `Times New Roman`).",
                    "type": "string"
                  },
                  "heading_weight": {
                    "description": "Heading weight: 400, 600 or 700.",
                    "type": "integer"
                  },
                  "use_accent_color": {
                    "description": "Lines and dividers in the shared accent colour (off: `border_color`).",
                    "type": "boolean"
                  },
                  "use_brand_colors": {
                    "description": "Print with the document’s brand colour instead of the colours above.",
                    "type": "boolean"
                  }
                },
                "type": "object"
              },
              "block_order": {
                "description": "The blocks in print order (only the design’s `blocks`).",
                "items": {
                  "enum": [
                    "header",
                    "line_items",
                    "vendor_notes",
                    "summary",
                    "terms",
                    "wire",
                    "memo",
                    "credit_card_auth",
                    "rental_agreement",
                    "product_hero",
                    "product_details"
                  ],
                  "type": "string"
                },
                "type": "array"
              },
              "customization": {
                "description": "What prints on the lines and around them.",
                "properties": {
                  "brand_line": {
                    "description": "Print a line’s brand: `always`, when it `differs` from the document’s, or `never`.",
                    "enum": ["always", "differs", "never"],
                    "type": "string"
                  },
                  "description": {
                    "description": "Print item descriptions.",
                    "type": "boolean"
                  },
                  "discount": {
                    "description": "Print the discount column.",
                    "type": "boolean"
                  },
                  "header": {
                    "description": "Print the header.",
                    "type": "boolean"
                  },
                  "image_size": {
                    "description": "Picture size.",
                    "enum": ["small", "medium", "large"],
                    "type": "string"
                  },
                  "images": {
                    "description": "Print line pictures.",
                    "type": "boolean"
                  },
                  "spacing": {
                    "description": "Spacing.",
                    "enum": ["compact", "regular", "wide"],
                    "type": "string"
                  },
                  "supplier": {
                    "description": "Print the supplier.",
                    "type": "boolean"
                  },
                  "text_size": {
                    "description": "Text size.",
                    "enum": ["small", "medium", "large"],
                    "type": "string"
                  }
                },
                "type": "object"
              },
              "gallery": {
                "description": "Layout A designs only: the layout and its options.",
                "properties": {
                  "brand_line": {
                    "description": "Print a line’s brand: `always`, when it `differs` from the document’s, or `never`.",
                    "enum": ["always", "differs", "never"],
                    "type": "string"
                  },
                  "description": {
                    "description": "Print item descriptions.",
                    "type": "boolean"
                  },
                  "design": {
                    "description": "The layout.",
                    "enum": [
                      "standard",
                      "atelier",
                      "gallery",
                      "ledger",
                      "studio",
                      "heritage",
                      "nordic",
                      "compact",
                      "proposal"
                    ],
                    "type": "string"
                  },
                  "discount": {
                    "description": "Print the discount column.",
                    "type": "boolean"
                  },
                  "header": {
                    "description": "Print the header.",
                    "type": "boolean"
                  },
                  "image_size": {
                    "description": "Picture size.",
                    "enum": ["small", "medium", "large"],
                    "type": "string"
                  },
                  "images": {
                    "description": "Print line pictures.",
                    "type": "boolean"
                  },
                  "spacing": {
                    "description": "Spacing.",
                    "enum": ["compact", "regular", "wide"],
                    "type": "string"
                  },
                  "supplier": {
                    "description": "Print the supplier.",
                    "type": "boolean"
                  },
                  "text_size": {
                    "description": "Text size.",
                    "enum": ["small", "medium", "large"],
                    "type": "string"
                  }
                },
                "type": "object"
              },
              "header": {
                "description": "Quotes, orders, invoices and purchase orders: the rows under Bill to, Ship to and the date column, their titles, and how dates read. Replaces the design’s whole header.",
                "properties": {
                  "clock": {
                    "enum": ["12h", "24h"],
                    "type": "string"
                  },
                  "date_format": {
                    "description": "How dates read: `short_month_first` (Nov 24, 2026), `short_day_first` (24 Nov 2026), `long_month_first` (November 24, 2026), `numeric_month_first` (11/24/2026), `numeric_day_first` (24/11/2026) or `iso` (2026-11-24).",
                    "enum": [
                      "short_month_first",
                      "short_day_first",
                      "long_month_first",
                      "numeric_month_first",
                      "numeric_day_first",
                      "iso"
                    ],
                    "type": "string"
                  },
                  "party_rows": {
                    "description": "Only `true`: the party rows are set.",
                    "type": "boolean"
                  },
                  "rows": {
                    "properties": {
                      "bill_to": {
                        "items": {
                          "description": "One row, one of four shapes: `{ field, label? }` (a document fact), `{ label, text }` (your own text), `{ order_field, name, label? }` (one of the store’s order fields, by its `id` in `order_fields`) or `{ party, label? }` (Bill to and Ship to only). `label` absent prints the automatic one; empty prints the value alone.",
                          "properties": {
                            "field": {
                              "description": "A document fact.",
                              "enum": [
                                "document_date",
                                "created_at",
                                "sent_at",
                                "valid_until",
                                "requested_delivery",
                                "status",
                                "sales_person",
                                "sales_email"
                              ],
                              "type": "string"
                            },
                            "label": {
                              "description": "The row’s label, up to 40 characters.",
                              "type": "string"
                            },
                            "name": {
                              "description": "The order field’s name, as `order_fields` lists it.",
                              "type": "string"
                            },
                            "order_field": {
                              "description": "An order field’s `id` from `order_fields` (quotes, orders and invoices).",
                              "type": "string"
                            },
                            "party": {
                              "description": "A part of the column’s party.",
                              "enum": ["name", "address", "phone"],
                              "type": "string"
                            },
                            "text": {
                              "description": "Your own text, up to 120 characters.",
                              "type": "string"
                            }
                          },
                          "type": "object"
                        },
                        "type": "array"
                      },
                      "details": {
                        "items": {
                          "description": "One row, one of four shapes: `{ field, label? }` (a document fact), `{ label, text }` (your own text), `{ order_field, name, label? }` (one of the store’s order fields, by its `id` in `order_fields`) or `{ party, label? }` (Bill to and Ship to only). `label` absent prints the automatic one; empty prints the value alone.",
                          "properties": {
                            "field": {
                              "description": "A document fact.",
                              "enum": [
                                "document_date",
                                "created_at",
                                "sent_at",
                                "valid_until",
                                "requested_delivery",
                                "status",
                                "sales_person",
                                "sales_email"
                              ],
                              "type": "string"
                            },
                            "label": {
                              "description": "The row’s label, up to 40 characters.",
                              "type": "string"
                            },
                            "name": {
                              "description": "The order field’s name, as `order_fields` lists it.",
                              "type": "string"
                            },
                            "order_field": {
                              "description": "An order field’s `id` from `order_fields` (quotes, orders and invoices).",
                              "type": "string"
                            },
                            "party": {
                              "description": "A part of the column’s party.",
                              "enum": ["name", "address", "phone"],
                              "type": "string"
                            },
                            "text": {
                              "description": "Your own text, up to 120 characters.",
                              "type": "string"
                            }
                          },
                          "type": "object"
                        },
                        "type": "array"
                      },
                      "ship_to": {
                        "items": {
                          "description": "One row, one of four shapes: `{ field, label? }` (a document fact), `{ label, text }` (your own text), `{ order_field, name, label? }` (one of the store’s order fields, by its `id` in `order_fields`) or `{ party, label? }` (Bill to and Ship to only). `label` absent prints the automatic one; empty prints the value alone.",
                          "properties": {
                            "field": {
                              "description": "A document fact.",
                              "enum": [
                                "document_date",
                                "created_at",
                                "sent_at",
                                "valid_until",
                                "requested_delivery",
                                "status",
                                "sales_person",
                                "sales_email"
                              ],
                              "type": "string"
                            },
                            "label": {
                              "description": "The row’s label, up to 40 characters.",
                              "type": "string"
                            },
                            "name": {
                              "description": "The order field’s name, as `order_fields` lists it.",
                              "type": "string"
                            },
                            "order_field": {
                              "description": "An order field’s `id` from `order_fields` (quotes, orders and invoices).",
                              "type": "string"
                            },
                            "party": {
                              "description": "A part of the column’s party.",
                              "enum": ["name", "address", "phone"],
                              "type": "string"
                            },
                            "text": {
                              "description": "Your own text, up to 120 characters.",
                              "type": "string"
                            }
                          },
                          "type": "object"
                        },
                        "type": "array"
                      }
                    },
                    "type": "object"
                  },
                  "time": {
                    "enum": ["datetime", "date"],
                    "type": "string"
                  },
                  "time_zone": {
                    "description": "`store`, or an IANA time zone.",
                    "type": "string"
                  },
                  "titles": {
                    "properties": {
                      "bill_to": {
                        "type": "string"
                      },
                      "details": {
                        "type": "string"
                      },
                      "ship_to": {
                        "type": "string"
                      }
                    },
                    "type": "object"
                  },
                  "valid_for_days": {
                    "description": "Valid until: days, 1–365.",
                    "type": "integer"
                  }
                },
                "type": "object"
              },
              "hidden_blocks": {
                "description": "The blocks left out (only those whose `can_hide` is true).",
                "items": {
                  "enum": [
                    "header",
                    "line_items",
                    "vendor_notes",
                    "summary",
                    "terms",
                    "wire",
                    "memo",
                    "credit_card_auth",
                    "rental_agreement",
                    "product_hero",
                    "product_details"
                  ],
                  "type": "string"
                },
                "type": "array"
              },
              "job": {
                "description": "Job sheets only: the layout and the optional sections.",
                "properties": {
                  "design": {
                    "enum": ["standard", "field", "compact", "ticket"],
                    "type": "string"
                  },
                  "sections": {
                    "properties": {
                      "coverage": {
                        "type": "boolean"
                      },
                      "earlier_visits": {
                        "type": "boolean"
                      },
                      "header": {
                        "type": "boolean"
                      },
                      "parts": {
                        "type": "boolean"
                      },
                      "product_details": {
                        "type": "boolean"
                      },
                      "sale": {
                        "type": "boolean"
                      }
                    },
                    "type": "object"
                  }
                },
                "type": "object"
              },
              "sections": {
                "description": "Summary (totals and signature), terms and wire instructions. Quotes, orders and invoices always print their summary.",
                "properties": {
                  "summary": {
                    "type": "boolean"
                  },
                  "terms": {
                    "type": "boolean"
                  },
                  "wire": {
                    "type": "boolean"
                  }
                },
                "type": "object"
              },
              "spec": {
                "description": "Product spec sheets only.",
                "properties": {
                  "designer": {
                    "type": "boolean"
                  },
                  "detail_columns": {
                    "enum": ["preset", "one", "two"],
                    "type": "string"
                  },
                  "dimensions": {
                    "type": "boolean"
                  },
                  "finishes": {
                    "type": "boolean"
                  },
                  "image_placement": {
                    "enum": ["preset", "left", "right"],
                    "type": "string"
                  },
                  "notes": {
                    "type": "boolean"
                  },
                  "price": {
                    "type": "boolean"
                  },
                  "structure": {
                    "type": "boolean"
                  },
                  "swatch_layout": {
                    "enum": ["chips", "list"],
                    "type": "string"
                  },
                  "technical_drawing": {
                    "type": "boolean"
                  }
                },
                "type": "object"
              }
            },
            "type": "object"
          },
          "source_id": {
            "description": "The design to start from: an `id` from `GET /settings/documents` (its document type is the new theme’s).",
            "type": "string"
          },
          "store_default": {
            "description": "True: also what the store prints (a location with no brand). False is refused (`400`): the store’s design is chosen with `POST /settings/documents/assign`.",
            "type": "boolean"
          }
        },
        "required": ["source_id", "name"],
        "type": "object"
      },
      "SettingsDocumentPreview": {
        "properties": {
          "options": {
            "description": "The theme editor’s controls. A part left out stays as the source design has it; in a part sent, the fields left out do too (`{ appearance: { heading_color } }` changes one colour). `header`, `block_order` and `hidden_blocks` are replaced whole. Fonts are family names and colours `#RRGGBB`; every fixed choice (block ids, header fields, sizes, date formats) is snake_case.",
            "properties": {
              "appearance": {
                "description": "Colours and fonts.",
                "properties": {
                  "body_color": {
                    "description": "A six-digit hex colour, `#RRGGBB`.",
                    "type": "string"
                  },
                  "body_font": {
                    "description": "A font family, one of the design’s `fonts` (`Inter`, `Times New Roman`).",
                    "type": "string"
                  },
                  "border_color": {
                    "description": "A six-digit hex colour, `#RRGGBB`.",
                    "type": "string"
                  },
                  "header_color": {
                    "description": "A six-digit hex colour, `#RRGGBB`.",
                    "type": "string"
                  },
                  "heading_color": {
                    "description": "A six-digit hex colour, `#RRGGBB`.",
                    "type": "string"
                  },
                  "heading_font": {
                    "description": "A font family, one of the design’s `fonts` (`Inter`, `Times New Roman`).",
                    "type": "string"
                  },
                  "heading_weight": {
                    "description": "Heading weight: 400, 600 or 700.",
                    "type": "integer"
                  },
                  "use_accent_color": {
                    "description": "Lines and dividers in the shared accent colour (off: `border_color`).",
                    "type": "boolean"
                  },
                  "use_brand_colors": {
                    "description": "Print with the document’s brand colour instead of the colours above.",
                    "type": "boolean"
                  }
                },
                "type": "object"
              },
              "block_order": {
                "description": "The blocks in print order (only the design’s `blocks`).",
                "items": {
                  "enum": [
                    "header",
                    "line_items",
                    "vendor_notes",
                    "summary",
                    "terms",
                    "wire",
                    "memo",
                    "credit_card_auth",
                    "rental_agreement",
                    "product_hero",
                    "product_details"
                  ],
                  "type": "string"
                },
                "type": "array"
              },
              "customization": {
                "description": "What prints on the lines and around them.",
                "properties": {
                  "brand_line": {
                    "description": "Print a line’s brand: `always`, when it `differs` from the document’s, or `never`.",
                    "enum": ["always", "differs", "never"],
                    "type": "string"
                  },
                  "description": {
                    "description": "Print item descriptions.",
                    "type": "boolean"
                  },
                  "discount": {
                    "description": "Print the discount column.",
                    "type": "boolean"
                  },
                  "header": {
                    "description": "Print the header.",
                    "type": "boolean"
                  },
                  "image_size": {
                    "description": "Picture size.",
                    "enum": ["small", "medium", "large"],
                    "type": "string"
                  },
                  "images": {
                    "description": "Print line pictures.",
                    "type": "boolean"
                  },
                  "spacing": {
                    "description": "Spacing.",
                    "enum": ["compact", "regular", "wide"],
                    "type": "string"
                  },
                  "supplier": {
                    "description": "Print the supplier.",
                    "type": "boolean"
                  },
                  "text_size": {
                    "description": "Text size.",
                    "enum": ["small", "medium", "large"],
                    "type": "string"
                  }
                },
                "type": "object"
              },
              "gallery": {
                "description": "Layout A designs only: the layout and its options.",
                "properties": {
                  "brand_line": {
                    "description": "Print a line’s brand: `always`, when it `differs` from the document’s, or `never`.",
                    "enum": ["always", "differs", "never"],
                    "type": "string"
                  },
                  "description": {
                    "description": "Print item descriptions.",
                    "type": "boolean"
                  },
                  "design": {
                    "description": "The layout.",
                    "enum": [
                      "standard",
                      "atelier",
                      "gallery",
                      "ledger",
                      "studio",
                      "heritage",
                      "nordic",
                      "compact",
                      "proposal"
                    ],
                    "type": "string"
                  },
                  "discount": {
                    "description": "Print the discount column.",
                    "type": "boolean"
                  },
                  "header": {
                    "description": "Print the header.",
                    "type": "boolean"
                  },
                  "image_size": {
                    "description": "Picture size.",
                    "enum": ["small", "medium", "large"],
                    "type": "string"
                  },
                  "images": {
                    "description": "Print line pictures.",
                    "type": "boolean"
                  },
                  "spacing": {
                    "description": "Spacing.",
                    "enum": ["compact", "regular", "wide"],
                    "type": "string"
                  },
                  "supplier": {
                    "description": "Print the supplier.",
                    "type": "boolean"
                  },
                  "text_size": {
                    "description": "Text size.",
                    "enum": ["small", "medium", "large"],
                    "type": "string"
                  }
                },
                "type": "object"
              },
              "header": {
                "description": "Quotes, orders, invoices and purchase orders: the rows under Bill to, Ship to and the date column, their titles, and how dates read. Replaces the design’s whole header.",
                "properties": {
                  "clock": {
                    "enum": ["12h", "24h"],
                    "type": "string"
                  },
                  "date_format": {
                    "description": "How dates read: `short_month_first` (Nov 24, 2026), `short_day_first` (24 Nov 2026), `long_month_first` (November 24, 2026), `numeric_month_first` (11/24/2026), `numeric_day_first` (24/11/2026) or `iso` (2026-11-24).",
                    "enum": [
                      "short_month_first",
                      "short_day_first",
                      "long_month_first",
                      "numeric_month_first",
                      "numeric_day_first",
                      "iso"
                    ],
                    "type": "string"
                  },
                  "party_rows": {
                    "description": "Only `true`: the party rows are set.",
                    "type": "boolean"
                  },
                  "rows": {
                    "properties": {
                      "bill_to": {
                        "items": {
                          "description": "One row, one of four shapes: `{ field, label? }` (a document fact), `{ label, text }` (your own text), `{ order_field, name, label? }` (one of the store’s order fields, by its `id` in `order_fields`) or `{ party, label? }` (Bill to and Ship to only). `label` absent prints the automatic one; empty prints the value alone.",
                          "properties": {
                            "field": {
                              "description": "A document fact.",
                              "enum": [
                                "document_date",
                                "created_at",
                                "sent_at",
                                "valid_until",
                                "requested_delivery",
                                "status",
                                "sales_person",
                                "sales_email"
                              ],
                              "type": "string"
                            },
                            "label": {
                              "description": "The row’s label, up to 40 characters.",
                              "type": "string"
                            },
                            "name": {
                              "description": "The order field’s name, as `order_fields` lists it.",
                              "type": "string"
                            },
                            "order_field": {
                              "description": "An order field’s `id` from `order_fields` (quotes, orders and invoices).",
                              "type": "string"
                            },
                            "party": {
                              "description": "A part of the column’s party.",
                              "enum": ["name", "address", "phone"],
                              "type": "string"
                            },
                            "text": {
                              "description": "Your own text, up to 120 characters.",
                              "type": "string"
                            }
                          },
                          "type": "object"
                        },
                        "type": "array"
                      },
                      "details": {
                        "items": {
                          "description": "One row, one of four shapes: `{ field, label? }` (a document fact), `{ label, text }` (your own text), `{ order_field, name, label? }` (one of the store’s order fields, by its `id` in `order_fields`) or `{ party, label? }` (Bill to and Ship to only). `label` absent prints the automatic one; empty prints the value alone.",
                          "properties": {
                            "field": {
                              "description": "A document fact.",
                              "enum": [
                                "document_date",
                                "created_at",
                                "sent_at",
                                "valid_until",
                                "requested_delivery",
                                "status",
                                "sales_person",
                                "sales_email"
                              ],
                              "type": "string"
                            },
                            "label": {
                              "description": "The row’s label, up to 40 characters.",
                              "type": "string"
                            },
                            "name": {
                              "description": "The order field’s name, as `order_fields` lists it.",
                              "type": "string"
                            },
                            "order_field": {
                              "description": "An order field’s `id` from `order_fields` (quotes, orders and invoices).",
                              "type": "string"
                            },
                            "party": {
                              "description": "A part of the column’s party.",
                              "enum": ["name", "address", "phone"],
                              "type": "string"
                            },
                            "text": {
                              "description": "Your own text, up to 120 characters.",
                              "type": "string"
                            }
                          },
                          "type": "object"
                        },
                        "type": "array"
                      },
                      "ship_to": {
                        "items": {
                          "description": "One row, one of four shapes: `{ field, label? }` (a document fact), `{ label, text }` (your own text), `{ order_field, name, label? }` (one of the store’s order fields, by its `id` in `order_fields`) or `{ party, label? }` (Bill to and Ship to only). `label` absent prints the automatic one; empty prints the value alone.",
                          "properties": {
                            "field": {
                              "description": "A document fact.",
                              "enum": [
                                "document_date",
                                "created_at",
                                "sent_at",
                                "valid_until",
                                "requested_delivery",
                                "status",
                                "sales_person",
                                "sales_email"
                              ],
                              "type": "string"
                            },
                            "label": {
                              "description": "The row’s label, up to 40 characters.",
                              "type": "string"
                            },
                            "name": {
                              "description": "The order field’s name, as `order_fields` lists it.",
                              "type": "string"
                            },
                            "order_field": {
                              "description": "An order field’s `id` from `order_fields` (quotes, orders and invoices).",
                              "type": "string"
                            },
                            "party": {
                              "description": "A part of the column’s party.",
                              "enum": ["name", "address", "phone"],
                              "type": "string"
                            },
                            "text": {
                              "description": "Your own text, up to 120 characters.",
                              "type": "string"
                            }
                          },
                          "type": "object"
                        },
                        "type": "array"
                      }
                    },
                    "type": "object"
                  },
                  "time": {
                    "enum": ["datetime", "date"],
                    "type": "string"
                  },
                  "time_zone": {
                    "description": "`store`, or an IANA time zone.",
                    "type": "string"
                  },
                  "titles": {
                    "properties": {
                      "bill_to": {
                        "type": "string"
                      },
                      "details": {
                        "type": "string"
                      },
                      "ship_to": {
                        "type": "string"
                      }
                    },
                    "type": "object"
                  },
                  "valid_for_days": {
                    "description": "Valid until: days, 1–365.",
                    "type": "integer"
                  }
                },
                "type": "object"
              },
              "hidden_blocks": {
                "description": "The blocks left out (only those whose `can_hide` is true).",
                "items": {
                  "enum": [
                    "header",
                    "line_items",
                    "vendor_notes",
                    "summary",
                    "terms",
                    "wire",
                    "memo",
                    "credit_card_auth",
                    "rental_agreement",
                    "product_hero",
                    "product_details"
                  ],
                  "type": "string"
                },
                "type": "array"
              },
              "job": {
                "description": "Job sheets only: the layout and the optional sections.",
                "properties": {
                  "design": {
                    "enum": ["standard", "field", "compact", "ticket"],
                    "type": "string"
                  },
                  "sections": {
                    "properties": {
                      "coverage": {
                        "type": "boolean"
                      },
                      "earlier_visits": {
                        "type": "boolean"
                      },
                      "header": {
                        "type": "boolean"
                      },
                      "parts": {
                        "type": "boolean"
                      },
                      "product_details": {
                        "type": "boolean"
                      },
                      "sale": {
                        "type": "boolean"
                      }
                    },
                    "type": "object"
                  }
                },
                "type": "object"
              },
              "sections": {
                "description": "Summary (totals and signature), terms and wire instructions. Quotes, orders and invoices always print their summary.",
                "properties": {
                  "summary": {
                    "type": "boolean"
                  },
                  "terms": {
                    "type": "boolean"
                  },
                  "wire": {
                    "type": "boolean"
                  }
                },
                "type": "object"
              },
              "spec": {
                "description": "Product spec sheets only.",
                "properties": {
                  "designer": {
                    "type": "boolean"
                  },
                  "detail_columns": {
                    "enum": ["preset", "one", "two"],
                    "type": "string"
                  },
                  "dimensions": {
                    "type": "boolean"
                  },
                  "finishes": {
                    "type": "boolean"
                  },
                  "image_placement": {
                    "enum": ["preset", "left", "right"],
                    "type": "string"
                  },
                  "notes": {
                    "type": "boolean"
                  },
                  "price": {
                    "type": "boolean"
                  },
                  "structure": {
                    "type": "boolean"
                  },
                  "swatch_layout": {
                    "enum": ["chips", "list"],
                    "type": "string"
                  },
                  "technical_drawing": {
                    "type": "boolean"
                  }
                },
                "type": "object"
              }
            },
            "type": "object"
          },
          "source_id": {
            "description": "The design to draw: an `id` from `GET /settings/documents`.",
            "type": "string"
          }
        },
        "required": ["source_id"],
        "type": "object"
      },
      "SettingsDocumentUpdate": {
        "properties": {
          "brand_ids": {
            "description": "Exactly the brands that print it (from `GET /brands`); left out: unchanged.",
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "expected_version": {
            "description": "The theme’s `version` from `GET /settings/documents`.",
            "type": "integer"
          },
          "name": {
            "description": "A new name, 1–80 characters.",
            "type": "string"
          },
          "options": {
            "description": "The theme editor’s controls. A part left out stays as the source design has it; in a part sent, the fields left out do too (`{ appearance: { heading_color } }` changes one colour). `header`, `block_order` and `hidden_blocks` are replaced whole. Fonts are family names and colours `#RRGGBB`; every fixed choice (block ids, header fields, sizes, date formats) is snake_case.",
            "properties": {
              "appearance": {
                "description": "Colours and fonts.",
                "properties": {
                  "body_color": {
                    "description": "A six-digit hex colour, `#RRGGBB`.",
                    "type": "string"
                  },
                  "body_font": {
                    "description": "A font family, one of the design’s `fonts` (`Inter`, `Times New Roman`).",
                    "type": "string"
                  },
                  "border_color": {
                    "description": "A six-digit hex colour, `#RRGGBB`.",
                    "type": "string"
                  },
                  "header_color": {
                    "description": "A six-digit hex colour, `#RRGGBB`.",
                    "type": "string"
                  },
                  "heading_color": {
                    "description": "A six-digit hex colour, `#RRGGBB`.",
                    "type": "string"
                  },
                  "heading_font": {
                    "description": "A font family, one of the design’s `fonts` (`Inter`, `Times New Roman`).",
                    "type": "string"
                  },
                  "heading_weight": {
                    "description": "Heading weight: 400, 600 or 700.",
                    "type": "integer"
                  },
                  "use_accent_color": {
                    "description": "Lines and dividers in the shared accent colour (off: `border_color`).",
                    "type": "boolean"
                  },
                  "use_brand_colors": {
                    "description": "Print with the document’s brand colour instead of the colours above.",
                    "type": "boolean"
                  }
                },
                "type": "object"
              },
              "block_order": {
                "description": "The blocks in print order (only the design’s `blocks`).",
                "items": {
                  "enum": [
                    "header",
                    "line_items",
                    "vendor_notes",
                    "summary",
                    "terms",
                    "wire",
                    "memo",
                    "credit_card_auth",
                    "rental_agreement",
                    "product_hero",
                    "product_details"
                  ],
                  "type": "string"
                },
                "type": "array"
              },
              "customization": {
                "description": "What prints on the lines and around them.",
                "properties": {
                  "brand_line": {
                    "description": "Print a line’s brand: `always`, when it `differs` from the document’s, or `never`.",
                    "enum": ["always", "differs", "never"],
                    "type": "string"
                  },
                  "description": {
                    "description": "Print item descriptions.",
                    "type": "boolean"
                  },
                  "discount": {
                    "description": "Print the discount column.",
                    "type": "boolean"
                  },
                  "header": {
                    "description": "Print the header.",
                    "type": "boolean"
                  },
                  "image_size": {
                    "description": "Picture size.",
                    "enum": ["small", "medium", "large"],
                    "type": "string"
                  },
                  "images": {
                    "description": "Print line pictures.",
                    "type": "boolean"
                  },
                  "spacing": {
                    "description": "Spacing.",
                    "enum": ["compact", "regular", "wide"],
                    "type": "string"
                  },
                  "supplier": {
                    "description": "Print the supplier.",
                    "type": "boolean"
                  },
                  "text_size": {
                    "description": "Text size.",
                    "enum": ["small", "medium", "large"],
                    "type": "string"
                  }
                },
                "type": "object"
              },
              "gallery": {
                "description": "Layout A designs only: the layout and its options.",
                "properties": {
                  "brand_line": {
                    "description": "Print a line’s brand: `always`, when it `differs` from the document’s, or `never`.",
                    "enum": ["always", "differs", "never"],
                    "type": "string"
                  },
                  "description": {
                    "description": "Print item descriptions.",
                    "type": "boolean"
                  },
                  "design": {
                    "description": "The layout.",
                    "enum": [
                      "standard",
                      "atelier",
                      "gallery",
                      "ledger",
                      "studio",
                      "heritage",
                      "nordic",
                      "compact",
                      "proposal"
                    ],
                    "type": "string"
                  },
                  "discount": {
                    "description": "Print the discount column.",
                    "type": "boolean"
                  },
                  "header": {
                    "description": "Print the header.",
                    "type": "boolean"
                  },
                  "image_size": {
                    "description": "Picture size.",
                    "enum": ["small", "medium", "large"],
                    "type": "string"
                  },
                  "images": {
                    "description": "Print line pictures.",
                    "type": "boolean"
                  },
                  "spacing": {
                    "description": "Spacing.",
                    "enum": ["compact", "regular", "wide"],
                    "type": "string"
                  },
                  "supplier": {
                    "description": "Print the supplier.",
                    "type": "boolean"
                  },
                  "text_size": {
                    "description": "Text size.",
                    "enum": ["small", "medium", "large"],
                    "type": "string"
                  }
                },
                "type": "object"
              },
              "header": {
                "description": "Quotes, orders, invoices and purchase orders: the rows under Bill to, Ship to and the date column, their titles, and how dates read. Replaces the design’s whole header.",
                "properties": {
                  "clock": {
                    "enum": ["12h", "24h"],
                    "type": "string"
                  },
                  "date_format": {
                    "description": "How dates read: `short_month_first` (Nov 24, 2026), `short_day_first` (24 Nov 2026), `long_month_first` (November 24, 2026), `numeric_month_first` (11/24/2026), `numeric_day_first` (24/11/2026) or `iso` (2026-11-24).",
                    "enum": [
                      "short_month_first",
                      "short_day_first",
                      "long_month_first",
                      "numeric_month_first",
                      "numeric_day_first",
                      "iso"
                    ],
                    "type": "string"
                  },
                  "party_rows": {
                    "description": "Only `true`: the party rows are set.",
                    "type": "boolean"
                  },
                  "rows": {
                    "properties": {
                      "bill_to": {
                        "items": {
                          "description": "One row, one of four shapes: `{ field, label? }` (a document fact), `{ label, text }` (your own text), `{ order_field, name, label? }` (one of the store’s order fields, by its `id` in `order_fields`) or `{ party, label? }` (Bill to and Ship to only). `label` absent prints the automatic one; empty prints the value alone.",
                          "properties": {
                            "field": {
                              "description": "A document fact.",
                              "enum": [
                                "document_date",
                                "created_at",
                                "sent_at",
                                "valid_until",
                                "requested_delivery",
                                "status",
                                "sales_person",
                                "sales_email"
                              ],
                              "type": "string"
                            },
                            "label": {
                              "description": "The row’s label, up to 40 characters.",
                              "type": "string"
                            },
                            "name": {
                              "description": "The order field’s name, as `order_fields` lists it.",
                              "type": "string"
                            },
                            "order_field": {
                              "description": "An order field’s `id` from `order_fields` (quotes, orders and invoices).",
                              "type": "string"
                            },
                            "party": {
                              "description": "A part of the column’s party.",
                              "enum": ["name", "address", "phone"],
                              "type": "string"
                            },
                            "text": {
                              "description": "Your own text, up to 120 characters.",
                              "type": "string"
                            }
                          },
                          "type": "object"
                        },
                        "type": "array"
                      },
                      "details": {
                        "items": {
                          "description": "One row, one of four shapes: `{ field, label? }` (a document fact), `{ label, text }` (your own text), `{ order_field, name, label? }` (one of the store’s order fields, by its `id` in `order_fields`) or `{ party, label? }` (Bill to and Ship to only). `label` absent prints the automatic one; empty prints the value alone.",
                          "properties": {
                            "field": {
                              "description": "A document fact.",
                              "enum": [
                                "document_date",
                                "created_at",
                                "sent_at",
                                "valid_until",
                                "requested_delivery",
                                "status",
                                "sales_person",
                                "sales_email"
                              ],
                              "type": "string"
                            },
                            "label": {
                              "description": "The row’s label, up to 40 characters.",
                              "type": "string"
                            },
                            "name": {
                              "description": "The order field’s name, as `order_fields` lists it.",
                              "type": "string"
                            },
                            "order_field": {
                              "description": "An order field’s `id` from `order_fields` (quotes, orders and invoices).",
                              "type": "string"
                            },
                            "party": {
                              "description": "A part of the column’s party.",
                              "enum": ["name", "address", "phone"],
                              "type": "string"
                            },
                            "text": {
                              "description": "Your own text, up to 120 characters.",
                              "type": "string"
                            }
                          },
                          "type": "object"
                        },
                        "type": "array"
                      },
                      "ship_to": {
                        "items": {
                          "description": "One row, one of four shapes: `{ field, label? }` (a document fact), `{ label, text }` (your own text), `{ order_field, name, label? }` (one of the store’s order fields, by its `id` in `order_fields`) or `{ party, label? }` (Bill to and Ship to only). `label` absent prints the automatic one; empty prints the value alone.",
                          "properties": {
                            "field": {
                              "description": "A document fact.",
                              "enum": [
                                "document_date",
                                "created_at",
                                "sent_at",
                                "valid_until",
                                "requested_delivery",
                                "status",
                                "sales_person",
                                "sales_email"
                              ],
                              "type": "string"
                            },
                            "label": {
                              "description": "The row’s label, up to 40 characters.",
                              "type": "string"
                            },
                            "name": {
                              "description": "The order field’s name, as `order_fields` lists it.",
                              "type": "string"
                            },
                            "order_field": {
                              "description": "An order field’s `id` from `order_fields` (quotes, orders and invoices).",
                              "type": "string"
                            },
                            "party": {
                              "description": "A part of the column’s party.",
                              "enum": ["name", "address", "phone"],
                              "type": "string"
                            },
                            "text": {
                              "description": "Your own text, up to 120 characters.",
                              "type": "string"
                            }
                          },
                          "type": "object"
                        },
                        "type": "array"
                      }
                    },
                    "type": "object"
                  },
                  "time": {
                    "enum": ["datetime", "date"],
                    "type": "string"
                  },
                  "time_zone": {
                    "description": "`store`, or an IANA time zone.",
                    "type": "string"
                  },
                  "titles": {
                    "properties": {
                      "bill_to": {
                        "type": "string"
                      },
                      "details": {
                        "type": "string"
                      },
                      "ship_to": {
                        "type": "string"
                      }
                    },
                    "type": "object"
                  },
                  "valid_for_days": {
                    "description": "Valid until: days, 1–365.",
                    "type": "integer"
                  }
                },
                "type": "object"
              },
              "hidden_blocks": {
                "description": "The blocks left out (only those whose `can_hide` is true).",
                "items": {
                  "enum": [
                    "header",
                    "line_items",
                    "vendor_notes",
                    "summary",
                    "terms",
                    "wire",
                    "memo",
                    "credit_card_auth",
                    "rental_agreement",
                    "product_hero",
                    "product_details"
                  ],
                  "type": "string"
                },
                "type": "array"
              },
              "job": {
                "description": "Job sheets only: the layout and the optional sections.",
                "properties": {
                  "design": {
                    "enum": ["standard", "field", "compact", "ticket"],
                    "type": "string"
                  },
                  "sections": {
                    "properties": {
                      "coverage": {
                        "type": "boolean"
                      },
                      "earlier_visits": {
                        "type": "boolean"
                      },
                      "header": {
                        "type": "boolean"
                      },
                      "parts": {
                        "type": "boolean"
                      },
                      "product_details": {
                        "type": "boolean"
                      },
                      "sale": {
                        "type": "boolean"
                      }
                    },
                    "type": "object"
                  }
                },
                "type": "object"
              },
              "sections": {
                "description": "Summary (totals and signature), terms and wire instructions. Quotes, orders and invoices always print their summary.",
                "properties": {
                  "summary": {
                    "type": "boolean"
                  },
                  "terms": {
                    "type": "boolean"
                  },
                  "wire": {
                    "type": "boolean"
                  }
                },
                "type": "object"
              },
              "spec": {
                "description": "Product spec sheets only.",
                "properties": {
                  "designer": {
                    "type": "boolean"
                  },
                  "detail_columns": {
                    "enum": ["preset", "one", "two"],
                    "type": "string"
                  },
                  "dimensions": {
                    "type": "boolean"
                  },
                  "finishes": {
                    "type": "boolean"
                  },
                  "image_placement": {
                    "enum": ["preset", "left", "right"],
                    "type": "string"
                  },
                  "notes": {
                    "type": "boolean"
                  },
                  "price": {
                    "type": "boolean"
                  },
                  "structure": {
                    "type": "boolean"
                  },
                  "swatch_layout": {
                    "enum": ["chips", "list"],
                    "type": "string"
                  },
                  "technical_drawing": {
                    "type": "boolean"
                  }
                },
                "type": "object"
              }
            },
            "type": "object"
          },
          "store_default": {
            "description": "True: also what the store prints. False is refused (`400`): to stop the store printing it, choose the store’s design with `POST /settings/documents/assign` (`brand_id` null).",
            "type": "boolean"
          }
        },
        "required": ["expected_version"],
        "type": "object"
      },
      "SettingsDocuments": {
        "properties": {
          "brands": {
            "description": "Each brand and the design it prints per document (none listed: built in).",
            "items": {
              "properties": {
                "designs": {
                  "items": {
                    "properties": {
                      "design_id": {
                        "description": "The design’s `id` in `designs`.",
                        "type": "string"
                      },
                      "document_type": {
                        "enum": [
                          "sales_order",
                          "invoice",
                          "purchase_order",
                          "product_spec",
                          "job_sheet"
                        ],
                        "type": "string"
                      }
                    },
                    "required": ["document_type", "design_id"],
                    "type": "object"
                  },
                  "type": "array"
                },
                "id": {
                  "type": "string"
                },
                "name": {
                  "type": "string"
                }
              },
              "required": ["id", "name", "designs"],
              "type": "object"
            },
            "type": "array"
          },
          "designs": {
            "items": {
              "properties": {
                "blocks": {
                  "description": "The blocks its document prints, and whether each may be left out.",
                  "items": {
                    "properties": {
                      "can_hide": {
                        "type": "boolean"
                      },
                      "id": {
                        "type": "string"
                      }
                    },
                    "required": ["id", "can_hide"],
                    "type": "object"
                  },
                  "type": "array"
                },
                "brand_ids": {
                  "description": "The brands that print it.",
                  "items": {
                    "type": "string"
                  },
                  "type": "array"
                },
                "document_type": {
                  "enum": [
                    "sales_order",
                    "invoice",
                    "purchase_order",
                    "product_spec",
                    "job_sheet"
                  ],
                  "type": "string"
                },
                "fonts": {
                  "description": "The fonts its options may take.",
                  "items": {
                    "type": "string"
                  },
                  "type": "array"
                },
                "header_fields": {
                  "description": "The document facts a header row may print (`field`); empty without a header.",
                  "items": {
                    "type": "string"
                  },
                  "type": "array"
                },
                "id": {
                  "description": "`preset:<key>` (built in) or `theme:<id>` (the store’s own).",
                  "type": "string"
                },
                "kind": {
                  "enum": ["preset", "theme"],
                  "type": "string"
                },
                "name": {
                  "type": "string"
                },
                "options": {
                  "description": "Its options, as the editor opens them.",
                  "properties": {
                    "appearance": {
                      "description": "Colours and fonts.",
                      "properties": {
                        "body_color": {
                          "description": "A six-digit hex colour, `#RRGGBB`.",
                          "type": "string"
                        },
                        "body_font": {
                          "description": "A font family, one of the design’s `fonts` (`Inter`, `Times New Roman`).",
                          "type": "string"
                        },
                        "border_color": {
                          "description": "A six-digit hex colour, `#RRGGBB`.",
                          "type": "string"
                        },
                        "header_color": {
                          "description": "A six-digit hex colour, `#RRGGBB`.",
                          "type": "string"
                        },
                        "heading_color": {
                          "description": "A six-digit hex colour, `#RRGGBB`.",
                          "type": "string"
                        },
                        "heading_font": {
                          "description": "A font family, one of the design’s `fonts` (`Inter`, `Times New Roman`).",
                          "type": "string"
                        },
                        "heading_weight": {
                          "description": "Heading weight: 400, 600 or 700.",
                          "type": "integer"
                        },
                        "use_accent_color": {
                          "description": "Lines and dividers in the shared accent colour (off: `border_color`).",
                          "type": "boolean"
                        },
                        "use_brand_colors": {
                          "description": "Print with the document’s brand colour instead of the colours above.",
                          "type": "boolean"
                        }
                      },
                      "type": "object"
                    },
                    "block_order": {
                      "description": "The blocks in print order (only the design’s `blocks`).",
                      "items": {
                        "enum": [
                          "header",
                          "line_items",
                          "vendor_notes",
                          "summary",
                          "terms",
                          "wire",
                          "memo",
                          "credit_card_auth",
                          "rental_agreement",
                          "product_hero",
                          "product_details"
                        ],
                        "type": "string"
                      },
                      "type": "array"
                    },
                    "customization": {
                      "description": "What prints on the lines and around them.",
                      "properties": {
                        "brand_line": {
                          "description": "Print a line’s brand: `always`, when it `differs` from the document’s, or `never`.",
                          "enum": ["always", "differs", "never"],
                          "type": "string"
                        },
                        "description": {
                          "description": "Print item descriptions.",
                          "type": "boolean"
                        },
                        "discount": {
                          "description": "Print the discount column.",
                          "type": "boolean"
                        },
                        "header": {
                          "description": "Print the header.",
                          "type": "boolean"
                        },
                        "image_size": {
                          "description": "Picture size.",
                          "enum": ["small", "medium", "large"],
                          "type": "string"
                        },
                        "images": {
                          "description": "Print line pictures.",
                          "type": "boolean"
                        },
                        "spacing": {
                          "description": "Spacing.",
                          "enum": ["compact", "regular", "wide"],
                          "type": "string"
                        },
                        "supplier": {
                          "description": "Print the supplier.",
                          "type": "boolean"
                        },
                        "text_size": {
                          "description": "Text size.",
                          "enum": ["small", "medium", "large"],
                          "type": "string"
                        }
                      },
                      "type": "object"
                    },
                    "gallery": {
                      "description": "Layout A designs only: the layout and its options.",
                      "properties": {
                        "brand_line": {
                          "description": "Print a line’s brand: `always`, when it `differs` from the document’s, or `never`.",
                          "enum": ["always", "differs", "never"],
                          "type": "string"
                        },
                        "description": {
                          "description": "Print item descriptions.",
                          "type": "boolean"
                        },
                        "design": {
                          "description": "The layout.",
                          "enum": [
                            "standard",
                            "atelier",
                            "gallery",
                            "ledger",
                            "studio",
                            "heritage",
                            "nordic",
                            "compact",
                            "proposal"
                          ],
                          "type": "string"
                        },
                        "discount": {
                          "description": "Print the discount column.",
                          "type": "boolean"
                        },
                        "header": {
                          "description": "Print the header.",
                          "type": "boolean"
                        },
                        "image_size": {
                          "description": "Picture size.",
                          "enum": ["small", "medium", "large"],
                          "type": "string"
                        },
                        "images": {
                          "description": "Print line pictures.",
                          "type": "boolean"
                        },
                        "spacing": {
                          "description": "Spacing.",
                          "enum": ["compact", "regular", "wide"],
                          "type": "string"
                        },
                        "supplier": {
                          "description": "Print the supplier.",
                          "type": "boolean"
                        },
                        "text_size": {
                          "description": "Text size.",
                          "enum": ["small", "medium", "large"],
                          "type": "string"
                        }
                      },
                      "type": "object"
                    },
                    "header": {
                      "description": "Quotes, orders, invoices and purchase orders: the rows under Bill to, Ship to and the date column, their titles, and how dates read. Replaces the design’s whole header.",
                      "properties": {
                        "clock": {
                          "enum": ["12h", "24h"],
                          "type": "string"
                        },
                        "date_format": {
                          "description": "How dates read: `short_month_first` (Nov 24, 2026), `short_day_first` (24 Nov 2026), `long_month_first` (November 24, 2026), `numeric_month_first` (11/24/2026), `numeric_day_first` (24/11/2026) or `iso` (2026-11-24).",
                          "enum": [
                            "short_month_first",
                            "short_day_first",
                            "long_month_first",
                            "numeric_month_first",
                            "numeric_day_first",
                            "iso"
                          ],
                          "type": "string"
                        },
                        "party_rows": {
                          "description": "Only `true`: the party rows are set.",
                          "type": "boolean"
                        },
                        "rows": {
                          "properties": {
                            "bill_to": {
                              "items": {
                                "description": "One row, one of four shapes: `{ field, label? }` (a document fact), `{ label, text }` (your own text), `{ order_field, name, label? }` (one of the store’s order fields, by its `id` in `order_fields`) or `{ party, label? }` (Bill to and Ship to only). `label` absent prints the automatic one; empty prints the value alone.",
                                "properties": {
                                  "field": {
                                    "description": "A document fact.",
                                    "enum": [
                                      "document_date",
                                      "created_at",
                                      "sent_at",
                                      "valid_until",
                                      "requested_delivery",
                                      "status",
                                      "sales_person",
                                      "sales_email"
                                    ],
                                    "type": "string"
                                  },
                                  "label": {
                                    "description": "The row’s label, up to 40 characters.",
                                    "type": "string"
                                  },
                                  "name": {
                                    "description": "The order field’s name, as `order_fields` lists it.",
                                    "type": "string"
                                  },
                                  "order_field": {
                                    "description": "An order field’s `id` from `order_fields` (quotes, orders and invoices).",
                                    "type": "string"
                                  },
                                  "party": {
                                    "description": "A part of the column’s party.",
                                    "enum": ["name", "address", "phone"],
                                    "type": "string"
                                  },
                                  "text": {
                                    "description": "Your own text, up to 120 characters.",
                                    "type": "string"
                                  }
                                },
                                "type": "object"
                              },
                              "type": "array"
                            },
                            "details": {
                              "items": {
                                "description": "One row, one of four shapes: `{ field, label? }` (a document fact), `{ label, text }` (your own text), `{ order_field, name, label? }` (one of the store’s order fields, by its `id` in `order_fields`) or `{ party, label? }` (Bill to and Ship to only). `label` absent prints the automatic one; empty prints the value alone.",
                                "properties": {
                                  "field": {
                                    "description": "A document fact.",
                                    "enum": [
                                      "document_date",
                                      "created_at",
                                      "sent_at",
                                      "valid_until",
                                      "requested_delivery",
                                      "status",
                                      "sales_person",
                                      "sales_email"
                                    ],
                                    "type": "string"
                                  },
                                  "label": {
                                    "description": "The row’s label, up to 40 characters.",
                                    "type": "string"
                                  },
                                  "name": {
                                    "description": "The order field’s name, as `order_fields` lists it.",
                                    "type": "string"
                                  },
                                  "order_field": {
                                    "description": "An order field’s `id` from `order_fields` (quotes, orders and invoices).",
                                    "type": "string"
                                  },
                                  "party": {
                                    "description": "A part of the column’s party.",
                                    "enum": ["name", "address", "phone"],
                                    "type": "string"
                                  },
                                  "text": {
                                    "description": "Your own text, up to 120 characters.",
                                    "type": "string"
                                  }
                                },
                                "type": "object"
                              },
                              "type": "array"
                            },
                            "ship_to": {
                              "items": {
                                "description": "One row, one of four shapes: `{ field, label? }` (a document fact), `{ label, text }` (your own text), `{ order_field, name, label? }` (one of the store’s order fields, by its `id` in `order_fields`) or `{ party, label? }` (Bill to and Ship to only). `label` absent prints the automatic one; empty prints the value alone.",
                                "properties": {
                                  "field": {
                                    "description": "A document fact.",
                                    "enum": [
                                      "document_date",
                                      "created_at",
                                      "sent_at",
                                      "valid_until",
                                      "requested_delivery",
                                      "status",
                                      "sales_person",
                                      "sales_email"
                                    ],
                                    "type": "string"
                                  },
                                  "label": {
                                    "description": "The row’s label, up to 40 characters.",
                                    "type": "string"
                                  },
                                  "name": {
                                    "description": "The order field’s name, as `order_fields` lists it.",
                                    "type": "string"
                                  },
                                  "order_field": {
                                    "description": "An order field’s `id` from `order_fields` (quotes, orders and invoices).",
                                    "type": "string"
                                  },
                                  "party": {
                                    "description": "A part of the column’s party.",
                                    "enum": ["name", "address", "phone"],
                                    "type": "string"
                                  },
                                  "text": {
                                    "description": "Your own text, up to 120 characters.",
                                    "type": "string"
                                  }
                                },
                                "type": "object"
                              },
                              "type": "array"
                            }
                          },
                          "type": "object"
                        },
                        "time": {
                          "enum": ["datetime", "date"],
                          "type": "string"
                        },
                        "time_zone": {
                          "description": "`store`, or an IANA time zone.",
                          "type": "string"
                        },
                        "titles": {
                          "properties": {
                            "bill_to": {
                              "type": "string"
                            },
                            "details": {
                              "type": "string"
                            },
                            "ship_to": {
                              "type": "string"
                            }
                          },
                          "type": "object"
                        },
                        "valid_for_days": {
                          "description": "Valid until: days, 1–365.",
                          "type": "integer"
                        }
                      },
                      "type": "object"
                    },
                    "hidden_blocks": {
                      "description": "The blocks left out (only those whose `can_hide` is true).",
                      "items": {
                        "enum": [
                          "header",
                          "line_items",
                          "vendor_notes",
                          "summary",
                          "terms",
                          "wire",
                          "memo",
                          "credit_card_auth",
                          "rental_agreement",
                          "product_hero",
                          "product_details"
                        ],
                        "type": "string"
                      },
                      "type": "array"
                    },
                    "job": {
                      "description": "Job sheets only: the layout and the optional sections.",
                      "properties": {
                        "design": {
                          "enum": ["standard", "field", "compact", "ticket"],
                          "type": "string"
                        },
                        "sections": {
                          "properties": {
                            "coverage": {
                              "type": "boolean"
                            },
                            "earlier_visits": {
                              "type": "boolean"
                            },
                            "header": {
                              "type": "boolean"
                            },
                            "parts": {
                              "type": "boolean"
                            },
                            "product_details": {
                              "type": "boolean"
                            },
                            "sale": {
                              "type": "boolean"
                            }
                          },
                          "type": "object"
                        }
                      },
                      "type": "object"
                    },
                    "sections": {
                      "description": "Summary (totals and signature), terms and wire instructions. Quotes, orders and invoices always print their summary.",
                      "properties": {
                        "summary": {
                          "type": "boolean"
                        },
                        "terms": {
                          "type": "boolean"
                        },
                        "wire": {
                          "type": "boolean"
                        }
                      },
                      "type": "object"
                    },
                    "spec": {
                      "description": "Product spec sheets only.",
                      "properties": {
                        "designer": {
                          "type": "boolean"
                        },
                        "detail_columns": {
                          "enum": ["preset", "one", "two"],
                          "type": "string"
                        },
                        "dimensions": {
                          "type": "boolean"
                        },
                        "finishes": {
                          "type": "boolean"
                        },
                        "image_placement": {
                          "enum": ["preset", "left", "right"],
                          "type": "string"
                        },
                        "notes": {
                          "type": "boolean"
                        },
                        "price": {
                          "type": "boolean"
                        },
                        "structure": {
                          "type": "boolean"
                        },
                        "swatch_layout": {
                          "enum": ["chips", "list"],
                          "type": "string"
                        },
                        "technical_drawing": {
                          "type": "boolean"
                        }
                      },
                      "type": "object"
                    }
                  },
                  "type": "object"
                },
                "store_default": {
                  "description": "The store prints it (a location with no brand).",
                  "type": "boolean"
                },
                "version": {
                  "description": "A theme’s version, sent back as `expected_version` (1 for a built-in design).",
                  "type": "integer"
                }
              },
              "required": [
                "id",
                "kind",
                "name",
                "document_type",
                "version",
                "brand_ids",
                "store_default",
                "fonts",
                "blocks",
                "header_fields",
                "options"
              ],
              "type": "object"
            },
            "type": "array"
          },
          "order_fields": {
            "description": "The order fields a header row may print (`order_field`, `name`).",
            "items": {
              "properties": {
                "id": {
                  "type": "string"
                },
                "name": {
                  "type": "string"
                }
              },
              "required": ["id", "name"],
              "type": "object"
            },
            "type": "array"
          },
          "saved_id": {
            "description": "After a create or update: the theme’s `id`.",
            "type": "string"
          },
          "store_designs": {
            "description": "What a location with no brand prints, per document (none listed: built in).",
            "items": {
              "properties": {
                "design_id": {
                  "description": "The design’s `id` in `designs`.",
                  "type": "string"
                },
                "document_type": {
                  "enum": [
                    "sales_order",
                    "invoice",
                    "purchase_order",
                    "product_spec",
                    "job_sheet"
                  ],
                  "type": "string"
                }
              },
              "required": ["document_type", "design_id"],
              "type": "object"
            },
            "type": "array"
          }
        },
        "required": ["designs", "brands", "store_designs", "order_fields"],
        "type": "object"
      },
      "SettingsEmailRules": {
        "description": "Settings › Messages and notifications › Sending settings › Email and SMS rules.",
        "properties": {
          "manual_status_emails": {
            "description": "Send status emails when staff change a status.",
            "type": "boolean"
          },
          "order_created_email": {
            "description": "Send an email when an order is created.",
            "type": "boolean"
          },
          "quote_reminders": {
            "description": "Remind customers about unfinished quotes.",
            "type": "boolean"
          },
          "reminder_send_from_hour": {
            "description": "Sending hours: the shop-time hour (0–23) reminders may start going out. Null with `reminder_send_until_hour` null: any time.",
            "nullable": true,
            "type": "integer"
          },
          "reminder_send_until_hour": {
            "description": "Sending hours: the shop-time hour (0–23) reminders stop going out; an earlier one than the start wraps past midnight.",
            "nullable": true,
            "type": "integer"
          },
          "reminder_template_key": {
            "description": "The email template reminders send: a template’s `key`, as `GET /settings/status-map` lists them in `options.email_templates` (their `value`); null for Quote follow-up, the default.",
            "nullable": true,
            "type": "string"
          },
          "reminder_wait_hours": {
            "description": "Wait before reminding: 24, 48 or 72 hours, or 168 (1 week).",
            "type": "integer"
          },
          "send_customer_emails": {
            "description": "Send customer emails.",
            "type": "boolean"
          },
          "send_sms": {
            "description": "Send customer text messages.",
            "type": "boolean"
          },
          "signed_copy_email": {
            "description": "Email customers their signed copy.",
            "type": "boolean"
          }
        },
        "required": [
          "send_customer_emails",
          "order_created_email",
          "signed_copy_email",
          "manual_status_emails",
          "send_sms",
          "quote_reminders",
          "reminder_wait_hours",
          "reminder_template_key",
          "reminder_send_from_hour",
          "reminder_send_until_hour"
        ],
        "type": "object"
      },
      "SettingsEmailRulesUpdate": {
        "description": "Only the fields to change. A field the card doesn’t have is `400 INVALID_BODY`; a read-only one is ignored when sent unchanged.",
        "properties": {
          "manual_status_emails": {
            "description": "Send status emails when staff change a status.",
            "type": "boolean"
          },
          "order_created_email": {
            "description": "Send an email when an order is created.",
            "type": "boolean"
          },
          "quote_reminders": {
            "description": "Remind customers about unfinished quotes.",
            "type": "boolean"
          },
          "reminder_send_from_hour": {
            "description": "Sending hours: the shop-time hour (0–23) reminders may start going out. Null with `reminder_send_until_hour` null: any time.",
            "nullable": true,
            "type": "integer"
          },
          "reminder_send_until_hour": {
            "description": "Sending hours: the shop-time hour (0–23) reminders stop going out; an earlier one than the start wraps past midnight.",
            "nullable": true,
            "type": "integer"
          },
          "reminder_template_key": {
            "description": "The email template reminders send: a template’s `key`, as `GET /settings/status-map` lists them in `options.email_templates` (their `value`); null for Quote follow-up, the default.",
            "nullable": true,
            "type": "string"
          },
          "reminder_wait_hours": {
            "description": "Wait before reminding: 24, 48 or 72 hours, or 168 (1 week).",
            "type": "integer"
          },
          "send_customer_emails": {
            "description": "Send customer emails.",
            "type": "boolean"
          },
          "send_sms": {
            "description": "Send customer text messages.",
            "type": "boolean"
          },
          "signed_copy_email": {
            "description": "Email customers their signed copy.",
            "type": "boolean"
          }
        },
        "type": "object"
      },
      "SettingsFee": {
        "properties": {
          "active": {
            "description": "Offered on quotes and orders.",
            "type": "boolean"
          },
          "default": {
            "description": "One of the default fees (Restore default fees brings it back).",
            "type": "boolean"
          },
          "id": {
            "type": "string"
          },
          "name": {
            "description": "Up to 35 characters, unique in the store.",
            "type": "string"
          },
          "physical": {
            "description": "Shipped as a physical item.",
            "type": "boolean"
          },
          "taxable": {
            "type": "boolean"
          },
          "type": {
            "description": "A fixed amount, or a percentage of the discounted price, the total or the retail price.",
            "enum": [
              "fixed_amount",
              "percent_of_discounted_price",
              "percent_of_total",
              "percent_of_retail_price"
            ],
            "type": "string"
          },
          "value": {
            "description": "An amount for `fixed_amount` (0 or more, two decimals), else a percentage from 0 to 100.",
            "type": "number"
          }
        },
        "required": [
          "id",
          "name",
          "type",
          "value",
          "taxable",
          "physical",
          "active",
          "default"
        ],
        "type": "object"
      },
      "SettingsFeeCreate": {
        "properties": {
          "active": {
            "description": "Offered on quotes and orders.",
            "type": "boolean"
          },
          "name": {
            "description": "Up to 35 characters, unique in the store.",
            "type": "string"
          },
          "physical": {
            "description": "Shipped as a physical item.",
            "type": "boolean"
          },
          "taxable": {
            "type": "boolean"
          },
          "type": {
            "description": "Default `fixed_amount`.",
            "enum": [
              "fixed_amount",
              "percent_of_discounted_price",
              "percent_of_total",
              "percent_of_retail_price"
            ],
            "type": "string"
          },
          "value": {
            "description": "An amount for `fixed_amount` (0 or more, two decimals), else a percentage from 0 to 100.",
            "type": "number"
          }
        },
        "required": ["name", "value"],
        "type": "object"
      },
      "SettingsFeeList": {
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/SettingsFee"
            },
            "type": "array"
          },
          "max": {
            "description": "The most saved fees a store can have.",
            "type": "integer"
          },
          "missing_default_fees": {
            "description": "The default fees Restore default fees would add back, by name.",
            "items": {
              "type": "string"
            },
            "type": "array"
          }
        },
        "required": ["items", "max", "missing_default_fees"],
        "type": "object"
      },
      "SettingsFeeUpdate": {
        "description": "Only the fields to change.",
        "properties": {
          "active": {
            "description": "Offered on quotes and orders.",
            "type": "boolean"
          },
          "name": {
            "description": "Up to 35 characters, unique in the store.",
            "type": "string"
          },
          "physical": {
            "description": "Shipped as a physical item.",
            "type": "boolean"
          },
          "taxable": {
            "type": "boolean"
          },
          "type": {
            "description": "A fixed amount, or a percentage of the discounted price, the total or the retail price.",
            "enum": [
              "fixed_amount",
              "percent_of_discounted_price",
              "percent_of_total",
              "percent_of_retail_price"
            ],
            "type": "string"
          },
          "value": {
            "description": "An amount for `fixed_amount` (0 or more, two decimals), else a percentage from 0 to 100.",
            "type": "number"
          }
        },
        "type": "object"
      },
      "SettingsFeesRestored": {
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/SettingsFee"
            },
            "type": "array"
          },
          "max": {
            "type": "integer"
          },
          "missing_default_fees": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "restored": {
            "description": "How many default fees were added back.",
            "type": "integer"
          }
        },
        "required": ["restored", "items", "max", "missing_default_fees"],
        "type": "object"
      },
      "SettingsHistory": {
        "properties": {
          "items": {
            "items": {
              "properties": {
                "actor_kind": {
                  "description": "A person, OrderPilot by itself, or Bevy support.",
                  "enum": ["staff", "system", "support"],
                  "type": "string"
                },
                "actor_name": {
                  "type": "string"
                },
                "area": {
                  "description": "The Settings page.",
                  "enum": [
                    "business",
                    "staff_access",
                    "customers",
                    "account",
                    "quotes_orders",
                    "products",
                    "purchasing",
                    "branding",
                    "online_store",
                    "messages",
                    "debug",
                    "devices_api"
                  ],
                  "type": "string"
                },
                "changes": {
                  "items": {
                    "properties": {
                      "after": {
                        "description": "As text; null: it has none now.",
                        "nullable": true,
                        "type": "string"
                      },
                      "before": {
                        "description": "As text; null: it had no value.",
                        "nullable": true,
                        "type": "string"
                      },
                      "hidden": {
                        "description": "A cost or a commission rate this caller may not see: the values are left out (null).",
                        "type": "boolean"
                      },
                      "label": {
                        "description": "The field as its Settings page labels it.",
                        "type": "string"
                      },
                      "secret": {
                        "description": "A secret (a token, a credential): it changed, and neither value is kept.",
                        "type": "boolean"
                      }
                    },
                    "required": ["label", "before", "after"],
                    "type": "object"
                  },
                  "type": "array"
                },
                "created_at": {
                  "format": "date-time",
                  "type": "string"
                },
                "focus": {
                  "description": "The section on the page, when it has one.",
                  "nullable": true,
                  "type": "string"
                },
                "id": {
                  "type": "string"
                },
                "note": {
                  "nullable": true,
                  "type": "string"
                },
                "record": {
                  "description": "The record changed, by its name then.",
                  "nullable": true,
                  "type": "string"
                },
                "source": {
                  "description": "Where it was read from: a settings save, Staff and roles, or a record’s own activity (a location, brand, category, option, template or vendor).",
                  "enum": ["settings", "access", "record"],
                  "type": "string"
                },
                "summary": {
                  "type": "string"
                },
                "view": {
                  "description": "The page’s tab, when it has one.",
                  "nullable": true,
                  "type": "string"
                }
              },
              "required": [
                "id",
                "created_at",
                "actor_kind",
                "actor_name",
                "area",
                "summary",
                "changes"
              ],
              "type": "object"
            },
            "type": "array"
          },
          "next_cursor": {
            "nullable": true,
            "type": "string"
          },
          "people": {
            "description": "Who the `who` filter can name (`staff_id`): the store’s staff and whoever made a change on this page. Empty after the first page.",
            "items": {
              "properties": {
                "id": {
                  "type": "string"
                },
                "name": {
                  "type": "string"
                }
              },
              "required": ["id", "name"],
              "type": "object"
            },
            "type": "array"
          }
        },
        "required": ["items", "next_cursor", "people"],
        "type": "object"
      },
      "SettingsIdOrder": {
        "properties": {
          "ordered_ids": {
            "description": "The ids in the new order; ones left out keep their order after them.",
            "items": {
              "type": "string"
            },
            "type": "array"
          }
        },
        "required": ["ordered_ids"],
        "type": "object"
      },
      "SettingsLocation": {
        "properties": {
          "active": {
            "description": "False: deactivated in Shopify (kept, never offered for new records).",
            "type": "boolean"
          },
          "brand_id": {
            "description": "Its brand, the `id` `GET /brands` lists; null: Unassigned.",
            "nullable": true,
            "type": "string"
          },
          "default_product_image_url": {
            "description": "The picture its documents show for a product without one (Shopify Files).",
            "nullable": true,
            "type": "string"
          },
          "display_info": {
            "description": "What this location’s documents print in their header and footer, as Settings › Locations › Edit details saves it. Null: not set (the documents fall back as each field says).",
            "properties": {
              "address": {
                "description": "The address its documents print (blank: the location’s Shopify address).",
                "nullable": true,
                "type": "string"
              },
              "business_name": {
                "description": "The business name this location’s documents print (left blank: the store’s company name).",
                "nullable": true,
                "type": "string"
              },
              "domestic_bank_address": {
                "description": "Domestic wire details: the bank’s address.",
                "nullable": true,
                "type": "string"
              },
              "domestic_bank_name": {
                "description": "Wire details for domestic payments, printed on its documents: the bank.",
                "nullable": true,
                "type": "string"
              },
              "domestic_beneficiary_account": {
                "description": "Domestic wire details: the beneficiary’s account.",
                "nullable": true,
                "type": "string"
              },
              "domestic_beneficiary_name": {
                "description": "Domestic wire details: the beneficiary.",
                "nullable": true,
                "type": "string"
              },
              "domestic_routing_number": {
                "description": "Domestic wire details: the routing number.",
                "nullable": true,
                "type": "string"
              },
              "email": {
                "description": "The email its documents print (blank: the store’s support email).",
                "nullable": true,
                "type": "string"
              },
              "international_bank_address": {
                "description": "International wire details: the bank’s address.",
                "nullable": true,
                "type": "string"
              },
              "international_bank_name": {
                "description": "Wire details for international payments: the bank.",
                "nullable": true,
                "type": "string"
              },
              "international_beneficiary_account": {
                "description": "International wire details: the beneficiary’s account.",
                "nullable": true,
                "type": "string"
              },
              "international_beneficiary_name": {
                "description": "International wire details: the beneficiary.",
                "nullable": true,
                "type": "string"
              },
              "international_swift_code": {
                "description": "International wire details: the SWIFT code.",
                "nullable": true,
                "type": "string"
              },
              "order_note": {
                "description": "A note printed on this location’s order documents.",
                "nullable": true,
                "type": "string"
              },
              "phone": {
                "description": "The phone its documents print (blank: the location’s Shopify phone).",
                "nullable": true,
                "type": "string"
              },
              "website": {
                "description": "The website its documents print (blank: none).",
                "nullable": true,
                "type": "string"
              }
            },
            "required": [
              "business_name",
              "address",
              "phone",
              "email",
              "website",
              "domestic_bank_name",
              "domestic_bank_address",
              "domestic_routing_number",
              "domestic_beneficiary_name",
              "domestic_beneficiary_account",
              "international_bank_name",
              "international_bank_address",
              "international_swift_code",
              "international_beneficiary_name",
              "international_beneficiary_account",
              "order_note"
            ],
            "type": "object"
          },
          "id": {
            "description": "The Shopify location id: what `location_id` and the other location fields take, and this list’s writes.",
            "type": "string"
          },
          "logo_url": {
            "description": "Its logo on documents (Shopify Files).",
            "nullable": true,
            "type": "string"
          },
          "name": {
            "description": "As Shopify names it (changed in Shopify).",
            "type": "string"
          },
          "on_plan": {
            "description": "Whether the location is on the store’s OrderPilot plan (changed in Settings › Billing).",
            "type": "boolean"
          },
          "purpose": {
            "description": "`selling`, `warehouse`, or `made_to_order` (a location OrderPilot made for ordered-new stock).",
            "enum": ["selling", "warehouse", "made_to_order"],
            "type": "string"
          },
          "receipt_terms": {
            "description": "Short plain-text terms printed at the foot of its POS receipt, with a QR code to the full terms.",
            "nullable": true,
            "type": "string"
          },
          "shopify_address": {
            "description": "Its address and phone as Shopify has them (read-only here).",
            "properties": {
              "address1": {
                "nullable": true,
                "type": "string"
              },
              "city": {
                "nullable": true,
                "type": "string"
              },
              "country_code": {
                "nullable": true,
                "type": "string"
              },
              "phone": {
                "nullable": true,
                "type": "string"
              }
            },
            "type": "object"
          },
          "terms_and_conditions_html": {
            "description": "Its terms and conditions (sanitized HTML), on its documents and terms page.",
            "nullable": true,
            "type": "string"
          },
          "updated_at": {
            "format": "date-time",
            "type": "string"
          }
        },
        "required": [
          "id",
          "name",
          "active",
          "purpose",
          "on_plan",
          "brand_id",
          "shopify_address",
          "display_info",
          "terms_and_conditions_html",
          "receipt_terms",
          "logo_url",
          "default_product_image_url",
          "updated_at"
        ],
        "type": "object"
      },
      "SettingsLocationList": {
        "properties": {
          "items": {
            "items": {
              "properties": {
                "active": {
                  "description": "False: deactivated in Shopify (kept, never offered for new records).",
                  "type": "boolean"
                },
                "brand_id": {
                  "description": "Its brand, the `id` `GET /brands` lists; null: Unassigned.",
                  "nullable": true,
                  "type": "string"
                },
                "default_product_image_url": {
                  "description": "The picture its documents show for a product without one (Shopify Files).",
                  "nullable": true,
                  "type": "string"
                },
                "display_info": {
                  "description": "What this location’s documents print in their header and footer, as Settings › Locations › Edit details saves it. Null: not set (the documents fall back as each field says).",
                  "properties": {
                    "address": {
                      "description": "The address its documents print (blank: the location’s Shopify address).",
                      "nullable": true,
                      "type": "string"
                    },
                    "business_name": {
                      "description": "The business name this location’s documents print (left blank: the store’s company name).",
                      "nullable": true,
                      "type": "string"
                    },
                    "domestic_bank_address": {
                      "description": "Domestic wire details: the bank’s address.",
                      "nullable": true,
                      "type": "string"
                    },
                    "domestic_bank_name": {
                      "description": "Wire details for domestic payments, printed on its documents: the bank.",
                      "nullable": true,
                      "type": "string"
                    },
                    "domestic_beneficiary_account": {
                      "description": "Domestic wire details: the beneficiary’s account.",
                      "nullable": true,
                      "type": "string"
                    },
                    "domestic_beneficiary_name": {
                      "description": "Domestic wire details: the beneficiary.",
                      "nullable": true,
                      "type": "string"
                    },
                    "domestic_routing_number": {
                      "description": "Domestic wire details: the routing number.",
                      "nullable": true,
                      "type": "string"
                    },
                    "email": {
                      "description": "The email its documents print (blank: the store’s support email).",
                      "nullable": true,
                      "type": "string"
                    },
                    "international_bank_address": {
                      "description": "International wire details: the bank’s address.",
                      "nullable": true,
                      "type": "string"
                    },
                    "international_bank_name": {
                      "description": "Wire details for international payments: the bank.",
                      "nullable": true,
                      "type": "string"
                    },
                    "international_beneficiary_account": {
                      "description": "International wire details: the beneficiary’s account.",
                      "nullable": true,
                      "type": "string"
                    },
                    "international_beneficiary_name": {
                      "description": "International wire details: the beneficiary.",
                      "nullable": true,
                      "type": "string"
                    },
                    "international_swift_code": {
                      "description": "International wire details: the SWIFT code.",
                      "nullable": true,
                      "type": "string"
                    },
                    "order_note": {
                      "description": "A note printed on this location’s order documents.",
                      "nullable": true,
                      "type": "string"
                    },
                    "phone": {
                      "description": "The phone its documents print (blank: the location’s Shopify phone).",
                      "nullable": true,
                      "type": "string"
                    },
                    "website": {
                      "description": "The website its documents print (blank: none).",
                      "nullable": true,
                      "type": "string"
                    }
                  },
                  "required": [
                    "business_name",
                    "address",
                    "phone",
                    "email",
                    "website",
                    "domestic_bank_name",
                    "domestic_bank_address",
                    "domestic_routing_number",
                    "domestic_beneficiary_name",
                    "domestic_beneficiary_account",
                    "international_bank_name",
                    "international_bank_address",
                    "international_swift_code",
                    "international_beneficiary_name",
                    "international_beneficiary_account",
                    "order_note"
                  ],
                  "type": "object"
                },
                "id": {
                  "description": "The Shopify location id: what `location_id` and the other location fields take, and this list’s writes.",
                  "type": "string"
                },
                "logo_url": {
                  "description": "Its logo on documents (Shopify Files).",
                  "nullable": true,
                  "type": "string"
                },
                "name": {
                  "description": "As Shopify names it (changed in Shopify).",
                  "type": "string"
                },
                "on_plan": {
                  "description": "Whether the location is on the store’s OrderPilot plan (changed in Settings › Billing).",
                  "type": "boolean"
                },
                "purpose": {
                  "description": "`selling`, `warehouse`, or `made_to_order` (a location OrderPilot made for ordered-new stock).",
                  "enum": ["selling", "warehouse", "made_to_order"],
                  "type": "string"
                },
                "receipt_terms": {
                  "description": "Short plain-text terms printed at the foot of its POS receipt, with a QR code to the full terms.",
                  "nullable": true,
                  "type": "string"
                },
                "shopify_address": {
                  "description": "Its address and phone as Shopify has them (read-only here).",
                  "properties": {
                    "address1": {
                      "nullable": true,
                      "type": "string"
                    },
                    "city": {
                      "nullable": true,
                      "type": "string"
                    },
                    "country_code": {
                      "nullable": true,
                      "type": "string"
                    },
                    "phone": {
                      "nullable": true,
                      "type": "string"
                    }
                  },
                  "type": "object"
                },
                "terms_and_conditions_html": {
                  "description": "Its terms and conditions (sanitized HTML), on its documents and terms page.",
                  "nullable": true,
                  "type": "string"
                },
                "updated_at": {
                  "format": "date-time",
                  "type": "string"
                }
              },
              "required": [
                "id",
                "name",
                "active",
                "purpose",
                "on_plan",
                "brand_id",
                "shopify_address",
                "display_info",
                "terms_and_conditions_html",
                "receipt_terms",
                "logo_url",
                "default_product_image_url",
                "updated_at"
              ],
              "type": "object"
            },
            "type": "array"
          }
        },
        "required": ["items"],
        "type": "object"
      },
      "SettingsLocationUpdate": {
        "description": "Only the fields to change. A field the location doesn’t have is `400 INVALID_BODY`.",
        "properties": {
          "brand_id": {
            "description": "The brand, an `id` `GET /brands` lists; null takes it off its brand.",
            "nullable": true,
            "type": "string"
          },
          "default_product_image_file_id": {
            "description": "The default product picture: the `id` `POST /files` answered for a picture uploaded from an address (its `status` must be `ready`: read it with `GET /files/{id}`), or null to clear it. The replaced picture’s Shopify file is deleted, as in Settings.",
            "nullable": true,
            "type": "string"
          },
          "display_info": {
            "description": "Only the fields to change; the others keep what is stored. An empty string or null clears one.",
            "properties": {
              "address": {
                "description": "The address its documents print (blank: the location’s Shopify address).",
                "nullable": true,
                "type": "string"
              },
              "business_name": {
                "description": "The business name this location’s documents print (left blank: the store’s company name).",
                "nullable": true,
                "type": "string"
              },
              "domestic_bank_address": {
                "description": "Domestic wire details: the bank’s address.",
                "nullable": true,
                "type": "string"
              },
              "domestic_bank_name": {
                "description": "Wire details for domestic payments, printed on its documents: the bank.",
                "nullable": true,
                "type": "string"
              },
              "domestic_beneficiary_account": {
                "description": "Domestic wire details: the beneficiary’s account.",
                "nullable": true,
                "type": "string"
              },
              "domestic_beneficiary_name": {
                "description": "Domestic wire details: the beneficiary.",
                "nullable": true,
                "type": "string"
              },
              "domestic_routing_number": {
                "description": "Domestic wire details: the routing number.",
                "nullable": true,
                "type": "string"
              },
              "email": {
                "description": "The email its documents print (blank: the store’s support email).",
                "nullable": true,
                "type": "string"
              },
              "international_bank_address": {
                "description": "International wire details: the bank’s address.",
                "nullable": true,
                "type": "string"
              },
              "international_bank_name": {
                "description": "Wire details for international payments: the bank.",
                "nullable": true,
                "type": "string"
              },
              "international_beneficiary_account": {
                "description": "International wire details: the beneficiary’s account.",
                "nullable": true,
                "type": "string"
              },
              "international_beneficiary_name": {
                "description": "International wire details: the beneficiary.",
                "nullable": true,
                "type": "string"
              },
              "international_swift_code": {
                "description": "International wire details: the SWIFT code.",
                "nullable": true,
                "type": "string"
              },
              "order_note": {
                "description": "A note printed on this location’s order documents.",
                "nullable": true,
                "type": "string"
              },
              "phone": {
                "description": "The phone its documents print (blank: the location’s Shopify phone).",
                "nullable": true,
                "type": "string"
              },
              "website": {
                "description": "The website its documents print (blank: none).",
                "nullable": true,
                "type": "string"
              }
            },
            "type": "object"
          },
          "logo_file_id": {
            "description": "The logo: the `id` `POST /files` answered for a picture uploaded from an address (its `status` must be `ready`: read it with `GET /files/{id}`), or null to clear it. The replaced picture’s Shopify file is deleted, as in Settings.",
            "nullable": true,
            "type": "string"
          },
          "receipt_terms": {
            "description": "The receipt’s short terms, plain text (line breaks kept, at most 600 characters); empty or null clears them.",
            "nullable": true,
            "type": "string"
          },
          "terms_and_conditions_html": {
            "description": "The terms and conditions as HTML (at most 524,288 characters; sanitized before it is stored); null clears them.",
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "SettingsNumbering": {
        "description": "Settings › Quotes and orders › Defaults › Numbering.",
        "properties": {
          "invoice_next_number": {
            "description": "The next invoice number (after the prefix). Read-only. OrderPilot issues the numbers itself and skips any already used, so the next number can’t be set.",
            "type": "integer"
          },
          "invoice_numbering": {
            "description": "Invoice numbering: invoice documents get their own prefix and sequence.",
            "type": "boolean"
          },
          "invoice_prefix": {
            "description": "The prefix of invoice numbers, used while `invoice_numbering` is on.",
            "type": "string"
          },
          "quote_order_next_number": {
            "description": "The next quote or order number (after the prefix). Read-only. OrderPilot issues the numbers itself and skips any already used, so the next number can’t be set.",
            "type": "integer"
          },
          "quote_order_numbering": {
            "description": "Quote and order numbering: new quotes and orders get a stable number with this prefix from draft through completion.",
            "type": "boolean"
          },
          "quote_order_prefix": {
            "description": "The prefix of quote and order numbers, used while `quote_order_numbering` is on.",
            "type": "string"
          },
          "reference_enabled": {
            "description": "Show a reference after the quote/order number: a short field printed after the number on documents, emails and the customer portal.",
            "type": "boolean"
          },
          "reference_label": {
            "description": "What the team calls the reference (“Job”, “Project”).",
            "nullable": true,
            "type": "string"
          }
        },
        "required": [
          "quote_order_numbering",
          "quote_order_prefix",
          "quote_order_next_number",
          "invoice_numbering",
          "invoice_prefix",
          "invoice_next_number",
          "reference_enabled",
          "reference_label"
        ],
        "type": "object"
      },
      "SettingsNumberingUpdate": {
        "description": "Only the fields to change. A field the card doesn’t have is `400 INVALID_BODY`; a read-only one is ignored when sent unchanged.",
        "properties": {
          "accept_numbering_adjustments": {
            "description": "True: when a new prefix’s next number is already used, start it at the first free number (the clash’s `suggested`). Not stored.",
            "type": "boolean"
          },
          "invoice_numbering": {
            "description": "Invoice numbering: invoice documents get their own prefix and sequence.",
            "type": "boolean"
          },
          "invoice_prefix": {
            "description": "The prefix of invoice numbers, used while `invoice_numbering` is on.",
            "type": "string"
          },
          "quote_order_numbering": {
            "description": "Quote and order numbering: new quotes and orders get a stable number with this prefix from draft through completion.",
            "type": "boolean"
          },
          "quote_order_prefix": {
            "description": "The prefix of quote and order numbers, used while `quote_order_numbering` is on.",
            "type": "string"
          },
          "reference_enabled": {
            "description": "Show a reference after the quote/order number: a short field printed after the number on documents, emails and the customer portal.",
            "type": "boolean"
          },
          "reference_label": {
            "description": "What the team calls the reference (“Job”, “Project”).",
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "SettingsOnlineStore": {
        "description": "Settings › Online store.",
        "properties": {
          "custom_css": {
            "description": "Custom CSS for the options block.",
            "nullable": true,
            "type": "string"
          },
          "new_template_mode": {
            "description": "What customers can do with a new template: `hidden` (not on the online store), `explore`, `quote_only` (request a quote) or `order` (buy online).",
            "enum": ["hidden", "explore", "quote_only", "order"],
            "type": "string"
          },
          "new_template_price_line": {
            "description": "A new template’s price line: `options_and_total`, `total` or `hidden`.",
            "enum": ["options_and_total", "total", "hidden"],
            "type": "string"
          },
          "require_sign_in": {
            "description": "Customers must sign in to request a quote.",
            "type": "boolean"
          }
        },
        "required": [
          "require_sign_in",
          "new_template_mode",
          "new_template_price_line",
          "custom_css"
        ],
        "type": "object"
      },
      "SettingsOnlineStoreUpdate": {
        "description": "Only the fields to change. A field the card doesn’t have is `400 INVALID_BODY`; a read-only one is ignored when sent unchanged.",
        "properties": {
          "custom_css": {
            "description": "Custom CSS for the options block.",
            "nullable": true,
            "type": "string"
          },
          "new_template_mode": {
            "description": "What customers can do with a new template: `hidden` (not on the online store), `explore`, `quote_only` (request a quote) or `order` (buy online).",
            "enum": ["hidden", "explore", "quote_only", "order"],
            "type": "string"
          },
          "new_template_price_line": {
            "description": "A new template’s price line: `options_and_total`, `total` or `hidden`.",
            "enum": ["options_and_total", "total", "hidden"],
            "type": "string"
          },
          "require_sign_in": {
            "description": "Customers must sign in to request a quote.",
            "type": "boolean"
          }
        },
        "type": "object"
      },
      "SettingsPortalAccess": {
        "description": "Settings › Customers › Portal access.",
        "properties": {
          "portal": {
            "description": "Let customers use the customer portal.",
            "type": "boolean"
          }
        },
        "required": ["portal"],
        "type": "object"
      },
      "SettingsPortalAccessUpdate": {
        "description": "Only the fields to change. A field the card doesn’t have is `400 INVALID_BODY`; a read-only one is ignored when sent unchanged.",
        "properties": {
          "portal": {
            "description": "Let customers use the customer portal.",
            "type": "boolean"
          }
        },
        "type": "object"
      },
      "SettingsPortalLinksRevoked": {
        "properties": {
          "revoked": {
            "description": "How many links stopped working.",
            "type": "integer"
          }
        },
        "required": ["revoked"],
        "type": "object"
      },
      "SettingsPortalPage": {
        "description": "Settings › Branding › Customer portal.",
        "properties": {
          "footer_message": {
            "description": "The note at the bottom of the customer’s account page; null for the default line.",
            "nullable": true,
            "type": "string"
          },
          "logo_position": {
            "description": "Where the logo sits: `left`, `center` or `right`.",
            "enum": ["left", "center", "right"],
            "type": "string"
          }
        },
        "required": ["footer_message", "logo_position"],
        "type": "object"
      },
      "SettingsPortalPageUpdate": {
        "description": "Only the fields to change. A field the card doesn’t have is `400 INVALID_BODY`; a read-only one is ignored when sent unchanged.",
        "properties": {
          "footer_message": {
            "description": "The note at the bottom of the customer’s account page; null for the default line.",
            "nullable": true,
            "type": "string"
          },
          "logo_position": {
            "description": "Where the logo sits: `left`, `center` or `right`.",
            "enum": ["left", "center", "right"],
            "type": "string"
          }
        },
        "type": "object"
      },
      "SettingsProductDefaults": {
        "description": "Settings › Products › Product defaults.",
        "properties": {
          "add_on_name_prefix": {
            "description": "Add-on products in Shopify: the name prefix of the Shopify products made for stock-tracked options, which staff see on POS and customers on invoices and receipts. Empty: no prefix.",
            "type": "string"
          },
          "new_option_type": {
            "description": "Custom attributes: the type a new option starts as (`dropdown`, `text`, `textarea`, `number` or `text_image`, a picture).",
            "enum": ["dropdown", "text", "textarea", "number", "text_image"],
            "type": "string"
          }
        },
        "required": ["new_option_type", "add_on_name_prefix"],
        "type": "object"
      },
      "SettingsProductDefaultsUpdate": {
        "description": "Only the fields to change. A field the card doesn’t have is `400 INVALID_BODY`; a read-only one is ignored when sent unchanged.",
        "properties": {
          "add_on_name_prefix": {
            "description": "Add-on products in Shopify: the name prefix of the Shopify products made for stock-tracked options, which staff see on POS and customers on invoices and receipts. Empty: no prefix.",
            "type": "string"
          },
          "new_option_type": {
            "description": "Custom attributes: the type a new option starts as (`dropdown`, `text`, `textarea`, `number` or `text_image`, a picture).",
            "enum": ["dropdown", "text", "textarea", "number", "text_image"],
            "type": "string"
          }
        },
        "type": "object"
      },
      "SettingsProductPage": {
        "description": "Settings › Branding › Product page and pop-up.",
        "properties": {
          "popup_title": {
            "description": "The Added to your quote pop-up’s title; null for the default.",
            "nullable": true,
            "type": "string"
          }
        },
        "required": ["popup_title"],
        "type": "object"
      },
      "SettingsProductPageUpdate": {
        "description": "Only the fields to change. A field the card doesn’t have is `400 INVALID_BODY`; a read-only one is ignored when sent unchanged.",
        "properties": {
          "popup_title": {
            "description": "The Added to your quote pop-up’s title; null for the default.",
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "SettingsPurchaseOrders": {
        "description": "Settings › Purchasing and accounting › Purchase orders and costing › Purchase orders.",
        "properties": {
          "default_delivery": {
            "description": "Where new purchase orders deliver to: the `store` (the purchase order’s location), the `warehouse` (`default_warehouse_id`), or `ask` each time.",
            "enum": ["store", "warehouse", "ask"],
            "type": "string"
          },
          "default_warehouse_id": {
            "description": "The default warehouse, by its `id` from `GET /warehouses`.",
            "nullable": true,
            "type": "string"
          },
          "hide_price": {
            "description": "New purchase orders start with pricing hidden (changeable per vendor).",
            "type": "boolean"
          },
          "po_next_number": {
            "description": "The next purchase order number (after the prefix). Read-only. OrderPilot issues the numbers itself and skips any already used, so the next number can’t be set.",
            "type": "integer"
          },
          "po_numbering": {
            "description": "Purchase order numbering: new purchase orders use this prefix and sequence.",
            "type": "boolean"
          },
          "po_prefix": {
            "description": "The prefix of purchase order numbers, used while `po_numbering` is on.",
            "type": "string"
          }
        },
        "required": [
          "po_numbering",
          "po_prefix",
          "po_next_number",
          "hide_price",
          "default_delivery",
          "default_warehouse_id"
        ],
        "type": "object"
      },
      "SettingsPurchaseOrdersUpdate": {
        "description": "Only the fields to change. A field the card doesn’t have is `400 INVALID_BODY`; a read-only one is ignored when sent unchanged.",
        "properties": {
          "accept_numbering_adjustments": {
            "description": "True: when a new prefix’s next number is already used, start it at the first free number. Not stored.",
            "type": "boolean"
          },
          "default_delivery": {
            "description": "Where new purchase orders deliver to: the `store` (the purchase order’s location), the `warehouse` (`default_warehouse_id`), or `ask` each time.",
            "enum": ["store", "warehouse", "ask"],
            "type": "string"
          },
          "default_warehouse_id": {
            "description": "The default warehouse, by its `id` from `GET /warehouses`.",
            "nullable": true,
            "type": "string"
          },
          "hide_price": {
            "description": "New purchase orders start with pricing hidden (changeable per vendor).",
            "type": "boolean"
          },
          "po_numbering": {
            "description": "Purchase order numbering: new purchase orders use this prefix and sequence.",
            "type": "boolean"
          },
          "po_prefix": {
            "description": "The prefix of purchase order numbers, used while `po_numbering` is on.",
            "type": "string"
          }
        },
        "type": "object"
      },
      "SettingsQuotes": {
        "description": "Settings › Quotes and orders › Defaults › Quotes.",
        "properties": {
          "auto_save_quotes": {
            "description": "Auto-save quotes and unpaid drafts after their first save.",
            "type": "boolean"
          },
          "expiring_soon_days": {
            "description": "With `expiring_soon_from: days`: how many days before expiry.",
            "type": "integer"
          },
          "expiring_soon_from": {
            "description": "When a quote shows ‘Expiring soon’: `third` or `half` of its time left, or `days` (`expiring_soon_days` before expiry).",
            "enum": ["third", "half", "days"],
            "type": "string"
          },
          "expiry_blocks_customer": {
            "description": "Block signing and payment after a quote expires.",
            "type": "boolean"
          },
          "follow_up_carrier_days": {
            "description": "With `follow_up_carrier_timing: days`: how many days.",
            "type": "integer"
          },
          "follow_up_carrier_timing": {
            "description": "Needs attention: follow up with a carrier after the `delivery_promise`, or after `days` (`follow_up_carrier_days`).",
            "enum": ["delivery_promise", "days"],
            "type": "string"
          },
          "follow_up_customer_days": {
            "description": "Needs attention: follow up with a customer after this many days.",
            "type": "integer"
          },
          "follow_up_teammate_days": {
            "description": "Needs attention: follow up with a teammate after this many days.",
            "type": "integer"
          },
          "follow_up_vendor_days": {
            "description": "With `follow_up_vendor_timing: days`: how many days.",
            "type": "integer"
          },
          "follow_up_vendor_timing": {
            "description": "Needs attention: follow up with a vendor after their `lead_time`, or after `days` (`follow_up_vendor_days`).",
            "enum": ["lead_time", "days"],
            "type": "string"
          },
          "payment_needs_enabling": {
            "description": "Customers can pay only after payment is enabled on the quote or order (a payment request, a recorded payment or a copied payment link enables it too).",
            "type": "boolean"
          },
          "quote_valid_for_days": {
            "description": "Quotes are valid for this many days.",
            "type": "integer"
          },
          "quotes_tab": {
            "description": "Show the Quotes tab in the menus.",
            "type": "boolean"
          },
          "reminder_wording_customers": {
            "description": "Needs attention’s reminder wording for customers.",
            "nullable": true,
            "type": "string"
          },
          "reminder_wording_teammates": {
            "description": "Needs attention’s reminder wording for teammates.",
            "nullable": true,
            "type": "string"
          },
          "reminder_wording_vendors": {
            "description": "Needs attention’s reminder wording for vendors.",
            "nullable": true,
            "type": "string"
          },
          "renamed_lines_become_products": {
            "description": "A renamed template line becomes its own product template under its new name (quotes reuse a name but don’t make one).",
            "type": "boolean"
          },
          "require_vendor_selection": {
            "description": "Order create and edit no longer offer Skip vendor, and final saves need a real vendor. Draft saves stay allowed.",
            "type": "boolean"
          },
          "show_optional_template_fields": {
            "description": "Optional fields of a product template appear on the line when it is added.",
            "type": "boolean"
          },
          "show_vendor_on_template_cards": {
            "description": "Show the vendor on product template cards.",
            "type": "boolean"
          }
        },
        "required": [
          "quotes_tab",
          "require_vendor_selection",
          "show_vendor_on_template_cards",
          "show_optional_template_fields",
          "renamed_lines_become_products",
          "payment_needs_enabling",
          "auto_save_quotes",
          "quote_valid_for_days",
          "expiry_blocks_customer",
          "expiring_soon_from",
          "expiring_soon_days",
          "follow_up_customer_days",
          "follow_up_vendor_timing",
          "follow_up_vendor_days",
          "follow_up_carrier_timing",
          "follow_up_carrier_days",
          "follow_up_teammate_days",
          "reminder_wording_customers",
          "reminder_wording_vendors",
          "reminder_wording_teammates"
        ],
        "type": "object"
      },
      "SettingsQuotesUpdate": {
        "description": "Only the fields to change. A field the card doesn’t have is `400 INVALID_BODY`; a read-only one is ignored when sent unchanged.",
        "properties": {
          "auto_save_quotes": {
            "description": "Auto-save quotes and unpaid drafts after their first save.",
            "type": "boolean"
          },
          "expiring_soon_days": {
            "description": "With `expiring_soon_from: days`: how many days before expiry.",
            "type": "integer"
          },
          "expiring_soon_from": {
            "description": "When a quote shows ‘Expiring soon’: `third` or `half` of its time left, or `days` (`expiring_soon_days` before expiry).",
            "enum": ["third", "half", "days"],
            "type": "string"
          },
          "expiry_blocks_customer": {
            "description": "Block signing and payment after a quote expires.",
            "type": "boolean"
          },
          "follow_up_carrier_days": {
            "description": "With `follow_up_carrier_timing: days`: how many days.",
            "type": "integer"
          },
          "follow_up_carrier_timing": {
            "description": "Needs attention: follow up with a carrier after the `delivery_promise`, or after `days` (`follow_up_carrier_days`).",
            "enum": ["delivery_promise", "days"],
            "type": "string"
          },
          "follow_up_customer_days": {
            "description": "Needs attention: follow up with a customer after this many days.",
            "type": "integer"
          },
          "follow_up_teammate_days": {
            "description": "Needs attention: follow up with a teammate after this many days.",
            "type": "integer"
          },
          "follow_up_vendor_days": {
            "description": "With `follow_up_vendor_timing: days`: how many days.",
            "type": "integer"
          },
          "follow_up_vendor_timing": {
            "description": "Needs attention: follow up with a vendor after their `lead_time`, or after `days` (`follow_up_vendor_days`).",
            "enum": ["lead_time", "days"],
            "type": "string"
          },
          "payment_needs_enabling": {
            "description": "Customers can pay only after payment is enabled on the quote or order (a payment request, a recorded payment or a copied payment link enables it too).",
            "type": "boolean"
          },
          "quote_valid_for_days": {
            "description": "Quotes are valid for this many days.",
            "type": "integer"
          },
          "quotes_tab": {
            "description": "Show the Quotes tab in the menus.",
            "type": "boolean"
          },
          "reminder_wording_customers": {
            "description": "Needs attention’s reminder wording for customers.",
            "nullable": true,
            "type": "string"
          },
          "reminder_wording_teammates": {
            "description": "Needs attention’s reminder wording for teammates.",
            "nullable": true,
            "type": "string"
          },
          "reminder_wording_vendors": {
            "description": "Needs attention’s reminder wording for vendors.",
            "nullable": true,
            "type": "string"
          },
          "renamed_lines_become_products": {
            "description": "A renamed template line becomes its own product template under its new name (quotes reuse a name but don’t make one).",
            "type": "boolean"
          },
          "require_vendor_selection": {
            "description": "Order create and edit no longer offer Skip vendor, and final saves need a real vendor. Draft saves stay allowed.",
            "type": "boolean"
          },
          "show_optional_template_fields": {
            "description": "Optional fields of a product template appear on the line when it is added.",
            "type": "boolean"
          },
          "show_vendor_on_template_cards": {
            "description": "Show the vendor on product template cards.",
            "type": "boolean"
          }
        },
        "type": "object"
      },
      "SettingsReceipt": {
        "description": "Settings › Branding › POS receipt.",
        "properties": {
          "logo_position": {
            "description": "Where the logo sits: `left`, `center` or `right`.",
            "enum": ["left", "center", "right"],
            "type": "string"
          },
          "qr_code": {
            "description": "The QR code: `portal_link` or `none`.",
            "enum": ["none", "portal_link"],
            "type": "string"
          },
          "receipt_text": {
            "description": "The shop’s receipt text.",
            "nullable": true,
            "type": "string"
          }
        },
        "required": ["receipt_text", "qr_code", "logo_position"],
        "type": "object"
      },
      "SettingsReceiptUpdate": {
        "description": "Only the fields to change. A field the card doesn’t have is `400 INVALID_BODY`; a read-only one is ignored when sent unchanged.",
        "properties": {
          "logo_position": {
            "description": "Where the logo sits: `left`, `center` or `right`.",
            "enum": ["left", "center", "right"],
            "type": "string"
          },
          "qr_code": {
            "description": "The QR code: `portal_link` or `none`.",
            "enum": ["none", "portal_link"],
            "type": "string"
          },
          "receipt_text": {
            "description": "The shop’s receipt text.",
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "SettingsRecipients": {
        "description": "Settings › Messages and notifications › Sending settings › Recipients.",
        "properties": {
          "by_brand": {
            "description": "Use different recipients for a specific brand.",
            "type": "boolean"
          },
          "by_location": {
            "description": "Use different recipients for a specific location.",
            "type": "boolean"
          },
          "cc_emails": {
            "description": "Also copy these addresses on every customer order email.",
            "items": {
              "type": "string"
            },
            "type": "array"
          }
        },
        "required": ["cc_emails", "by_brand", "by_location"],
        "type": "object"
      },
      "SettingsRecipientsUpdate": {
        "description": "Only the fields to change. A field the card doesn’t have is `400 INVALID_BODY`; a read-only one is ignored when sent unchanged.",
        "properties": {
          "by_brand": {
            "description": "Use different recipients for a specific brand.",
            "type": "boolean"
          },
          "by_location": {
            "description": "Use different recipients for a specific location.",
            "type": "boolean"
          },
          "cc_emails": {
            "description": "Also copy these addresses on every customer order email.",
            "items": {
              "type": "string"
            },
            "type": "array"
          }
        },
        "type": "object"
      },
      "SettingsReplies": {
        "description": "Settings › Messages and notifications › Sending settings › Replies.",
        "properties": {
          "reply_goal_hours": {
            "description": "The reply time goal in hours: a conversation waiting longer is Overdue in the Inbox.",
            "type": "integer"
          }
        },
        "required": ["reply_goal_hours"],
        "type": "object"
      },
      "SettingsRepliesUpdate": {
        "description": "Only the fields to change. A field the card doesn’t have is `400 INVALID_BODY`; a read-only one is ignored when sent unchanged.",
        "properties": {
          "reply_goal_hours": {
            "description": "The reply time goal in hours: a conversation waiting longer is Overdue in the Inbox.",
            "type": "integer"
          }
        },
        "type": "object"
      },
      "SettingsRequestPage": {
        "description": "Settings › Branding › Quote request page.",
        "properties": {
          "logo_position": {
            "description": "Where the logo sits: `left`, `center` or `right`.",
            "enum": ["left", "center", "right"],
            "type": "string"
          },
          "show_store_header_and_footer": {
            "description": "Show the store’s header and footer around the page.",
            "type": "boolean"
          }
        },
        "required": ["show_store_header_and_footer", "logo_position"],
        "type": "object"
      },
      "SettingsRequestPageUpdate": {
        "description": "Only the fields to change. A field the card doesn’t have is `400 INVALID_BODY`; a read-only one is ignored when sent unchanged.",
        "properties": {
          "logo_position": {
            "description": "Where the logo sits: `left`, `center` or `right`.",
            "enum": ["left", "center", "right"],
            "type": "string"
          },
          "show_store_header_and_footer": {
            "description": "Show the store’s header and footer around the page.",
            "type": "boolean"
          }
        },
        "type": "object"
      },
      "SettingsSentPage": {
        "description": "Settings › Branding › Request sent page.",
        "properties": {
          "logo_position": {
            "description": "Where the logo sits: `left`, `center` or `right`.",
            "enum": ["left", "center", "right"],
            "type": "string"
          },
          "thank_you_message": {
            "description": "The thank-you message; null for the default.",
            "nullable": true,
            "type": "string"
          }
        },
        "required": ["thank_you_message", "logo_position"],
        "type": "object"
      },
      "SettingsSentPageUpdate": {
        "description": "Only the fields to change. A field the card doesn’t have is `400 INVALID_BODY`; a read-only one is ignored when sent unchanged.",
        "properties": {
          "logo_position": {
            "description": "Where the logo sits: `left`, `center` or `right`.",
            "enum": ["left", "center", "right"],
            "type": "string"
          },
          "thank_you_message": {
            "description": "The thank-you message; null for the default.",
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "SettingsSigningPage": {
        "description": "Settings › Branding › Signing page.",
        "properties": {
          "agreement_line": {
            "description": "The agreement line above the signature; null for the default.",
            "nullable": true,
            "type": "string"
          },
          "buttons": {
            "description": "The buttons: `filled` or `outline`; null for the default.",
            "enum": ["filled", "outline", null],
            "nullable": true,
            "type": "string"
          },
          "same_as_quote_pdf": {
            "description": "The signing page looks like the Quote PDF. Null reads as on.",
            "nullable": true,
            "type": "boolean"
          }
        },
        "required": ["same_as_quote_pdf", "buttons", "agreement_line"],
        "type": "object"
      },
      "SettingsSigningPageUpdate": {
        "description": "Only the fields to change. A field the card doesn’t have is `400 INVALID_BODY`; a read-only one is ignored when sent unchanged.",
        "properties": {
          "agreement_line": {
            "description": "The agreement line above the signature; null for the default.",
            "nullable": true,
            "type": "string"
          },
          "buttons": {
            "description": "The buttons: `filled` or `outline`; null for the default.",
            "enum": ["filled", "outline", null],
            "nullable": true,
            "type": "string"
          },
          "same_as_quote_pdf": {
            "description": "The signing page looks like the Quote PDF. Null reads as on.",
            "nullable": true,
            "type": "boolean"
          }
        },
        "type": "object"
      },
      "SettingsStatus": {
        "properties": {
          "attention_after_days": {
            "description": "Needs attention after this many days in it (1–365); null for the store’s rule.",
            "nullable": true,
            "type": "integer"
          },
          "attention_never": {
            "description": "Orders in it never come to the top of Orders.",
            "type": "boolean"
          },
          "color": {
            "description": "The status’s colour, as OrderPilot stores it.",
            "type": "string"
          },
          "description": {
            "description": "Up to 1,000 characters.",
            "nullable": true,
            "type": "string"
          },
          "edit_locked": {
            "description": "Quotes and orders in it are locked against edits.",
            "type": "boolean"
          },
          "eligible_for_po": {
            "description": "Orders in it can go on purchase orders.",
            "type": "boolean"
          },
          "email_template_key": {
            "nullable": true,
            "type": "string"
          },
          "group_id": {
            "description": "The customer group (an `id` in `groups`), or null for none.",
            "nullable": true,
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "is_active": {
            "description": "Offered for new moves. A system status stays on.",
            "type": "boolean"
          },
          "is_public": {
            "description": "Customers see it.",
            "type": "boolean"
          },
          "is_system": {
            "description": "One of the app’s own statuses.",
            "type": "boolean"
          },
          "name": {
            "description": "Unique in the store, any case. A system status keeps its own.",
            "type": "string"
          },
          "notify_by_email": {
            "description": "It emails the customer (its email template’s group, set in Settings › Messages).",
            "type": "boolean"
          },
          "notify_by_sms": {
            "description": "Text the customer when an order moves in (needs `sms_template_key`).",
            "type": "boolean"
          },
          "notify_on_create": {
            "description": "Also send its email when an order is created in it (with an email group).",
            "type": "boolean"
          },
          "position": {
            "description": "Its place in the list (lower first).",
            "type": "integer"
          },
          "sms_template_key": {
            "description": "The SMS template it sends: a `key` from `GET /settings/sms-templates`.",
            "nullable": true,
            "type": "string"
          },
          "waits_for_placement": {
            "description": "Waits to be placed: the app’s placing connections leave it. Always on in the Quote group; OrderPilot sets it on a system status.",
            "type": "boolean"
          }
        },
        "required": [
          "id",
          "name",
          "color",
          "description",
          "group_id",
          "position",
          "is_system",
          "is_active",
          "is_public",
          "edit_locked",
          "eligible_for_po",
          "waits_for_placement",
          "attention_after_days",
          "attention_never",
          "notify_by_email",
          "email_template_key",
          "notify_by_sms",
          "sms_template_key",
          "notify_on_create"
        ],
        "type": "object"
      },
      "SettingsStatusCreate": {
        "properties": {
          "attention_after_days": {
            "description": "Needs attention after this many days in it (1–365); null for the store’s rule.",
            "nullable": true,
            "type": "integer"
          },
          "attention_never": {
            "description": "Orders in it never come to the top of Orders.",
            "type": "boolean"
          },
          "color": {
            "description": "The status’s colour, as OrderPilot stores it.",
            "type": "string"
          },
          "description": {
            "description": "Up to 1,000 characters.",
            "nullable": true,
            "type": "string"
          },
          "edit_locked": {
            "description": "Quotes and orders in it are locked against edits.",
            "type": "boolean"
          },
          "eligible_for_po": {
            "description": "Orders in it can go on purchase orders.",
            "type": "boolean"
          },
          "email_template_key": {
            "description": "A customer email template’s `key`: a `value` of `options.email_templates` in `GET /settings/status-map`.",
            "nullable": true,
            "type": "string"
          },
          "group_id": {
            "description": "The customer group (an `id` in `groups`), or null for none.",
            "nullable": true,
            "type": "string"
          },
          "is_active": {
            "description": "Offered for new moves. A system status stays on.",
            "type": "boolean"
          },
          "is_public": {
            "description": "Customers see it.",
            "type": "boolean"
          },
          "name": {
            "description": "Unique in the store, any case. A system status keeps its own.",
            "type": "string"
          },
          "notify_by_email": {
            "description": "With `email_template_key`: the new status joins that template’s email group.",
            "type": "boolean"
          },
          "notify_by_sms": {
            "description": "Text the customer when an order moves in (needs `sms_template_key`).",
            "type": "boolean"
          },
          "notify_on_create": {
            "description": "Also send its email when an order is created in it (with an email group).",
            "type": "boolean"
          },
          "sms_template_key": {
            "description": "The SMS template it sends: a `key` from `GET /settings/sms-templates`.",
            "nullable": true,
            "type": "string"
          },
          "waits_for_placement": {
            "description": "Waits to be placed: the app’s placing connections leave it. Always on in the Quote group; OrderPilot sets it on a system status.",
            "type": "boolean"
          }
        },
        "required": ["name", "color"],
        "type": "object"
      },
      "SettingsStatusGroup": {
        "properties": {
          "customer_text": {
            "description": "What the customer reads under the group’s name.",
            "nullable": true,
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "position": {
            "type": "integer"
          },
          "system_key": {
            "description": "A default group’s stable key; null for one you added.",
            "enum": [
              "quote",
              "confirmed",
              "in_production",
              "ready",
              "on_its_way",
              "complete",
              "cancelled",
              null
            ],
            "nullable": true,
            "type": "string"
          }
        },
        "required": ["id", "name", "customer_text", "position", "system_key"],
        "type": "object"
      },
      "SettingsStatusGroupWrite": {
        "properties": {
          "customer_text": {
            "description": "What customers read under it, up to 300 characters.",
            "nullable": true,
            "type": "string"
          },
          "name": {
            "description": "Up to 60 characters, unique in the store.",
            "type": "string"
          }
        },
        "type": "object"
      },
      "SettingsStatusGroupsReorder": {
        "properties": {
          "ordered_ids": {
            "items": {
              "type": "string"
            },
            "type": "array"
          }
        },
        "required": ["ordered_ids"],
        "type": "object"
      },
      "SettingsStatusList": {
        "properties": {
          "groups": {
            "items": {
              "$ref": "#/components/schemas/SettingsStatusGroup"
            },
            "type": "array"
          },
          "statuses": {
            "items": {
              "$ref": "#/components/schemas/SettingsStatus"
            },
            "type": "array"
          }
        },
        "required": ["statuses", "groups"],
        "type": "object"
      },
      "SettingsStatusUpdate": {
        "description": "Only the fields to change. Which email a saved status sends is set on its email template’s group (Settings › Messages), not here.",
        "properties": {
          "attention_after_days": {
            "description": "Needs attention after this many days in it (1–365); null for the store’s rule.",
            "nullable": true,
            "type": "integer"
          },
          "attention_never": {
            "description": "Orders in it never come to the top of Orders.",
            "type": "boolean"
          },
          "color": {
            "description": "The status’s colour, as OrderPilot stores it.",
            "type": "string"
          },
          "description": {
            "description": "Up to 1,000 characters.",
            "nullable": true,
            "type": "string"
          },
          "edit_locked": {
            "description": "Quotes and orders in it are locked against edits.",
            "type": "boolean"
          },
          "eligible_for_po": {
            "description": "Orders in it can go on purchase orders.",
            "type": "boolean"
          },
          "group_id": {
            "description": "The customer group (an `id` in `groups`), or null for none.",
            "nullable": true,
            "type": "string"
          },
          "is_active": {
            "description": "Offered for new moves. A system status stays on.",
            "type": "boolean"
          },
          "is_public": {
            "description": "Customers see it.",
            "type": "boolean"
          },
          "name": {
            "description": "Unique in the store, any case. A system status keeps its own.",
            "type": "string"
          },
          "notify_by_sms": {
            "description": "Text the customer when an order moves in (needs `sms_template_key`).",
            "type": "boolean"
          },
          "notify_on_create": {
            "description": "Also send its email when an order is created in it (with an email group).",
            "type": "boolean"
          },
          "sms_template_key": {
            "description": "The SMS template it sends: a `key` from `GET /settings/sms-templates`.",
            "nullable": true,
            "type": "string"
          },
          "waits_for_placement": {
            "description": "Waits to be placed: the app’s placing connections leave it. Always on in the Quote group; OrderPilot sets it on a system status.",
            "type": "boolean"
          }
        },
        "type": "object"
      },
      "SettingsStatusesMove": {
        "properties": {
          "moves": {
            "items": {
              "properties": {
                "group_id": {
                  "description": "The group it moves to, or null for none.",
                  "nullable": true,
                  "type": "string"
                },
                "id": {
                  "type": "string"
                },
                "position": {
                  "type": "integer"
                }
              },
              "required": ["id", "group_id", "position"],
              "type": "object"
            },
            "type": "array"
          }
        },
        "required": ["moves"],
        "type": "object"
      },
      "SettingsStatusesMoved": {
        "properties": {
          "groups": {
            "items": {
              "$ref": "#/components/schemas/SettingsStatusGroup"
            },
            "type": "array"
          },
          "moved": {
            "description": "How many statuses moved.",
            "type": "integer"
          },
          "statuses": {
            "items": {
              "$ref": "#/components/schemas/SettingsStatus"
            },
            "type": "array"
          }
        },
        "required": ["moved", "statuses", "groups"],
        "type": "object"
      },
      "SettingsStatusesReorder": {
        "properties": {
          "statuses": {
            "items": {
              "properties": {
                "id": {
                  "type": "string"
                },
                "position": {
                  "description": "0 or more; lower first.",
                  "type": "integer"
                }
              },
              "required": ["id", "position"],
              "type": "object"
            },
            "type": "array"
          }
        },
        "required": ["statuses"],
        "type": "object"
      },
      "SettingsVendorWording": {
        "description": "Settings › Purchasing and accounting › Vendors › Vendor wording.",
        "properties": {
          "custom_label": {
            "description": "With `mode: custom`: the word used for vendors.",
            "nullable": true,
            "type": "string"
          },
          "mode": {
            "description": "What the app calls vendors: `default` (Vendor) or `custom` (`custom_label`).",
            "enum": ["default", "custom"],
            "type": "string"
          }
        },
        "required": ["mode", "custom_label"],
        "type": "object"
      },
      "SettingsVendorWordingUpdate": {
        "description": "Only the fields to change. A field the card doesn’t have is `400 INVALID_BODY`; a read-only one is ignored when sent unchanged.",
        "properties": {
          "custom_label": {
            "description": "With `mode: custom`: the word used for vendors.",
            "nullable": true,
            "type": "string"
          },
          "mode": {
            "description": "What the app calls vendors: `default` (Vendor) or `custom` (`custom_label`).",
            "enum": ["default", "custom"],
            "type": "string"
          }
        },
        "type": "object"
      },
      "SettingsWarrantyCoverage": {
        "description": "Settings › Products › Warranty coverage.",
        "properties": {
          "advanced_mode": {
            "description": "Advanced mode.",
            "type": "boolean"
          },
          "details_on_documents": {
            "description": "Warranty details on documents: `product_only` (the product’s, plus any differences) or `product_and_options`.",
            "enum": ["product_only", "product_and_options"],
            "type": "string"
          }
        },
        "required": ["advanced_mode", "details_on_documents"],
        "type": "object"
      },
      "SettingsWarrantyCoverageUpdate": {
        "description": "Only the fields to change. A field the card doesn’t have is `400 INVALID_BODY`; a read-only one is ignored when sent unchanged.",
        "properties": {
          "advanced_mode": {
            "description": "Advanced mode.",
            "type": "boolean"
          },
          "details_on_documents": {
            "description": "Warranty details on documents: `product_only` (the product’s, plus any differences) or `product_and_options`.",
            "enum": ["product_only", "product_and_options"],
            "type": "string"
          }
        },
        "type": "object"
      },
      "Setup": {
        "properties": {
          "all_done": {
            "type": "boolean"
          },
          "channels": {
            "properties": {
              "online": {
                "description": "The team sells on the online store.",
                "type": "boolean"
              },
              "pos": {
                "description": "The team sells on POS.",
                "type": "boolean"
              },
              "saved_at": {
                "description": "When how the team sells was answered; null: not yet.",
                "format": "date-time",
                "nullable": true,
                "type": "string"
              }
            },
            "required": ["pos", "online", "saved_at"],
            "type": "object"
          },
          "done_count": {
            "description": "Steps that count, done.",
            "type": "integer"
          },
          "email": {
            "properties": {
              "available": {
                "description": "Customer email is live on this server (false: skip the email steps).",
                "type": "boolean"
              },
              "can_send": {
                "description": "Emails can go out: the sending account is active and its domain verified.",
                "type": "boolean"
              },
              "domain": {
                "description": "The sending domain; null before one is added.",
                "nullable": true,
                "type": "string"
              },
              "domain_verified": {
                "description": "The sending domain is verified (its DNS records found): the from address can be set.",
                "type": "boolean"
              },
              "from_email": {
                "description": "The address customer emails come from.",
                "nullable": true,
                "type": "string"
              },
              "sending_on": {
                "description": "Customer emails are switched on.",
                "type": "boolean"
              },
              "theme_key": {
                "description": "An email design, a `key` of `email_themes` in `GET /setup`.",
                "enum": [
                  "ledger",
                  "gallery",
                  "summary",
                  "paper",
                  "statement",
                  "minimal"
                ],
                "type": "string"
              }
            },
            "required": [
              "available",
              "sending_on",
              "can_send",
              "domain",
              "domain_verified",
              "from_email",
              "theme_key"
            ],
            "type": "object"
          },
          "email_themes": {
            "items": {
              "properties": {
                "description": {
                  "type": "string"
                },
                "key": {
                  "description": "An email design, a `key` of `email_themes` in `GET /setup`.",
                  "enum": [
                    "ledger",
                    "gallery",
                    "summary",
                    "paper",
                    "statement",
                    "minimal"
                  ],
                  "type": "string"
                },
                "name": {
                  "type": "string"
                }
              },
              "required": ["key", "name", "description"],
              "type": "object"
            },
            "type": "array"
          },
          "finished": {
            "type": "boolean"
          },
          "mode": {
            "description": "What Home shows: the `setup` list, its `congrats`, or the `dashboard` (setup skipped or finished).",
            "enum": ["setup", "congrats", "dashboard"],
            "type": "string"
          },
          "next_step": {
            "description": "The first step that counts and isn’t done; null when all are.",
            "enum": [
              "brand",
              "channels",
              "pos",
              "online",
              "template",
              "emails",
              "test_quote",
              null
            ],
            "nullable": true,
            "type": "string"
          },
          "preview_emails": {
            "description": "The emails `POST /setup/email-preview` can show, in send order.",
            "items": {
              "properties": {
                "key": {
                  "description": "The email’s template key: what `template_key` of the preview takes.",
                  "type": "string"
                },
                "label": {
                  "type": "string"
                }
              },
              "required": ["key", "label"],
              "type": "object"
            },
            "type": "array"
          },
          "skipped": {
            "type": "boolean"
          },
          "steps": {
            "description": "The steps, in order.",
            "items": {
              "properties": {
                "applies": {
                  "description": "Counts towards progress. False for the iPads or online store step when the team doesn’t sell there.",
                  "type": "boolean"
                },
                "done": {
                  "type": "boolean"
                },
                "id": {
                  "enum": [
                    "brand",
                    "channels",
                    "pos",
                    "online",
                    "template",
                    "emails",
                    "test_quote"
                  ],
                  "type": "string"
                },
                "pending": {
                  "description": "The iPads or online store step before how the team sells is answered.",
                  "type": "boolean"
                },
                "title": {
                  "type": "string"
                }
              },
              "required": ["id", "title", "done", "applies", "pending"],
              "type": "object"
            },
            "type": "array"
          },
          "test_quote_templates": {
            "description": "The store’s own active templates (up to 50), for `POST /setup/test-quote`.",
            "items": {
              "properties": {
                "id": {
                  "type": "string"
                },
                "title": {
                  "type": "string"
                }
              },
              "required": ["id", "title"],
              "type": "object"
            },
            "type": "array"
          },
          "total_count": {
            "description": "Steps that count.",
            "type": "integer"
          }
        },
        "required": [
          "steps",
          "done_count",
          "total_count",
          "next_step",
          "all_done",
          "mode",
          "skipped",
          "finished",
          "channels",
          "email",
          "email_themes",
          "preview_emails",
          "test_quote_templates"
        ],
        "type": "object"
      },
      "SetupBrand": {
        "properties": {
          "company_name": {
            "description": "The business name (at most 120 characters).",
            "type": "string"
          },
          "support_email": {
            "description": "The support email customers see.",
            "type": "string"
          }
        },
        "required": ["company_name", "support_email"],
        "type": "object"
      },
      "SetupChannels": {
        "properties": {
          "online": {
            "description": "The team sells on the online store.",
            "type": "boolean"
          },
          "pos": {
            "description": "The team sells on POS (iPads).",
            "type": "boolean"
          }
        },
        "required": ["pos", "online"],
        "type": "object"
      },
      "SetupEmailPreview": {
        "properties": {
          "html": {
            "description": "The email’s HTML.",
            "type": "string"
          },
          "subject": {
            "type": "string"
          }
        },
        "required": ["subject", "html"],
        "type": "object"
      },
      "SetupEmailPreviewRequest": {
        "properties": {
          "template_key": {
            "description": "Which email, a `key` of `preview_emails` in `GET /setup`.",
            "type": "string"
          },
          "theme_key": {
            "description": "An email design, a `key` of `email_themes` in `GET /setup`.",
            "enum": [
              "ledger",
              "gallery",
              "summary",
              "paper",
              "statement",
              "minimal"
            ],
            "type": "string"
          }
        },
        "required": ["theme_key", "template_key"],
        "type": "object"
      },
      "SetupEmailTheme": {
        "properties": {
          "theme_key": {
            "description": "An email design, a `key` of `email_themes` in `GET /setup`.",
            "enum": [
              "ledger",
              "gallery",
              "summary",
              "paper",
              "statement",
              "minimal"
            ],
            "type": "string"
          }
        },
        "required": ["theme_key"],
        "type": "object"
      },
      "SetupEmailThemeSet": {
        "properties": {
          "email_theme_failures": {
            "description": "Templates that couldn’t be restyled (empty when all were).",
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "setup": {
            "$ref": "#/components/schemas/Setup"
          }
        },
        "required": ["setup", "email_theme_failures"],
        "type": "object"
      },
      "SetupFromAddress": {
        "properties": {
          "local": {
            "description": "What goes before the @ (letters, numbers, dots, dashes or underscores); the domain is the verified sending domain.",
            "type": "string"
          }
        },
        "required": ["local"],
        "type": "object"
      },
      "SetupTestQuote": {
        "properties": {
          "quote_id": {
            "description": "The quote made: read it with `GET /quotes/{id}`.",
            "type": "string"
          }
        },
        "required": ["quote_id"],
        "type": "object"
      },
      "SetupTestQuoteRequest": {
        "properties": {
          "email": {
            "description": "The customer’s email: usually the person setting up, to see the quote arrive.",
            "type": "string"
          },
          "template_id": {
            "description": "The template to quote, an `id` of `test_quote_templates` in `GET /setup`.",
            "type": "string"
          }
        },
        "required": ["email", "template_id"],
        "type": "object"
      },
      "SetupThemeChecked": {
        "properties": {
          "setup": {
            "$ref": "#/components/schemas/Setup"
          },
          "theme": {
            "description": "What the live theme read found.",
            "properties": {
              "block_templates": {
                "description": "Product templates with the OrderPilot block.",
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              "embed_on": {
                "description": "The OrderPilot app embed is on; null when unknown.",
                "nullable": true,
                "type": "boolean"
              },
              "ready": {
                "description": "Block and embed on: the step is ticked.",
                "type": "boolean"
              },
              "state": {
                "description": "`read`; `needs_approval` (the store hasn’t approved OrderPilot reading its theme); `no_main_theme`; `failed` (Shopify didn’t answer: try again).",
                "enum": ["read", "needs_approval", "no_main_theme", "failed"],
                "type": "string"
              },
              "theme_name": {
                "nullable": true,
                "type": "string"
              }
            },
            "required": ["state"],
            "type": "object"
          }
        },
        "required": ["setup", "theme"],
        "type": "object"
      },
      "SetupUpdate": {
        "description": "Any of these; at least one.",
        "properties": {
          "finished": {
            "description": "True only: finish setup for good (it can’t be taken back).",
            "type": "boolean"
          },
          "no_data": {
            "description": "True only: “Nothing to bring over” in the import step (when Import data is on), which ticks it.",
            "type": "boolean"
          },
          "pos_ready": {
            "description": "True only: tick the iPads step by hand.",
            "type": "boolean"
          },
          "skipped": {
            "description": "True: Skip setup. False: Resume (the list comes back on Home).",
            "type": "boolean"
          }
        },
        "type": "object"
      },
      "ShopifyFileList": {
        "properties": {
          "items": {
            "items": {
              "properties": {
                "alt": {
                  "nullable": true,
                  "type": "string"
                },
                "id": {
                  "description": "The Shopify file id: what `image_file_id` takes.",
                  "type": "string"
                },
                "kind": {
                  "enum": ["image", "file", "video", "other"],
                  "type": "string"
                },
                "mime": {
                  "description": "Its MIME type (`image/png`).",
                  "nullable": true,
                  "type": "string"
                },
                "url": {
                  "description": "Null while Shopify is still processing it.",
                  "nullable": true,
                  "type": "string"
                }
              },
              "type": "object"
            },
            "type": "array"
          },
          "next_cursor": {
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "ShopifyProduct": {
        "properties": {
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "handle": {
            "type": "string"
          },
          "id": {
            "description": "Shopify product id (`gid://shopify/Product/…`): what a quote line takes as `shopify_product_id`.",
            "type": "string"
          },
          "image_url": {
            "nullable": true,
            "type": "string"
          },
          "kind": {
            "description": "Always `shopify_product`: a product from the store’s Shopify catalog. A product template says `product_template`.",
            "enum": ["shopify_product"],
            "type": "string"
          },
          "options": {
            "description": "On one product only: its options (up to three), each with its values.",
            "items": {
              "properties": {
                "name": {
                  "type": "string"
                },
                "values": {
                  "items": {
                    "type": "string"
                  },
                  "type": "array"
                }
              },
              "type": "object"
            },
            "type": "array"
          },
          "price_range": {
            "description": "The lowest and highest variant price, in `currency`, two decimals.",
            "nullable": true,
            "properties": {
              "currency": {
                "nullable": true,
                "type": "string"
              },
              "max": {
                "nullable": true,
                "type": "number"
              },
              "min": {
                "nullable": true,
                "type": "number"
              }
            },
            "type": "object"
          },
          "product_type": {
            "nullable": true,
            "type": "string"
          },
          "status": {
            "enum": ["active", "draft", "archived", "unlisted"],
            "type": "string"
          },
          "tags": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "title": {
            "type": "string"
          },
          "total_inventory": {
            "description": "Every variant’s stock together, as Shopify counts it; null when the product doesn’t track inventory.",
            "nullable": true,
            "type": "integer"
          },
          "updated_at": {
            "format": "date-time",
            "type": "string"
          },
          "variants": {
            "description": "On one product: its first 100 variants. In a list or a search: each variant’s `id`, `title`, `sku` and `price` when the product has 10 or fewer, left out otherwise (more, or Shopify didn’t answer that read: `GET /products/{id}` has them). A quote line takes a variant’s `id` as `shopify_variant_id`, with the product’s `id`.",
            "items": {
              "properties": {
                "barcode": {
                  "nullable": true,
                  "type": "string"
                },
                "id": {
                  "description": "Shopify variant id (`gid://shopify/ProductVariant/…`).",
                  "type": "string"
                },
                "inventory_item_id": {
                  "description": "What `GET /inventory` takes, for this variant’s stock by location.",
                  "nullable": true,
                  "type": "string"
                },
                "inventory_quantity": {
                  "nullable": true,
                  "type": "integer"
                },
                "price": {
                  "description": "In the store’s currency, two decimals.",
                  "type": "number"
                },
                "sku": {
                  "nullable": true,
                  "type": "string"
                },
                "title": {
                  "type": "string"
                }
              },
              "type": "object"
            },
            "type": "array"
          },
          "variants_count": {
            "nullable": true,
            "type": "integer"
          },
          "variants_truncated": {
            "description": "On one product only: true when it has more variants than `variants` holds.",
            "type": "boolean"
          },
          "vendor": {
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "ShopifyProductList": {
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/ShopifyProduct"
            },
            "type": "array"
          },
          "message": {
            "description": "With `unmatched_filters`: what was not found and the closest values, in one or two sentences.",
            "type": "string"
          },
          "next_cursor": {
            "nullable": true,
            "type": "string"
          },
          "unmatched_filters": {
            "description": "Only on an empty list: each `vendor`, `product_type` or `tag` value no product in the store carries, with the store’s closest values (up to 3). The list stays empty; nothing else is listed in its place.",
            "items": {
              "properties": {
                "closest": {
                  "items": {
                    "type": "string"
                  },
                  "type": "array"
                },
                "filter": {
                  "enum": ["vendor", "product_type", "tag"],
                  "type": "string"
                },
                "value": {
                  "description": "The value as it was sent.",
                  "type": "string"
                }
              },
              "type": "object"
            },
            "type": "array"
          }
        },
        "type": "object"
      },
      "SignLink": {
        "properties": {
          "prices_shown": {
            "description": "The quote was being priced, and now shows the customer its prices.",
            "type": "boolean"
          },
          "url": {
            "description": "The sign page, to send the customer yourself.",
            "type": "string"
          }
        },
        "type": "object"
      },
      "SignatureEvidence": {
        "properties": {
          "audit_trail": {
            "description": "What happened before signing (the link issued, sent and opened).",
            "items": {
              "properties": {
                "at": {
                  "format": "date-time",
                  "type": "string"
                },
                "automated": {
                  "description": "An open that looked like a mail scanner or link preview, not a person.",
                  "type": "boolean"
                },
                "detail": {
                  "nullable": true,
                  "type": "string"
                },
                "kind": {
                  "enum": [
                    "link_issued",
                    "link_sent",
                    "link_opened",
                    "review_opened"
                  ],
                  "type": "string"
                }
              },
              "type": "object"
            },
            "type": "array"
          },
          "channel": {
            "description": "`online` (the customer’s own device, through the sign link), `in_store` (the store’s iPad) or `paper` (signed on paper, recorded by staff).",
            "enum": ["online", "in_store", "paper"],
            "type": "string"
          },
          "consent": {
            "properties": {
              "text": {
                "description": "The exact words shown beside the agree tick (a paper one: the staff member’s confirmation).",
                "type": "string"
              },
              "version": {
                "type": "string"
              }
            },
            "type": "object"
          },
          "copy_emailed": {
            "description": "The customer’s copy: when it was emailed and to whom (null when it wasn’t).",
            "properties": {
              "at": {
                "format": "date-time",
                "nullable": true,
                "type": "string"
              },
              "to": {
                "nullable": true,
                "type": "string"
              }
            },
            "type": "object"
          },
          "currency": {
            "type": "string"
          },
          "document_hash": {
            "description": "SHA-256 of the document as signed (its canonical JSON).",
            "type": "string"
          },
          "document_number": {
            "description": "The number printed on the signed document.",
            "type": "string"
          },
          "document_type": {
            "description": "What was signed: the quote or the order.",
            "enum": ["quote", "order"],
            "type": "string"
          },
          "fingerprints": {
            "properties": {
              "algorithm": {
                "description": "`SHA-256`.",
                "type": "string"
              },
              "document": {
                "type": "string"
              },
              "paper_scan": {
                "nullable": true,
                "type": "string"
              },
              "signed_pdf": {
                "description": "The stored PDF file’s; null until stored.",
                "nullable": true,
                "type": "string"
              }
            },
            "type": "object"
          },
          "generated_at": {
            "format": "date-time",
            "type": "string"
          },
          "has_signature_image": {
            "type": "boolean"
          },
          "how_signing_works": {
            "description": "How this kind of signature is given.",
            "type": "string"
          },
          "id": {
            "description": "What `GET /signatures/{id}` takes.",
            "type": "string"
          },
          "location_shopify_id": {
            "nullable": true,
            "type": "string"
          },
          "method": {
            "description": "`draw` (drawn), `type` (typed name), `auto` (made from their name) or `recorded` (a paper copy staff recorded: no image).",
            "enum": ["draw", "type", "auto", "recorded"],
            "type": "string"
          },
          "order_id": {
            "description": "The quote or order it is on now (a quote turned into an order keeps its id).",
            "type": "string"
          },
          "paper_scan": {
            "description": "A paper signature’s attached scan; null when none is attached.",
            "nullable": true,
            "properties": {
              "file_name": {
                "nullable": true,
                "type": "string"
              },
              "sha256": {
                "nullable": true,
                "type": "string"
              },
              "uploaded_at": {
                "format": "date-time",
                "nullable": true,
                "type": "string"
              },
              "uploaded_by": {
                "description": "Who attached it (an API key as “API key: <name>”).",
                "nullable": true,
                "type": "string"
              }
            },
            "type": "object"
          },
          "purged": {
            "description": "Its files and personal details were deleted at the end of the store’s retention period: when and why. What is left shows the signature existed and what was signed.",
            "nullable": true,
            "properties": {
              "at": {
                "format": "date-time",
                "type": "string"
              },
              "reason": {
                "nullable": true,
                "type": "string"
              }
            },
            "type": "object"
          },
          "recorded_at": {
            "format": "date-time",
            "type": "string"
          },
          "redaction_requested_at": {
            "description": "When the customer’s data deletion request reached it (signed records are kept as evidence).",
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "request": {
            "description": "What the request that carried an online or iPad signature told.",
            "properties": {
              "forwarded_for": {
                "nullable": true,
                "type": "string"
              },
              "ip_address": {
                "nullable": true,
                "type": "string"
              },
              "user_agent": {
                "nullable": true,
                "type": "string"
              }
            },
            "type": "object"
          },
          "signed_at": {
            "description": "When it was given (a paper one: noon on the day staff entered).",
            "format": "date-time",
            "type": "string"
          },
          "signed_pdf": {
            "description": "The stored signed PDF (`GET /signatures/{id}/pdf`).",
            "properties": {
              "sha256": {
                "nullable": true,
                "type": "string"
              },
              "status": {
                "description": "`pending` (being made), `ready` (stored) or `failed` (making it keeps being retried).",
                "enum": ["pending", "ready", "failed"],
                "type": "string"
              },
              "stored_at": {
                "format": "date-time",
                "nullable": true,
                "type": "string"
              }
            },
            "type": "object"
          },
          "signer": {
            "properties": {
              "email": {
                "description": "Their email at signing.",
                "nullable": true,
                "type": "string"
              },
              "name": {
                "type": "string"
              }
            },
            "type": "object"
          },
          "staff": {
            "description": "On the iPad or on paper: the staff account and the location.",
            "properties": {
              "location_name": {
                "nullable": true,
                "type": "string"
              },
              "name": {
                "nullable": true,
                "type": "string"
              },
              "pos_reported_staff_id": {
                "nullable": true,
                "type": "string"
              }
            },
            "type": "object"
          },
          "status": {
            "description": "`current`: the signature the record carries now (one at most); `superseded`: an edit after signing or a later signature replaced it (kept as evidence).",
            "enum": ["current", "superseded"],
            "type": "string"
          },
          "superseded": {
            "nullable": true,
            "properties": {
              "at": {
                "format": "date-time",
                "type": "string"
              },
              "by": {
                "nullable": true,
                "type": "string"
              },
              "reason": {
                "nullable": true,
                "type": "string"
              }
            },
            "type": "object"
          },
          "total": {
            "description": "The signed document’s total, two decimals.",
            "type": "number"
          }
        },
        "type": "object"
      },
      "SignatureExport": {
        "properties": {
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "done_records": {
            "type": "integer"
          },
          "error": {
            "nullable": true,
            "type": "string"
          },
          "expires_at": {
            "description": "When its files are deleted.",
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "id": {
            "description": "What `GET /signature-exports/{id}/parts/{part}` takes.",
            "type": "string"
          },
          "include_superseded": {
            "type": "boolean"
          },
          "parts": {
            "items": {
              "properties": {
                "bytes": {
                  "type": "integer"
                },
                "file_name": {
                  "type": "string"
                },
                "part": {
                  "description": "From 1.",
                  "type": "integer"
                },
                "records": {
                  "type": "integer"
                }
              },
              "type": "object"
            },
            "type": "array"
          },
          "reason": {
            "description": "`manual` (asked for) or `uninstall` (made when the app was removed).",
            "enum": ["manual", "uninstall"],
            "type": "string"
          },
          "requested_by": {
            "description": "Who asked (a key as “API key: <name>”).",
            "nullable": true,
            "type": "string"
          },
          "signed_from": {
            "description": "Null for every signature.",
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "signed_to": {
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "status": {
            "enum": ["queued", "running", "ready", "failed", "expired"],
            "type": "string"
          },
          "total_records": {
            "type": "integer"
          }
        },
        "type": "object"
      },
      "SignatureExportCreate": {
        "properties": {
          "all": {
            "description": "Every signature instead of a range (Export everything).",
            "type": "boolean"
          },
          "from": {
            "description": "The first day, `YYYY-MM-DD` (the store’s time).",
            "type": "string"
          },
          "include_superseded": {
            "description": "Also signatures an edit or a later signature replaced. Default true.",
            "type": "boolean"
          },
          "to": {
            "description": "The last day, `YYYY-MM-DD`, inclusive.",
            "type": "string"
          }
        },
        "type": "object"
      },
      "SignatureExportList": {
        "properties": {
          "items": {
            "items": {
              "properties": {
                "created_at": {
                  "format": "date-time",
                  "type": "string"
                },
                "done_records": {
                  "type": "integer"
                },
                "error": {
                  "nullable": true,
                  "type": "string"
                },
                "expires_at": {
                  "description": "When its files are deleted.",
                  "format": "date-time",
                  "nullable": true,
                  "type": "string"
                },
                "id": {
                  "description": "What `GET /signature-exports/{id}/parts/{part}` takes.",
                  "type": "string"
                },
                "include_superseded": {
                  "type": "boolean"
                },
                "parts": {
                  "items": {
                    "properties": {
                      "bytes": {
                        "type": "integer"
                      },
                      "file_name": {
                        "type": "string"
                      },
                      "part": {
                        "description": "From 1.",
                        "type": "integer"
                      },
                      "records": {
                        "type": "integer"
                      }
                    },
                    "type": "object"
                  },
                  "type": "array"
                },
                "reason": {
                  "description": "`manual` (asked for) or `uninstall` (made when the app was removed).",
                  "enum": ["manual", "uninstall"],
                  "type": "string"
                },
                "requested_by": {
                  "description": "Who asked (a key as “API key: <name>”).",
                  "nullable": true,
                  "type": "string"
                },
                "signed_from": {
                  "description": "Null for every signature.",
                  "format": "date-time",
                  "nullable": true,
                  "type": "string"
                },
                "signed_to": {
                  "format": "date-time",
                  "nullable": true,
                  "type": "string"
                },
                "status": {
                  "enum": ["queued", "running", "ready", "failed", "expired"],
                  "type": "string"
                },
                "total_records": {
                  "type": "integer"
                }
              },
              "type": "object"
            },
            "type": "array"
          },
          "time_zone": {
            "description": "The store’s time zone: the days are read in it.",
            "type": "string"
          }
        },
        "type": "object"
      },
      "SignatureExportPartLink": {
        "properties": {
          "bytes": {
            "type": "integer"
          },
          "expires_at": {
            "format": "date-time",
            "type": "string"
          },
          "export_id": {
            "type": "string"
          },
          "file_name": {
            "type": "string"
          },
          "part": {
            "type": "integer"
          },
          "records": {
            "type": "integer"
          },
          "sha256": {
            "description": "SHA-256 of the ZIP’s bytes.",
            "type": "string"
          },
          "url": {
            "description": "Downloads the part through the API with no key sent: bound to the key that asked, once, within a minute.",
            "type": "string"
          }
        },
        "type": "object"
      },
      "SignatureList": {
        "properties": {
          "items": {
            "items": {
              "properties": {
                "audit_trail": {
                  "description": "What happened before signing (the link issued, sent and opened).",
                  "items": {
                    "properties": {
                      "at": {
                        "format": "date-time",
                        "type": "string"
                      },
                      "automated": {
                        "description": "An open that looked like a mail scanner or link preview, not a person.",
                        "type": "boolean"
                      },
                      "detail": {
                        "nullable": true,
                        "type": "string"
                      },
                      "kind": {
                        "enum": [
                          "link_issued",
                          "link_sent",
                          "link_opened",
                          "review_opened"
                        ],
                        "type": "string"
                      }
                    },
                    "type": "object"
                  },
                  "type": "array"
                },
                "channel": {
                  "description": "`online` (the customer’s own device, through the sign link), `in_store` (the store’s iPad) or `paper` (signed on paper, recorded by staff).",
                  "enum": ["online", "in_store", "paper"],
                  "type": "string"
                },
                "consent": {
                  "properties": {
                    "text": {
                      "description": "The exact words shown beside the agree tick (a paper one: the staff member’s confirmation).",
                      "type": "string"
                    },
                    "version": {
                      "type": "string"
                    }
                  },
                  "type": "object"
                },
                "copy_emailed": {
                  "description": "The customer’s copy: when it was emailed and to whom (null when it wasn’t).",
                  "properties": {
                    "at": {
                      "format": "date-time",
                      "nullable": true,
                      "type": "string"
                    },
                    "to": {
                      "nullable": true,
                      "type": "string"
                    }
                  },
                  "type": "object"
                },
                "currency": {
                  "type": "string"
                },
                "document_hash": {
                  "description": "SHA-256 of the document as signed (its canonical JSON).",
                  "type": "string"
                },
                "document_number": {
                  "description": "The number printed on the signed document.",
                  "type": "string"
                },
                "document_type": {
                  "description": "What was signed: the quote or the order.",
                  "enum": ["quote", "order"],
                  "type": "string"
                },
                "has_signature_image": {
                  "type": "boolean"
                },
                "id": {
                  "description": "What `GET /signatures/{id}` takes.",
                  "type": "string"
                },
                "method": {
                  "description": "`draw` (drawn), `type` (typed name), `auto` (made from their name) or `recorded` (a paper copy staff recorded: no image).",
                  "enum": ["draw", "type", "auto", "recorded"],
                  "type": "string"
                },
                "order_id": {
                  "description": "The quote or order it is on now (a quote turned into an order keeps its id).",
                  "type": "string"
                },
                "paper_scan": {
                  "description": "A paper signature’s attached scan; null when none is attached.",
                  "nullable": true,
                  "properties": {
                    "file_name": {
                      "nullable": true,
                      "type": "string"
                    },
                    "sha256": {
                      "nullable": true,
                      "type": "string"
                    },
                    "uploaded_at": {
                      "format": "date-time",
                      "nullable": true,
                      "type": "string"
                    },
                    "uploaded_by": {
                      "description": "Who attached it (an API key as “API key: <name>”).",
                      "nullable": true,
                      "type": "string"
                    }
                  },
                  "type": "object"
                },
                "purged": {
                  "description": "Its files and personal details were deleted at the end of the store’s retention period: when and why. What is left shows the signature existed and what was signed.",
                  "nullable": true,
                  "properties": {
                    "at": {
                      "format": "date-time",
                      "type": "string"
                    },
                    "reason": {
                      "nullable": true,
                      "type": "string"
                    }
                  },
                  "type": "object"
                },
                "recorded_at": {
                  "format": "date-time",
                  "type": "string"
                },
                "request": {
                  "description": "What the request that carried an online or iPad signature told.",
                  "properties": {
                    "forwarded_for": {
                      "nullable": true,
                      "type": "string"
                    },
                    "ip_address": {
                      "nullable": true,
                      "type": "string"
                    },
                    "user_agent": {
                      "nullable": true,
                      "type": "string"
                    }
                  },
                  "type": "object"
                },
                "signed_at": {
                  "description": "When it was given (a paper one: noon on the day staff entered).",
                  "format": "date-time",
                  "type": "string"
                },
                "signed_pdf": {
                  "description": "The stored signed PDF (`GET /signatures/{id}/pdf`).",
                  "properties": {
                    "sha256": {
                      "nullable": true,
                      "type": "string"
                    },
                    "status": {
                      "description": "`pending` (being made), `ready` (stored) or `failed` (making it keeps being retried).",
                      "enum": ["pending", "ready", "failed"],
                      "type": "string"
                    },
                    "stored_at": {
                      "format": "date-time",
                      "nullable": true,
                      "type": "string"
                    }
                  },
                  "type": "object"
                },
                "signer": {
                  "properties": {
                    "email": {
                      "description": "Their email at signing.",
                      "nullable": true,
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    }
                  },
                  "type": "object"
                },
                "staff": {
                  "description": "On the iPad or on paper: the staff account and the location.",
                  "properties": {
                    "location_name": {
                      "nullable": true,
                      "type": "string"
                    },
                    "name": {
                      "nullable": true,
                      "type": "string"
                    },
                    "pos_reported_staff_id": {
                      "nullable": true,
                      "type": "string"
                    }
                  },
                  "type": "object"
                },
                "status": {
                  "description": "`current`: the signature the record carries now (one at most); `superseded`: an edit after signing or a later signature replaced it (kept as evidence).",
                  "enum": ["current", "superseded"],
                  "type": "string"
                },
                "superseded": {
                  "nullable": true,
                  "properties": {
                    "at": {
                      "format": "date-time",
                      "type": "string"
                    },
                    "by": {
                      "nullable": true,
                      "type": "string"
                    },
                    "reason": {
                      "nullable": true,
                      "type": "string"
                    }
                  },
                  "type": "object"
                },
                "total": {
                  "description": "The signed document’s total, two decimals.",
                  "type": "number"
                }
              },
              "type": "object"
            },
            "type": "array"
          },
          "time_zone": {
            "description": "The store’s time zone (IANA), for showing the times as the store reads them.",
            "type": "string"
          }
        },
        "type": "object"
      },
      "SignaturePaperScan": {
        "properties": {
          "file_name": {
            "type": "string"
          },
          "sha256": {
            "type": "string"
          },
          "signature_id": {
            "type": "string"
          },
          "uploaded_at": {
            "format": "date-time",
            "type": "string"
          },
          "uploaded_by": {
            "description": "An API key as “API key: <name>”.",
            "type": "string"
          }
        },
        "type": "object"
      },
      "SignaturePaperScanLink": {
        "properties": {
          "content_type": {
            "type": "string"
          },
          "expires_at": {
            "format": "date-time",
            "type": "string"
          },
          "file_name": {
            "type": "string"
          },
          "sha256": {
            "nullable": true,
            "type": "string"
          },
          "signature_id": {
            "type": "string"
          },
          "uploaded_at": {
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "uploaded_by": {
            "nullable": true,
            "type": "string"
          },
          "url": {
            "description": "Opens the file through the API (`GET /signatures/{id}/paper-scan/file`) with no key sent: bound to the key that asked, once, within a minute.",
            "type": "string"
          }
        },
        "type": "object"
      },
      "SignatureRecordsSettings": {
        "properties": {
          "change_where": {
            "description": "Where a person changes the retention and the holds: Settings › Account and data › Signature records.",
            "type": "string"
          },
          "deleted": {
            "type": "integer"
          },
          "due": {
            "description": "`purge`: records with a notice and the first day any can go; `keep`: records past their time.",
            "properties": {
              "count": {
                "type": "integer"
              },
              "from": {
                "format": "date-time",
                "nullable": true,
                "type": "string"
              }
            },
            "type": "object"
          },
          "legal_holds": {
            "description": "The standing holds, newest first.",
            "items": {
              "properties": {
                "document_number": {
                  "type": "string"
                },
                "id": {
                  "type": "string"
                },
                "order_id": {
                  "nullable": true,
                  "type": "string"
                },
                "placed_at": {
                  "format": "date-time",
                  "type": "string"
                },
                "placed_by": {
                  "nullable": true,
                  "type": "string"
                },
                "reason": {
                  "type": "string"
                }
              },
              "type": "object"
            },
            "type": "array"
          },
          "oldest_signed_at": {
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "retention": {
            "properties": {
              "action": {
                "description": "`purge` (files and personal details deleted after a notice) or `keep` (nothing deleted; listed for a person to delete).",
                "enum": ["purge", "keep"],
                "type": "string"
              },
              "years": {
                "type": "integer"
              }
            },
            "type": "object"
          },
          "time_zone": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "SignatureRequest": {
        "properties": {
          "attach_document": {
            "description": "Attach the PDF where the template does (default true); false sends none.",
            "type": "boolean"
          },
          "bcc": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "cc": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "template_key": {
            "description": "A Request signature template from `GET /email-templates` (one whose `preset` is `request-signature`: the shipped one, a copy or a brand version of it); default the store’s Request signature.",
            "type": "string"
          },
          "to": {
            "description": "Up to 5 addresses; the customer’s own address when left out. The customer has to be on it (to, cc or bcc) for it to count as asking them to sign.",
            "items": {
              "type": "string"
            },
            "type": "array"
          }
        },
        "type": "object"
      },
      "SignedCopySent": {
        "properties": {
          "sent": {
            "type": "boolean"
          },
          "to": {
            "description": "The customer’s address it went to.",
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "SmsTemplateList": {
        "properties": {
          "items": {
            "items": {
              "properties": {
                "body": {
                  "description": "The text, with its placeholders.",
                  "type": "string"
                },
                "key": {
                  "description": "What a status’s `sms_template_key` takes.",
                  "type": "string"
                },
                "name": {
                  "type": "string"
                }
              },
              "required": ["key", "name", "body"],
              "type": "object"
            },
            "type": "array"
          }
        },
        "required": ["items"],
        "type": "object"
      },
      "SmsTest": {
        "properties": {
          "to": {
            "description": "The phone number, E.164 (`+15551234567`).",
            "type": "string"
          }
        },
        "required": ["to"],
        "type": "object"
      },
      "SmsTestSent": {
        "properties": {
          "sent": {
            "type": "boolean"
          },
          "to": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "StaffAccess": {
        "properties": {
          "all_locations": {
            "type": "boolean"
          },
          "available_as_salesperson": {
            "description": "The store owner’s own “Appear in the salesperson picker”. For everyone else their role decides.",
            "type": "boolean"
          },
          "email": {
            "nullable": true,
            "type": "string"
          },
          "first_seen_at": {
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "last_active_at": {
            "description": "Their last visit to the admin or POS.",
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "location_ids": {
            "description": "The Shopify location ids they work at (as `GET /locations` lists them). Empty with `all_locations`.",
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "name": {
            "type": "string"
          },
          "owner": {
            "description": "The Shopify account owner: always full access, never changed here.",
            "type": "boolean"
          },
          "pos_only": {
            "description": "Known only from POS sign-ins so far.",
            "type": "boolean"
          },
          "role_id": {
            "description": "Null: no role (they get what `GET /roles` says people without a role get, at every location).",
            "nullable": true,
            "type": "string"
          },
          "role_name": {
            "nullable": true,
            "type": "string"
          },
          "suspend_reason": {
            "nullable": true,
            "type": "string"
          },
          "suspended": {
            "type": "boolean"
          },
          "suspended_at": {
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "test_staff": {
            "type": "boolean"
          }
        },
        "required": [
          "id",
          "name",
          "email",
          "owner",
          "role_id",
          "role_name",
          "all_locations",
          "location_ids",
          "suspended"
        ],
        "type": "object"
      },
      "StaffAccessEdit": {
        "properties": {
          "all_locations": {
            "type": "boolean"
          },
          "location_ids": {
            "description": "The locations they work at, by the ids `GET /locations` lists (at least one). Sent without `all_locations`, it takes them off All locations.",
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "role_id": {
            "description": "A role from `GET /roles`; null takes their role away (they then get what people without a role get, at every location).",
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "StaffAccessList": {
        "properties": {
          "items": {
            "items": {
              "properties": {
                "all_locations": {
                  "type": "boolean"
                },
                "available_as_salesperson": {
                  "description": "The store owner’s own “Appear in the salesperson picker”. For everyone else their role decides.",
                  "type": "boolean"
                },
                "email": {
                  "nullable": true,
                  "type": "string"
                },
                "first_seen_at": {
                  "format": "date-time",
                  "nullable": true,
                  "type": "string"
                },
                "id": {
                  "type": "string"
                },
                "last_active_at": {
                  "description": "Their last visit to the admin or POS.",
                  "format": "date-time",
                  "nullable": true,
                  "type": "string"
                },
                "location_ids": {
                  "description": "The Shopify location ids they work at (as `GET /locations` lists them). Empty with `all_locations`.",
                  "items": {
                    "type": "string"
                  },
                  "type": "array"
                },
                "name": {
                  "type": "string"
                },
                "owner": {
                  "description": "The Shopify account owner: always full access, never changed here.",
                  "type": "boolean"
                },
                "pos_only": {
                  "description": "Known only from POS sign-ins so far.",
                  "type": "boolean"
                },
                "role_id": {
                  "description": "Null: no role (they get what `GET /roles` says people without a role get, at every location).",
                  "nullable": true,
                  "type": "string"
                },
                "role_name": {
                  "nullable": true,
                  "type": "string"
                },
                "suspend_reason": {
                  "nullable": true,
                  "type": "string"
                },
                "suspended": {
                  "type": "boolean"
                },
                "suspended_at": {
                  "format": "date-time",
                  "nullable": true,
                  "type": "string"
                },
                "test_staff": {
                  "type": "boolean"
                }
              },
              "required": [
                "id",
                "name",
                "email",
                "owner",
                "role_id",
                "role_name",
                "all_locations",
                "location_ids",
                "suspended"
              ],
              "type": "object"
            },
            "type": "array"
          },
          "next_cursor": {
            "nullable": true,
            "type": "string"
          }
        },
        "required": ["items", "next_cursor"],
        "type": "object"
      },
      "StaffList": {
        "properties": {
          "items": {
            "items": {
              "properties": {
                "id": {
                  "description": "What `salesperson_ids` takes.",
                  "type": "string"
                },
                "name": {
                  "type": "string"
                }
              },
              "type": "object"
            },
            "type": "array"
          }
        },
        "type": "object"
      },
      "StaffPosAdd": {
        "properties": {
          "first_name": {
            "description": "Their first name, as staff should see it.",
            "type": "string"
          },
          "last_name": {
            "description": "Their last name (optional).",
            "type": "string"
          },
          "reported_staff_id": {
            "description": "Their PIN staff id, the `reported_staff_id` of a `not_in_orderpilot` row of `pos_sign_ins` in `GET /staff/rules`.",
            "type": "string"
          }
        },
        "required": ["reported_staff_id", "first_name"],
        "type": "object"
      },
      "StaffPreassignment": {
        "properties": {
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "created_by_name": {
            "description": "Who pre-assigned it; null for an API key or someone who has left.",
            "nullable": true,
            "type": "string"
          },
          "email": {
            "description": "The email they sign in to Shopify with (lowercase).",
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "role_id": {
            "description": "The role they get on their first visit.",
            "type": "string"
          },
          "role_name": {
            "nullable": true,
            "type": "string"
          }
        },
        "required": [
          "id",
          "email",
          "role_id",
          "role_name",
          "created_at",
          "created_by_name"
        ],
        "type": "object"
      },
      "StaffPreassignmentCreate": {
        "properties": {
          "email": {
            "description": "The email they sign in to Shopify with.",
            "type": "string"
          },
          "role_id": {
            "description": "The role to give them, an `id` from `GET /roles`.",
            "type": "string"
          }
        },
        "required": ["email", "role_id"],
        "type": "object"
      },
      "StaffPreassignmentDeleted": {
        "properties": {
          "deleted": {
            "type": "boolean"
          },
          "id": {
            "type": "string"
          }
        },
        "required": ["id", "deleted"],
        "type": "object"
      },
      "StaffRatesPage": {
        "properties": {
          "items": {
            "items": {
              "properties": {
                "id": {
                  "description": "The staff id.",
                  "type": "string"
                },
                "locked_reason": {
                  "description": "Why this person can’t change the rate, or null.",
                  "nullable": true,
                  "type": "string"
                },
                "name": {
                  "type": "string"
                },
                "rate_percent": {
                  "description": "Two decimals. Null: no rate.",
                  "nullable": true,
                  "type": "number"
                },
                "role_name": {
                  "nullable": true,
                  "type": "string"
                }
              },
              "required": [
                "id",
                "name",
                "role_name",
                "rate_percent",
                "locked_reason"
              ],
              "type": "object"
            },
            "type": "array"
          },
          "next_cursor": {
            "nullable": true,
            "type": "string"
          },
          "no_rate_count": {
            "type": "integer"
          },
          "page_size": {
            "type": "integer"
          },
          "total": {
            "description": "People matching the search and the filter, over every page.",
            "type": "integer"
          }
        },
        "required": [
          "items",
          "total",
          "no_rate_count",
          "page_size",
          "next_cursor"
        ],
        "type": "object"
      },
      "StaffRatesSave": {
        "properties": {
          "changes": {
            "description": "One entry per person, up to 100.",
            "items": {
              "properties": {
                "rate_percent": {
                  "description": "0 to 100, up to two decimals; null for no rate. Decimal text (\"8.00\", or empty for no rate) is accepted too.",
                  "nullable": true,
                  "type": "number"
                },
                "staff_id": {
                  "type": "string"
                }
              },
              "required": ["staff_id", "rate_percent"],
              "type": "object"
            },
            "type": "array"
          }
        },
        "required": ["changes"],
        "type": "object"
      },
      "StaffRatesSaved": {
        "properties": {
          "items": {
            "description": "Each named person’s rate now.",
            "items": {
              "properties": {
                "rate_percent": {
                  "description": "A percentage, two decimals.",
                  "nullable": true,
                  "type": "number"
                },
                "staff_id": {
                  "type": "string"
                }
              },
              "required": ["staff_id", "rate_percent"],
              "type": "object"
            },
            "type": "array"
          }
        },
        "required": ["items"],
        "type": "object"
      },
      "StaffRules": {
        "properties": {
          "discount_over_limit": {
            "description": "A discount over the giver’s role limit: `block` it (with who can approve more) or `allow_and_flag` it (saved, on the order’s Activity, and the approvers are emailed).",
            "enum": ["block", "allow_and_flag"],
            "type": "string"
          },
          "pos_identity_mode": {
            "description": "Whose role applies on POS: `pin_staff` (the staff member who entered their PIN) or `device_account` (the account signed in to the device).",
            "enum": ["pin_staff", "device_account"],
            "type": "string"
          },
          "pos_sign_ins": {
            "description": "POS sign-ins of the last 30 days (at most 25), newest first.",
            "items": {
              "properties": {
                "device_name": {
                  "type": "string"
                },
                "device_staff_id": {
                  "description": "The account signed in to the device.",
                  "type": "string"
                },
                "id": {
                  "type": "string"
                },
                "last_seen_at": {
                  "format": "date-time",
                  "type": "string"
                },
                "reported_staff_id": {
                  "description": "The PIN staff id POS reported (digits); what `POST /staff/pos-staff` takes. Null when POS didn’t say.",
                  "nullable": true,
                  "type": "string"
                },
                "same_as_device": {
                  "description": "The person who entered their PIN is the device account itself.",
                  "type": "boolean"
                },
                "staff_id": {
                  "description": "With `known`: the staff member, an `id` `GET /staff/access` lists.",
                  "nullable": true,
                  "type": "string"
                },
                "staff_name": {
                  "nullable": true,
                  "type": "string"
                },
                "status": {
                  "description": "`known` (a staff member OrderPilot has), `not_in_orderpilot` (a PIN staff id nobody has added yet: `POST /staff/pos-staff`) or `unknown` (POS didn’t say who).",
                  "enum": ["known", "not_in_orderpilot", "unknown"],
                  "type": "string"
                }
              },
              "required": [
                "id",
                "status",
                "reported_staff_id",
                "staff_id",
                "staff_name",
                "device_staff_id",
                "device_name",
                "same_as_device",
                "last_seen_at"
              ],
              "type": "object"
            },
            "type": "array"
          },
          "pos_unknown_fallback": {
            "description": "When POS can’t tell who is signed in: `view_only` or `no_access`.",
            "enum": ["view_only", "no_access"],
            "type": "string"
          },
          "preassignments": {
            "items": {
              "properties": {
                "created_at": {
                  "format": "date-time",
                  "type": "string"
                },
                "created_by_name": {
                  "description": "Who pre-assigned it; null for an API key or someone who has left.",
                  "nullable": true,
                  "type": "string"
                },
                "email": {
                  "description": "The email they sign in to Shopify with (lowercase).",
                  "type": "string"
                },
                "id": {
                  "type": "string"
                },
                "role_id": {
                  "description": "The role they get on their first visit.",
                  "type": "string"
                },
                "role_name": {
                  "nullable": true,
                  "type": "string"
                }
              },
              "required": [
                "id",
                "email",
                "role_id",
                "role_name",
                "created_at",
                "created_by_name"
              ],
              "type": "object"
            },
            "type": "array"
          },
          "show_discount_approvers": {
            "description": "Name who can approve a larger discount when one is over a limit.",
            "type": "boolean"
          },
          "unassigned_policy": {
            "description": "What people without a role get: `no_access`, or `default_role` (the role `unassigned_role_id` names, at every location).",
            "enum": ["no_access", "default_role"],
            "type": "string"
          },
          "unassigned_role_id": {
            "description": "With `default_role`: the role people without one get, an `id` from `GET /roles`. Null with `no_access`.",
            "nullable": true,
            "type": "string"
          }
        },
        "required": [
          "unassigned_policy",
          "unassigned_role_id",
          "pos_identity_mode",
          "pos_unknown_fallback",
          "discount_over_limit",
          "show_discount_approvers",
          "preassignments",
          "pos_sign_ins"
        ],
        "type": "object"
      },
      "StaffRulesUpdate": {
        "description": "Only the rules to change.",
        "properties": {
          "discount_over_limit": {
            "description": "A discount over the giver’s role limit: `block` it (with who can approve more) or `allow_and_flag` it (saved, on the order’s Activity, and the approvers are emailed).",
            "enum": ["block", "allow_and_flag"],
            "type": "string"
          },
          "pos_identity_mode": {
            "description": "Whose role applies on POS: `pin_staff` (the staff member who entered their PIN) or `device_account` (the account signed in to the device).",
            "enum": ["pin_staff", "device_account"],
            "type": "string"
          },
          "pos_unknown_fallback": {
            "description": "When POS can’t tell who is signed in: `view_only` or `no_access`.",
            "enum": ["view_only", "no_access"],
            "type": "string"
          },
          "show_discount_approvers": {
            "description": "Name who can approve a larger discount when one is over a limit.",
            "type": "boolean"
          },
          "unassigned_policy": {
            "description": "What people without a role get: `no_access`, or `default_role` (the role `unassigned_role_id` names, at every location).",
            "enum": ["no_access", "default_role"],
            "type": "string"
          },
          "unassigned_role_id": {
            "description": "With `default_role`: the role people without one get, an `id` from `GET /roles`. Null with `no_access`.",
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "StaffSuspend": {
        "properties": {
          "reason": {
            "description": "Why, shown on Staff and roles (at most 200 characters).",
            "type": "string"
          }
        },
        "type": "object"
      },
      "StatusChange": {
        "description": "Send `status` (its name) or `status_id` (it survives a rename).",
        "properties": {
          "status": {
            "description": "A status’s name, as `GET /statuses` or the record’s `next_statuses` give it: case and spacing don’t matter. A name more than one status has is refused (`400 UNKNOWN_STATUS`, each one’s id in `error.matches`): send its `status_id`.",
            "type": "string"
          },
          "status_id": {
            "description": "A status id from `GET /statuses`. Wins over `status` when both are sent.",
            "type": "string"
          }
        },
        "type": "object"
      },
      "StatusChanged": {
        "properties": {
          "changed": {
            "description": "False when it was already at that status.",
            "type": "boolean"
          },
          "id": {
            "type": "string"
          },
          "next_statuses": {
            "description": "Where it may go from the status it is in now (as `next_statuses` on a read).",
            "items": {
              "$ref": "#/components/schemas/NextStatus"
            },
            "type": "array"
          },
          "status": {
            "description": "The status name now.",
            "type": "string"
          },
          "status_group": {
            "enum": [
              "quote",
              "confirmed",
              "in_production",
              "ready",
              "on_its_way",
              "complete",
              "cancelled",
              null
            ],
            "nullable": true,
            "type": "string"
          },
          "status_id": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "StatusList": {
        "properties": {
          "items": {
            "items": {
              "properties": {
                "color": {
                  "description": "The status’s colour, as set in OrderPilot.",
                  "type": "string"
                },
                "group": {
                  "description": "The stable key of the status’s group; null for a merchant’s own group or none.",
                  "enum": [
                    "quote",
                    "confirmed",
                    "in_production",
                    "ready",
                    "on_its_way",
                    "complete",
                    "cancelled",
                    null
                  ],
                  "nullable": true,
                  "type": "string"
                },
                "id": {
                  "description": "Stable across renames.",
                  "type": "string"
                },
                "name": {
                  "type": "string"
                },
                "position": {
                  "type": "integer"
                }
              },
              "type": "object"
            },
            "type": "array"
          }
        },
        "type": "object"
      },
      "StatusMapChecksQueued": {
        "properties": {
          "capped": {
            "description": "More were open than one check takes; the first were queued.",
            "type": "boolean"
          },
          "queued": {
            "description": "Open orders to be checked within seconds.",
            "type": "integer"
          }
        },
        "required": ["queued", "capped"],
        "type": "object"
      },
      "StatusMapDraftSave": {
        "properties": {
          "document": {
            "description": "The status map’s cards (`nodes`) and connections. Send it back whole: a card or connection left out is removed (a status’s card comes back while the status exists; the app’s own connections are redrawn). Up to 256 KB through the API.",
            "properties": {
              "connections": {
                "items": {
                  "properties": {
                    "actions": {
                      "items": {
                        "description": "What the connection does as well as the move. `add_tag` and `remove_tag` carry `tag`; `activity_note` carries `text`; `email_customer` carries `template_key`; `notify_staff` carries `text` and, when it also emails, `emails`; the others carry nothing more. The app’s own (`system` in the vocabulary) sit only on its own connections, locked.",
                        "properties": {
                          "emails": {
                            "description": "`notify_staff`: addresses emailed besides the order’s salespeople. Left out when there are none.",
                            "items": {
                              "type": "string"
                            },
                            "type": "array"
                          },
                          "id": {
                            "description": "Unique in the connection.",
                            "type": "string"
                          },
                          "tag": {
                            "description": "`add_tag`, `remove_tag`: the order tag.",
                            "type": "string"
                          },
                          "template_key": {
                            "description": "`email_customer`: the email to send, a `value` of `options.email_templates` in `GET /settings/status-map`.",
                            "type": "string"
                          },
                          "text": {
                            "description": "`activity_note`: the note. `notify_staff`: the message to staff.",
                            "type": "string"
                          },
                          "type": {
                            "description": "A `type` of `actions` in `GET /settings/status-map/vocabulary`.",
                            "enum": [
                              "add_tag",
                              "remove_tag",
                              "activity_note",
                              "email_customer",
                              "draft_replacement_po",
                              "turn_customer_payment_on",
                              "notify_staff",
                              "waive_signature",
                              "place_order",
                              "mark_as_order",
                              "convert_draft_pay_later",
                              "refresh_invoice",
                              "clear_review_flag",
                              "mark_as_quote",
                              "note_changes_requested"
                            ],
                            "type": "string"
                          }
                        },
                        "required": ["id", "type"],
                        "type": "object"
                      },
                      "type": "array"
                    },
                    "conditions": {
                      "items": {
                        "description": "A check the order must pass. `scope: order` reads the order or quote: `field`, `op` and `value`. `scope: lines` reads its lines: `quant` (how many lines) and `where` (what each such line is).",
                        "properties": {
                          "field": {
                            "description": "`order` only: what it reads, a `field` of `condition_fields` with `scope: order` in `GET /settings/status-map/vocabulary`.",
                            "enum": [
                              "is_quote",
                              "placed_in_shopify",
                              "status_waits_for_placement",
                              "unconfirmed_quote",
                              "saved_in_shopify",
                              "origin",
                              "location_id",
                              "tags",
                              "note",
                              "assigned_to_staff_id",
                              "in_store_sale",
                              "is_split_part",
                              "split_part",
                              "cancelled",
                              "cancellation_reason",
                              "change_source",
                              "review_required",
                              "review_required_for_all_orders",
                              "signed",
                              "signature_status",
                              "signature_required",
                              "signature_waived",
                              "financial_status",
                              "fully_paid",
                              "total_price",
                              "total_paid",
                              "remaining_balance",
                              "deposit_percentage",
                              "deposit_required_percent",
                              "payment_due_later",
                              "customer_payment_on",
                              "latest_refund_amount",
                              "total_refunded",
                              "refund_owed",
                              "refund_source",
                              "purchasing_progress",
                              "not_fully_on_pos",
                              "missing_vendor",
                              "fulfillment_status",
                              "delivery_progress",
                              "ever_delivered",
                              "follow_ups_sent"
                            ],
                            "type": "string"
                          },
                          "id": {
                            "description": "Unique in the connection.",
                            "type": "string"
                          },
                          "op": {
                            "description": "`order` only. How it compares: an `op` of `ops` in `GET /settings/status-map/vocabulary`, one its field’s `type` lists.",
                            "enum": [
                              "is",
                              "is_not",
                              "contains",
                              "not_contains",
                              "starts_with",
                              "ends_with",
                              "is_empty",
                              "is_not_empty",
                              "eq",
                              "neq",
                              "gt",
                              "gte",
                              "lt",
                              "lte",
                              "is_set",
                              "is_not_set",
                              "is_yes",
                              "is_no",
                              "is_one_of",
                              "is_not_one_of",
                              "has",
                              "has_not",
                              "has_any",
                              "has_all",
                              "has_none"
                            ],
                            "type": "string"
                          },
                          "quant": {
                            "description": "`lines` only: at least one line, every line or no line (`line_quants` in `GET /settings/status-map/vocabulary`).",
                            "enum": ["any", "all", "none"],
                            "type": "string"
                          },
                          "scope": {
                            "description": "The order or quote, or its lines.",
                            "enum": ["order", "lines"],
                            "type": "string"
                          },
                          "value": {
                            "description": "`order` only. What it compares with: text, a number, true or false, a list of texts (`is_one_of`, `has_any`, …), or null. Left out when the `op` takes none (`takes_value: false` in `ops` of `GET /settings/status-map/vocabulary`). A choice field takes the `value` of its `values`, or an id of the `options` list its `values_from` names."
                          },
                          "where": {
                            "description": "`lines` only: the checks each such line passes.",
                            "items": {
                              "description": "One check on a line; all of a `lines` condition’s checks hold on the same line.",
                              "properties": {
                                "field": {
                                  "description": "What it reads on the line: a `field` of `condition_fields` with `scope: lines` in `GET /settings/status-map/vocabulary`.",
                                  "enum": [
                                    "title",
                                    "sku",
                                    "vendor_id",
                                    "category_id",
                                    "quantity",
                                    "price",
                                    "review_required",
                                    "delivery_method",
                                    "stock_source",
                                    "stock_arrived",
                                    "po_required",
                                    "on_purchase_order",
                                    "on_open_po",
                                    "po_sent",
                                    "fully_on_sent_pos",
                                    "not_fully_on_pos",
                                    "purchase_order_status",
                                    "fully_received",
                                    "any_part_received",
                                    "received_quantity",
                                    "any_rejected",
                                    "all_received_rejected",
                                    "rejected_quantity",
                                    "rejection_reason",
                                    "shipped_quantity",
                                    "delivered_quantity"
                                  ],
                                  "type": "string"
                                },
                                "id": {
                                  "description": "Unique in the connection.",
                                  "type": "string"
                                },
                                "op": {
                                  "description": "How it compares: an `op` of `ops` in `GET /settings/status-map/vocabulary`, one its field’s `type` lists.",
                                  "enum": [
                                    "is",
                                    "is_not",
                                    "contains",
                                    "not_contains",
                                    "starts_with",
                                    "ends_with",
                                    "is_empty",
                                    "is_not_empty",
                                    "eq",
                                    "neq",
                                    "gt",
                                    "gte",
                                    "lt",
                                    "lte",
                                    "is_set",
                                    "is_not_set",
                                    "is_yes",
                                    "is_no",
                                    "is_one_of",
                                    "is_not_one_of",
                                    "has",
                                    "has_not",
                                    "has_any",
                                    "has_all",
                                    "has_none"
                                  ],
                                  "type": "string"
                                },
                                "value": {
                                  "description": "What it compares with: text, a number, true or false, a list of texts (`is_one_of`, `has_any`, …), or null. Left out when the `op` takes none (`takes_value: false` in `ops` of `GET /settings/status-map/vocabulary`). A choice field takes the `value` of its `values`, or an id of the `options` list its `values_from` names."
                                }
                              },
                              "required": ["id", "field", "op"],
                              "type": "object"
                            },
                            "type": "array"
                          }
                        },
                        "required": ["id", "scope"],
                        "type": "object"
                      },
                      "type": "array"
                    },
                    "event": {
                      "description": "Its When, lowercased: an `event` of `events` in `GET /settings/status-map/vocabulary` (`staff_button`, `created`, …); null for a branch.",
                      "nullable": true,
                      "type": "string"
                    },
                    "event_choices": {
                      "description": "Each a `choice` of the When’s `choices` in `GET /settings/status-map/vocabulary`.",
                      "items": {
                        "type": "string"
                      },
                      "type": "array"
                    },
                    "from": {
                      "description": "The card it leaves (a node `key`).",
                      "type": "string"
                    },
                    "handover_methods": {
                      "description": "“Items are handed over” only: each a `method` of `handover_methods` in `GET /settings/status-map/vocabulary`; none means any way.",
                      "items": {
                        "type": "string"
                      },
                      "type": "array"
                    },
                    "key": {
                      "description": "Stable across versions.",
                      "type": "string"
                    },
                    "kind": {
                      "description": "It moves by itself (`auto`), on a staff `button`, or is a junction’s `branch`.",
                      "enum": ["auto", "button", "branch"],
                      "type": "string"
                    },
                    "label": {
                      "type": "string"
                    },
                    "match": {
                      "description": "All or any of its conditions.",
                      "enum": ["all", "any"],
                      "type": "string"
                    },
                    "position": {
                      "description": "Its place in the priority list of the card it leaves.",
                      "type": "integer"
                    },
                    "role": {
                      "description": "Primary or backup: the app’s; ignored on a save.",
                      "enum": ["primary", "backup"],
                      "type": "string"
                    },
                    "scope": {
                      "description": "A split order: its parts together or each on its own.",
                      "enum": ["whole_order", "each_part"],
                      "type": "string"
                    },
                    "send_status_email": {
                      "description": "Send the target status’s own email on the move.",
                      "type": "boolean"
                    },
                    "system_key": {
                      "description": "Set on the app’s own connections: their When, conditions and target are locked; their actions, email and priority can change.",
                      "nullable": true,
                      "type": "string"
                    },
                    "to": {
                      "description": "The card it leads to.",
                      "type": "string"
                    },
                    "unlock_event": {
                      "description": "A button’s “Unlocked when”: an `event` of `unlock_events` in `GET /settings/status-map/vocabulary`.",
                      "nullable": true,
                      "type": "string"
                    }
                  },
                  "required": [
                    "key",
                    "from",
                    "to",
                    "kind",
                    "event",
                    "label",
                    "match",
                    "conditions",
                    "actions"
                  ],
                  "type": "object"
                },
                "type": "array"
              },
              "nodes": {
                "items": {
                  "properties": {
                    "key": {
                      "description": "Stable across versions: the status id for a status card.",
                      "type": "string"
                    },
                    "kind": {
                      "description": "A status’s card, a junction, or Any status.",
                      "enum": ["status", "junction", "any"],
                      "type": "string"
                    },
                    "name": {
                      "description": "A junction’s label.",
                      "nullable": true,
                      "type": "string"
                    },
                    "status_id": {
                      "nullable": true,
                      "type": "string"
                    },
                    "x": {
                      "type": "number"
                    },
                    "y": {
                      "type": "number"
                    }
                  },
                  "required": ["key", "kind", "status_id", "name", "x", "y"],
                  "type": "object"
                },
                "type": "array"
              }
            },
            "required": ["nodes", "connections"],
            "type": "object"
          },
          "expected_updated_at": {
            "description": "The `draft_updated_at` you read, when you don’t send `version`.",
            "type": "string"
          },
          "version": {
            "description": "The `version` of the last answer about this record (GET /settings/status-map, or the last change to the map), sent back exactly as it is: no read needed first. A change made since is refused (409) with the current `version` and what `changed`. Send this or `expected_updated_at`.",
            "type": "string"
          }
        },
        "required": ["document"],
        "type": "object"
      },
      "StatusMapDraftSaved": {
        "properties": {
          "draft": {
            "description": "The status map’s cards (`nodes`) and connections. Send it back whole: a card or connection left out is removed (a status’s card comes back while the status exists; the app’s own connections are redrawn). Up to 256 KB through the API.",
            "properties": {
              "connections": {
                "items": {
                  "properties": {
                    "actions": {
                      "items": {
                        "description": "What the connection does as well as the move. `add_tag` and `remove_tag` carry `tag`; `activity_note` carries `text`; `email_customer` carries `template_key`; `notify_staff` carries `text` and, when it also emails, `emails`; the others carry nothing more. The app’s own (`system` in the vocabulary) sit only on its own connections, locked.",
                        "properties": {
                          "emails": {
                            "description": "`notify_staff`: addresses emailed besides the order’s salespeople. Left out when there are none.",
                            "items": {
                              "type": "string"
                            },
                            "type": "array"
                          },
                          "id": {
                            "description": "Unique in the connection.",
                            "type": "string"
                          },
                          "tag": {
                            "description": "`add_tag`, `remove_tag`: the order tag.",
                            "type": "string"
                          },
                          "template_key": {
                            "description": "`email_customer`: the email to send, a `value` of `options.email_templates` in `GET /settings/status-map`.",
                            "type": "string"
                          },
                          "text": {
                            "description": "`activity_note`: the note. `notify_staff`: the message to staff.",
                            "type": "string"
                          },
                          "type": {
                            "description": "A `type` of `actions` in `GET /settings/status-map/vocabulary`.",
                            "enum": [
                              "add_tag",
                              "remove_tag",
                              "activity_note",
                              "email_customer",
                              "draft_replacement_po",
                              "turn_customer_payment_on",
                              "notify_staff",
                              "waive_signature",
                              "place_order",
                              "mark_as_order",
                              "convert_draft_pay_later",
                              "refresh_invoice",
                              "clear_review_flag",
                              "mark_as_quote",
                              "note_changes_requested"
                            ],
                            "type": "string"
                          }
                        },
                        "required": ["id", "type"],
                        "type": "object"
                      },
                      "type": "array"
                    },
                    "conditions": {
                      "items": {
                        "description": "A check the order must pass. `scope: order` reads the order or quote: `field`, `op` and `value`. `scope: lines` reads its lines: `quant` (how many lines) and `where` (what each such line is).",
                        "properties": {
                          "field": {
                            "description": "`order` only: what it reads, a `field` of `condition_fields` with `scope: order` in `GET /settings/status-map/vocabulary`.",
                            "enum": [
                              "is_quote",
                              "placed_in_shopify",
                              "status_waits_for_placement",
                              "unconfirmed_quote",
                              "saved_in_shopify",
                              "origin",
                              "location_id",
                              "tags",
                              "note",
                              "assigned_to_staff_id",
                              "in_store_sale",
                              "is_split_part",
                              "split_part",
                              "cancelled",
                              "cancellation_reason",
                              "change_source",
                              "review_required",
                              "review_required_for_all_orders",
                              "signed",
                              "signature_status",
                              "signature_required",
                              "signature_waived",
                              "financial_status",
                              "fully_paid",
                              "total_price",
                              "total_paid",
                              "remaining_balance",
                              "deposit_percentage",
                              "deposit_required_percent",
                              "payment_due_later",
                              "customer_payment_on",
                              "latest_refund_amount",
                              "total_refunded",
                              "refund_owed",
                              "refund_source",
                              "purchasing_progress",
                              "not_fully_on_pos",
                              "missing_vendor",
                              "fulfillment_status",
                              "delivery_progress",
                              "ever_delivered",
                              "follow_ups_sent"
                            ],
                            "type": "string"
                          },
                          "id": {
                            "description": "Unique in the connection.",
                            "type": "string"
                          },
                          "op": {
                            "description": "`order` only. How it compares: an `op` of `ops` in `GET /settings/status-map/vocabulary`, one its field’s `type` lists.",
                            "enum": [
                              "is",
                              "is_not",
                              "contains",
                              "not_contains",
                              "starts_with",
                              "ends_with",
                              "is_empty",
                              "is_not_empty",
                              "eq",
                              "neq",
                              "gt",
                              "gte",
                              "lt",
                              "lte",
                              "is_set",
                              "is_not_set",
                              "is_yes",
                              "is_no",
                              "is_one_of",
                              "is_not_one_of",
                              "has",
                              "has_not",
                              "has_any",
                              "has_all",
                              "has_none"
                            ],
                            "type": "string"
                          },
                          "quant": {
                            "description": "`lines` only: at least one line, every line or no line (`line_quants` in `GET /settings/status-map/vocabulary`).",
                            "enum": ["any", "all", "none"],
                            "type": "string"
                          },
                          "scope": {
                            "description": "The order or quote, or its lines.",
                            "enum": ["order", "lines"],
                            "type": "string"
                          },
                          "value": {
                            "description": "`order` only. What it compares with: text, a number, true or false, a list of texts (`is_one_of`, `has_any`, …), or null. Left out when the `op` takes none (`takes_value: false` in `ops` of `GET /settings/status-map/vocabulary`). A choice field takes the `value` of its `values`, or an id of the `options` list its `values_from` names."
                          },
                          "where": {
                            "description": "`lines` only: the checks each such line passes.",
                            "items": {
                              "description": "One check on a line; all of a `lines` condition’s checks hold on the same line.",
                              "properties": {
                                "field": {
                                  "description": "What it reads on the line: a `field` of `condition_fields` with `scope: lines` in `GET /settings/status-map/vocabulary`.",
                                  "enum": [
                                    "title",
                                    "sku",
                                    "vendor_id",
                                    "category_id",
                                    "quantity",
                                    "price",
                                    "review_required",
                                    "delivery_method",
                                    "stock_source",
                                    "stock_arrived",
                                    "po_required",
                                    "on_purchase_order",
                                    "on_open_po",
                                    "po_sent",
                                    "fully_on_sent_pos",
                                    "not_fully_on_pos",
                                    "purchase_order_status",
                                    "fully_received",
                                    "any_part_received",
                                    "received_quantity",
                                    "any_rejected",
                                    "all_received_rejected",
                                    "rejected_quantity",
                                    "rejection_reason",
                                    "shipped_quantity",
                                    "delivered_quantity"
                                  ],
                                  "type": "string"
                                },
                                "id": {
                                  "description": "Unique in the connection.",
                                  "type": "string"
                                },
                                "op": {
                                  "description": "How it compares: an `op` of `ops` in `GET /settings/status-map/vocabulary`, one its field’s `type` lists.",
                                  "enum": [
                                    "is",
                                    "is_not",
                                    "contains",
                                    "not_contains",
                                    "starts_with",
                                    "ends_with",
                                    "is_empty",
                                    "is_not_empty",
                                    "eq",
                                    "neq",
                                    "gt",
                                    "gte",
                                    "lt",
                                    "lte",
                                    "is_set",
                                    "is_not_set",
                                    "is_yes",
                                    "is_no",
                                    "is_one_of",
                                    "is_not_one_of",
                                    "has",
                                    "has_not",
                                    "has_any",
                                    "has_all",
                                    "has_none"
                                  ],
                                  "type": "string"
                                },
                                "value": {
                                  "description": "What it compares with: text, a number, true or false, a list of texts (`is_one_of`, `has_any`, …), or null. Left out when the `op` takes none (`takes_value: false` in `ops` of `GET /settings/status-map/vocabulary`). A choice field takes the `value` of its `values`, or an id of the `options` list its `values_from` names."
                                }
                              },
                              "required": ["id", "field", "op"],
                              "type": "object"
                            },
                            "type": "array"
                          }
                        },
                        "required": ["id", "scope"],
                        "type": "object"
                      },
                      "type": "array"
                    },
                    "event": {
                      "description": "Its When, lowercased: an `event` of `events` in `GET /settings/status-map/vocabulary` (`staff_button`, `created`, …); null for a branch.",
                      "nullable": true,
                      "type": "string"
                    },
                    "event_choices": {
                      "description": "Each a `choice` of the When’s `choices` in `GET /settings/status-map/vocabulary`.",
                      "items": {
                        "type": "string"
                      },
                      "type": "array"
                    },
                    "from": {
                      "description": "The card it leaves (a node `key`).",
                      "type": "string"
                    },
                    "handover_methods": {
                      "description": "“Items are handed over” only: each a `method` of `handover_methods` in `GET /settings/status-map/vocabulary`; none means any way.",
                      "items": {
                        "type": "string"
                      },
                      "type": "array"
                    },
                    "key": {
                      "description": "Stable across versions.",
                      "type": "string"
                    },
                    "kind": {
                      "description": "It moves by itself (`auto`), on a staff `button`, or is a junction’s `branch`.",
                      "enum": ["auto", "button", "branch"],
                      "type": "string"
                    },
                    "label": {
                      "type": "string"
                    },
                    "match": {
                      "description": "All or any of its conditions.",
                      "enum": ["all", "any"],
                      "type": "string"
                    },
                    "position": {
                      "description": "Its place in the priority list of the card it leaves.",
                      "type": "integer"
                    },
                    "role": {
                      "description": "Primary or backup: the app’s; ignored on a save.",
                      "enum": ["primary", "backup"],
                      "type": "string"
                    },
                    "scope": {
                      "description": "A split order: its parts together or each on its own.",
                      "enum": ["whole_order", "each_part"],
                      "type": "string"
                    },
                    "send_status_email": {
                      "description": "Send the target status’s own email on the move.",
                      "type": "boolean"
                    },
                    "system_key": {
                      "description": "Set on the app’s own connections: their When, conditions and target are locked; their actions, email and priority can change.",
                      "nullable": true,
                      "type": "string"
                    },
                    "to": {
                      "description": "The card it leads to.",
                      "type": "string"
                    },
                    "unlock_event": {
                      "description": "A button’s “Unlocked when”: an `event` of `unlock_events` in `GET /settings/status-map/vocabulary`.",
                      "nullable": true,
                      "type": "string"
                    }
                  },
                  "required": [
                    "key",
                    "from",
                    "to",
                    "kind",
                    "event",
                    "label",
                    "match",
                    "conditions",
                    "actions"
                  ],
                  "type": "object"
                },
                "type": "array"
              },
              "nodes": {
                "items": {
                  "properties": {
                    "key": {
                      "description": "Stable across versions: the status id for a status card.",
                      "type": "string"
                    },
                    "kind": {
                      "description": "A status’s card, a junction, or Any status.",
                      "enum": ["status", "junction", "any"],
                      "type": "string"
                    },
                    "name": {
                      "description": "A junction’s label.",
                      "nullable": true,
                      "type": "string"
                    },
                    "status_id": {
                      "nullable": true,
                      "type": "string"
                    },
                    "x": {
                      "type": "number"
                    },
                    "y": {
                      "type": "number"
                    }
                  },
                  "required": ["key", "kind", "status_id", "name", "x", "y"],
                  "type": "object"
                },
                "type": "array"
              }
            },
            "required": ["nodes", "connections"],
            "type": "object"
          },
          "draft_updated_at": {
            "type": "string"
          },
          "has_unpublished_changes": {
            "type": "boolean"
          },
          "version": {
            "description": "Send it back as `version` with the next write, exactly as it is: it stands for `draft_updated_at`, and every write answers the new one, so no read is needed between writes.",
            "type": "string"
          }
        },
        "required": ["draft", "draft_updated_at", "has_unpublished_changes"],
        "type": "object"
      },
      "StatusMapEditor": {
        "properties": {
          "can_edit": {
            "description": "This caller may change the map.",
            "type": "boolean"
          },
          "draft": {
            "description": "The status map’s cards (`nodes`) and connections. Send it back whole: a card or connection left out is removed (a status’s card comes back while the status exists; the app’s own connections are redrawn). Up to 256 KB through the API.",
            "properties": {
              "connections": {
                "items": {
                  "properties": {
                    "actions": {
                      "items": {
                        "description": "What the connection does as well as the move. `add_tag` and `remove_tag` carry `tag`; `activity_note` carries `text`; `email_customer` carries `template_key`; `notify_staff` carries `text` and, when it also emails, `emails`; the others carry nothing more. The app’s own (`system` in the vocabulary) sit only on its own connections, locked.",
                        "properties": {
                          "emails": {
                            "description": "`notify_staff`: addresses emailed besides the order’s salespeople. Left out when there are none.",
                            "items": {
                              "type": "string"
                            },
                            "type": "array"
                          },
                          "id": {
                            "description": "Unique in the connection.",
                            "type": "string"
                          },
                          "tag": {
                            "description": "`add_tag`, `remove_tag`: the order tag.",
                            "type": "string"
                          },
                          "template_key": {
                            "description": "`email_customer`: the email to send, a `value` of `options.email_templates` in `GET /settings/status-map`.",
                            "type": "string"
                          },
                          "text": {
                            "description": "`activity_note`: the note. `notify_staff`: the message to staff.",
                            "type": "string"
                          },
                          "type": {
                            "description": "A `type` of `actions` in `GET /settings/status-map/vocabulary`.",
                            "enum": [
                              "add_tag",
                              "remove_tag",
                              "activity_note",
                              "email_customer",
                              "draft_replacement_po",
                              "turn_customer_payment_on",
                              "notify_staff",
                              "waive_signature",
                              "place_order",
                              "mark_as_order",
                              "convert_draft_pay_later",
                              "refresh_invoice",
                              "clear_review_flag",
                              "mark_as_quote",
                              "note_changes_requested"
                            ],
                            "type": "string"
                          }
                        },
                        "required": ["id", "type"],
                        "type": "object"
                      },
                      "type": "array"
                    },
                    "conditions": {
                      "items": {
                        "description": "A check the order must pass. `scope: order` reads the order or quote: `field`, `op` and `value`. `scope: lines` reads its lines: `quant` (how many lines) and `where` (what each such line is).",
                        "properties": {
                          "field": {
                            "description": "`order` only: what it reads, a `field` of `condition_fields` with `scope: order` in `GET /settings/status-map/vocabulary`.",
                            "enum": [
                              "is_quote",
                              "placed_in_shopify",
                              "status_waits_for_placement",
                              "unconfirmed_quote",
                              "saved_in_shopify",
                              "origin",
                              "location_id",
                              "tags",
                              "note",
                              "assigned_to_staff_id",
                              "in_store_sale",
                              "is_split_part",
                              "split_part",
                              "cancelled",
                              "cancellation_reason",
                              "change_source",
                              "review_required",
                              "review_required_for_all_orders",
                              "signed",
                              "signature_status",
                              "signature_required",
                              "signature_waived",
                              "financial_status",
                              "fully_paid",
                              "total_price",
                              "total_paid",
                              "remaining_balance",
                              "deposit_percentage",
                              "deposit_required_percent",
                              "payment_due_later",
                              "customer_payment_on",
                              "latest_refund_amount",
                              "total_refunded",
                              "refund_owed",
                              "refund_source",
                              "purchasing_progress",
                              "not_fully_on_pos",
                              "missing_vendor",
                              "fulfillment_status",
                              "delivery_progress",
                              "ever_delivered",
                              "follow_ups_sent"
                            ],
                            "type": "string"
                          },
                          "id": {
                            "description": "Unique in the connection.",
                            "type": "string"
                          },
                          "op": {
                            "description": "`order` only. How it compares: an `op` of `ops` in `GET /settings/status-map/vocabulary`, one its field’s `type` lists.",
                            "enum": [
                              "is",
                              "is_not",
                              "contains",
                              "not_contains",
                              "starts_with",
                              "ends_with",
                              "is_empty",
                              "is_not_empty",
                              "eq",
                              "neq",
                              "gt",
                              "gte",
                              "lt",
                              "lte",
                              "is_set",
                              "is_not_set",
                              "is_yes",
                              "is_no",
                              "is_one_of",
                              "is_not_one_of",
                              "has",
                              "has_not",
                              "has_any",
                              "has_all",
                              "has_none"
                            ],
                            "type": "string"
                          },
                          "quant": {
                            "description": "`lines` only: at least one line, every line or no line (`line_quants` in `GET /settings/status-map/vocabulary`).",
                            "enum": ["any", "all", "none"],
                            "type": "string"
                          },
                          "scope": {
                            "description": "The order or quote, or its lines.",
                            "enum": ["order", "lines"],
                            "type": "string"
                          },
                          "value": {
                            "description": "`order` only. What it compares with: text, a number, true or false, a list of texts (`is_one_of`, `has_any`, …), or null. Left out when the `op` takes none (`takes_value: false` in `ops` of `GET /settings/status-map/vocabulary`). A choice field takes the `value` of its `values`, or an id of the `options` list its `values_from` names."
                          },
                          "where": {
                            "description": "`lines` only: the checks each such line passes.",
                            "items": {
                              "description": "One check on a line; all of a `lines` condition’s checks hold on the same line.",
                              "properties": {
                                "field": {
                                  "description": "What it reads on the line: a `field` of `condition_fields` with `scope: lines` in `GET /settings/status-map/vocabulary`.",
                                  "enum": [
                                    "title",
                                    "sku",
                                    "vendor_id",
                                    "category_id",
                                    "quantity",
                                    "price",
                                    "review_required",
                                    "delivery_method",
                                    "stock_source",
                                    "stock_arrived",
                                    "po_required",
                                    "on_purchase_order",
                                    "on_open_po",
                                    "po_sent",
                                    "fully_on_sent_pos",
                                    "not_fully_on_pos",
                                    "purchase_order_status",
                                    "fully_received",
                                    "any_part_received",
                                    "received_quantity",
                                    "any_rejected",
                                    "all_received_rejected",
                                    "rejected_quantity",
                                    "rejection_reason",
                                    "shipped_quantity",
                                    "delivered_quantity"
                                  ],
                                  "type": "string"
                                },
                                "id": {
                                  "description": "Unique in the connection.",
                                  "type": "string"
                                },
                                "op": {
                                  "description": "How it compares: an `op` of `ops` in `GET /settings/status-map/vocabulary`, one its field’s `type` lists.",
                                  "enum": [
                                    "is",
                                    "is_not",
                                    "contains",
                                    "not_contains",
                                    "starts_with",
                                    "ends_with",
                                    "is_empty",
                                    "is_not_empty",
                                    "eq",
                                    "neq",
                                    "gt",
                                    "gte",
                                    "lt",
                                    "lte",
                                    "is_set",
                                    "is_not_set",
                                    "is_yes",
                                    "is_no",
                                    "is_one_of",
                                    "is_not_one_of",
                                    "has",
                                    "has_not",
                                    "has_any",
                                    "has_all",
                                    "has_none"
                                  ],
                                  "type": "string"
                                },
                                "value": {
                                  "description": "What it compares with: text, a number, true or false, a list of texts (`is_one_of`, `has_any`, …), or null. Left out when the `op` takes none (`takes_value: false` in `ops` of `GET /settings/status-map/vocabulary`). A choice field takes the `value` of its `values`, or an id of the `options` list its `values_from` names."
                                }
                              },
                              "required": ["id", "field", "op"],
                              "type": "object"
                            },
                            "type": "array"
                          }
                        },
                        "required": ["id", "scope"],
                        "type": "object"
                      },
                      "type": "array"
                    },
                    "event": {
                      "description": "Its When, lowercased: an `event` of `events` in `GET /settings/status-map/vocabulary` (`staff_button`, `created`, …); null for a branch.",
                      "nullable": true,
                      "type": "string"
                    },
                    "event_choices": {
                      "description": "Each a `choice` of the When’s `choices` in `GET /settings/status-map/vocabulary`.",
                      "items": {
                        "type": "string"
                      },
                      "type": "array"
                    },
                    "from": {
                      "description": "The card it leaves (a node `key`).",
                      "type": "string"
                    },
                    "handover_methods": {
                      "description": "“Items are handed over” only: each a `method` of `handover_methods` in `GET /settings/status-map/vocabulary`; none means any way.",
                      "items": {
                        "type": "string"
                      },
                      "type": "array"
                    },
                    "key": {
                      "description": "Stable across versions.",
                      "type": "string"
                    },
                    "kind": {
                      "description": "It moves by itself (`auto`), on a staff `button`, or is a junction’s `branch`.",
                      "enum": ["auto", "button", "branch"],
                      "type": "string"
                    },
                    "label": {
                      "type": "string"
                    },
                    "match": {
                      "description": "All or any of its conditions.",
                      "enum": ["all", "any"],
                      "type": "string"
                    },
                    "position": {
                      "description": "Its place in the priority list of the card it leaves.",
                      "type": "integer"
                    },
                    "role": {
                      "description": "Primary or backup: the app’s; ignored on a save.",
                      "enum": ["primary", "backup"],
                      "type": "string"
                    },
                    "scope": {
                      "description": "A split order: its parts together or each on its own.",
                      "enum": ["whole_order", "each_part"],
                      "type": "string"
                    },
                    "send_status_email": {
                      "description": "Send the target status’s own email on the move.",
                      "type": "boolean"
                    },
                    "system_key": {
                      "description": "Set on the app’s own connections: their When, conditions and target are locked; their actions, email and priority can change.",
                      "nullable": true,
                      "type": "string"
                    },
                    "to": {
                      "description": "The card it leads to.",
                      "type": "string"
                    },
                    "unlock_event": {
                      "description": "A button’s “Unlocked when”: an `event` of `unlock_events` in `GET /settings/status-map/vocabulary`.",
                      "nullable": true,
                      "type": "string"
                    }
                  },
                  "required": [
                    "key",
                    "from",
                    "to",
                    "kind",
                    "event",
                    "label",
                    "match",
                    "conditions",
                    "actions"
                  ],
                  "type": "object"
                },
                "type": "array"
              },
              "nodes": {
                "items": {
                  "properties": {
                    "key": {
                      "description": "Stable across versions: the status id for a status card.",
                      "type": "string"
                    },
                    "kind": {
                      "description": "A status’s card, a junction, or Any status.",
                      "enum": ["status", "junction", "any"],
                      "type": "string"
                    },
                    "name": {
                      "description": "A junction’s label.",
                      "nullable": true,
                      "type": "string"
                    },
                    "status_id": {
                      "nullable": true,
                      "type": "string"
                    },
                    "x": {
                      "type": "number"
                    },
                    "y": {
                      "type": "number"
                    }
                  },
                  "required": ["key", "kind", "status_id", "name", "x", "y"],
                  "type": "object"
                },
                "type": "array"
              }
            },
            "required": ["nodes", "connections"],
            "type": "object"
          },
          "draft_updated_at": {
            "description": "When the draft was last saved: send it as `expected_updated_at` (`version` holds it).",
            "type": "string"
          },
          "groups": {
            "items": {
              "properties": {
                "customer_text": {
                  "description": "What the customer reads under the group’s name.",
                  "nullable": true,
                  "type": "string"
                },
                "id": {
                  "type": "string"
                },
                "name": {
                  "type": "string"
                },
                "position": {
                  "type": "integer"
                },
                "system_key": {
                  "description": "A default group’s stable key; null for one you added.",
                  "enum": [
                    "quote",
                    "confirmed",
                    "in_production",
                    "ready",
                    "on_its_way",
                    "complete",
                    "cancelled",
                    null
                  ],
                  "nullable": true,
                  "type": "string"
                }
              },
              "required": [
                "id",
                "name",
                "customer_text",
                "position",
                "system_key"
              ],
              "type": "object"
            },
            "type": "array"
          },
          "has_unpublished_changes": {
            "type": "boolean"
          },
          "open_order_count": {
            "description": "Open orders check-open-orders would check (0 without Change order status).",
            "type": "integer"
          },
          "options": {
            "description": "The choices conditions and actions take (ids and labels).",
            "properties": {
              "categories": {
                "items": {
                  "properties": {
                    "label": {
                      "type": "string"
                    },
                    "value": {
                      "type": "string"
                    }
                  },
                  "required": ["value", "label"],
                  "type": "object"
                },
                "type": "array"
              },
              "email_templates": {
                "items": {
                  "properties": {
                    "label": {
                      "type": "string"
                    },
                    "value": {
                      "type": "string"
                    }
                  },
                  "required": ["value", "label"],
                  "type": "object"
                },
                "type": "array"
              },
              "locations": {
                "items": {
                  "properties": {
                    "label": {
                      "type": "string"
                    },
                    "value": {
                      "type": "string"
                    }
                  },
                  "required": ["value", "label"],
                  "type": "object"
                },
                "type": "array"
              },
              "staff": {
                "items": {
                  "properties": {
                    "label": {
                      "type": "string"
                    },
                    "value": {
                      "type": "string"
                    }
                  },
                  "required": ["value", "label"],
                  "type": "object"
                },
                "type": "array"
              },
              "tags": {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              "vendors": {
                "items": {
                  "properties": {
                    "label": {
                      "type": "string"
                    },
                    "value": {
                      "type": "string"
                    }
                  },
                  "required": ["value", "label"],
                  "type": "object"
                },
                "type": "array"
              }
            },
            "type": "object"
          },
          "order_counts_shown": {
            "description": "False without View quotes and orders: the status counts are 0.",
            "type": "boolean"
          },
          "published": {
            "nullable": true,
            "properties": {
              "published_at": {
                "format": "date-time",
                "type": "string"
              },
              "published_by": {
                "nullable": true,
                "type": "string"
              },
              "version_number": {
                "type": "integer"
              }
            },
            "type": "object"
          },
          "statuses": {
            "items": {
              "properties": {
                "color": {
                  "type": "string"
                },
                "group_id": {
                  "nullable": true,
                  "type": "string"
                },
                "id": {
                  "type": "string"
                },
                "is_active": {
                  "type": "boolean"
                },
                "is_system": {
                  "type": "boolean"
                },
                "live_connection_count": {
                  "description": "Connections the published map has into or out of it: while above 0 it can’t be deleted.",
                  "type": "integer"
                },
                "name": {
                  "type": "string"
                },
                "order_count": {
                  "description": "Records in it (0 when `order_counts_shown` is false).",
                  "type": "integer"
                },
                "waits_for_placement": {
                  "type": "boolean"
                }
              },
              "required": [
                "id",
                "name",
                "color",
                "group_id",
                "is_system",
                "is_active",
                "waits_for_placement"
              ],
              "type": "object"
            },
            "type": "array"
          },
          "version": {
            "description": "Send it back as `version` with the next write, exactly as it is: it stands for `draft_updated_at` (saving, publishing, discarding or restoring the draft), and every write answers the new one, so no read is needed between writes.",
            "type": "string"
          }
        },
        "required": [
          "draft",
          "draft_updated_at",
          "version",
          "has_unpublished_changes",
          "published",
          "statuses",
          "groups",
          "options",
          "can_edit",
          "order_counts_shown",
          "open_order_count"
        ],
        "type": "object"
      },
      "StatusMapRestored": {
        "properties": {
          "can_edit": {
            "description": "This caller may change the map.",
            "type": "boolean"
          },
          "draft": {
            "description": "The status map’s cards (`nodes`) and connections. Send it back whole: a card or connection left out is removed (a status’s card comes back while the status exists; the app’s own connections are redrawn). Up to 256 KB through the API.",
            "properties": {
              "connections": {
                "items": {
                  "properties": {
                    "actions": {
                      "items": {
                        "description": "What the connection does as well as the move. `add_tag` and `remove_tag` carry `tag`; `activity_note` carries `text`; `email_customer` carries `template_key`; `notify_staff` carries `text` and, when it also emails, `emails`; the others carry nothing more. The app’s own (`system` in the vocabulary) sit only on its own connections, locked.",
                        "properties": {
                          "emails": {
                            "description": "`notify_staff`: addresses emailed besides the order’s salespeople. Left out when there are none.",
                            "items": {
                              "type": "string"
                            },
                            "type": "array"
                          },
                          "id": {
                            "description": "Unique in the connection.",
                            "type": "string"
                          },
                          "tag": {
                            "description": "`add_tag`, `remove_tag`: the order tag.",
                            "type": "string"
                          },
                          "template_key": {
                            "description": "`email_customer`: the email to send, a `value` of `options.email_templates` in `GET /settings/status-map`.",
                            "type": "string"
                          },
                          "text": {
                            "description": "`activity_note`: the note. `notify_staff`: the message to staff.",
                            "type": "string"
                          },
                          "type": {
                            "description": "A `type` of `actions` in `GET /settings/status-map/vocabulary`.",
                            "enum": [
                              "add_tag",
                              "remove_tag",
                              "activity_note",
                              "email_customer",
                              "draft_replacement_po",
                              "turn_customer_payment_on",
                              "notify_staff",
                              "waive_signature",
                              "place_order",
                              "mark_as_order",
                              "convert_draft_pay_later",
                              "refresh_invoice",
                              "clear_review_flag",
                              "mark_as_quote",
                              "note_changes_requested"
                            ],
                            "type": "string"
                          }
                        },
                        "required": ["id", "type"],
                        "type": "object"
                      },
                      "type": "array"
                    },
                    "conditions": {
                      "items": {
                        "description": "A check the order must pass. `scope: order` reads the order or quote: `field`, `op` and `value`. `scope: lines` reads its lines: `quant` (how many lines) and `where` (what each such line is).",
                        "properties": {
                          "field": {
                            "description": "`order` only: what it reads, a `field` of `condition_fields` with `scope: order` in `GET /settings/status-map/vocabulary`.",
                            "enum": [
                              "is_quote",
                              "placed_in_shopify",
                              "status_waits_for_placement",
                              "unconfirmed_quote",
                              "saved_in_shopify",
                              "origin",
                              "location_id",
                              "tags",
                              "note",
                              "assigned_to_staff_id",
                              "in_store_sale",
                              "is_split_part",
                              "split_part",
                              "cancelled",
                              "cancellation_reason",
                              "change_source",
                              "review_required",
                              "review_required_for_all_orders",
                              "signed",
                              "signature_status",
                              "signature_required",
                              "signature_waived",
                              "financial_status",
                              "fully_paid",
                              "total_price",
                              "total_paid",
                              "remaining_balance",
                              "deposit_percentage",
                              "deposit_required_percent",
                              "payment_due_later",
                              "customer_payment_on",
                              "latest_refund_amount",
                              "total_refunded",
                              "refund_owed",
                              "refund_source",
                              "purchasing_progress",
                              "not_fully_on_pos",
                              "missing_vendor",
                              "fulfillment_status",
                              "delivery_progress",
                              "ever_delivered",
                              "follow_ups_sent"
                            ],
                            "type": "string"
                          },
                          "id": {
                            "description": "Unique in the connection.",
                            "type": "string"
                          },
                          "op": {
                            "description": "`order` only. How it compares: an `op` of `ops` in `GET /settings/status-map/vocabulary`, one its field’s `type` lists.",
                            "enum": [
                              "is",
                              "is_not",
                              "contains",
                              "not_contains",
                              "starts_with",
                              "ends_with",
                              "is_empty",
                              "is_not_empty",
                              "eq",
                              "neq",
                              "gt",
                              "gte",
                              "lt",
                              "lte",
                              "is_set",
                              "is_not_set",
                              "is_yes",
                              "is_no",
                              "is_one_of",
                              "is_not_one_of",
                              "has",
                              "has_not",
                              "has_any",
                              "has_all",
                              "has_none"
                            ],
                            "type": "string"
                          },
                          "quant": {
                            "description": "`lines` only: at least one line, every line or no line (`line_quants` in `GET /settings/status-map/vocabulary`).",
                            "enum": ["any", "all", "none"],
                            "type": "string"
                          },
                          "scope": {
                            "description": "The order or quote, or its lines.",
                            "enum": ["order", "lines"],
                            "type": "string"
                          },
                          "value": {
                            "description": "`order` only. What it compares with: text, a number, true or false, a list of texts (`is_one_of`, `has_any`, …), or null. Left out when the `op` takes none (`takes_value: false` in `ops` of `GET /settings/status-map/vocabulary`). A choice field takes the `value` of its `values`, or an id of the `options` list its `values_from` names."
                          },
                          "where": {
                            "description": "`lines` only: the checks each such line passes.",
                            "items": {
                              "description": "One check on a line; all of a `lines` condition’s checks hold on the same line.",
                              "properties": {
                                "field": {
                                  "description": "What it reads on the line: a `field` of `condition_fields` with `scope: lines` in `GET /settings/status-map/vocabulary`.",
                                  "enum": [
                                    "title",
                                    "sku",
                                    "vendor_id",
                                    "category_id",
                                    "quantity",
                                    "price",
                                    "review_required",
                                    "delivery_method",
                                    "stock_source",
                                    "stock_arrived",
                                    "po_required",
                                    "on_purchase_order",
                                    "on_open_po",
                                    "po_sent",
                                    "fully_on_sent_pos",
                                    "not_fully_on_pos",
                                    "purchase_order_status",
                                    "fully_received",
                                    "any_part_received",
                                    "received_quantity",
                                    "any_rejected",
                                    "all_received_rejected",
                                    "rejected_quantity",
                                    "rejection_reason",
                                    "shipped_quantity",
                                    "delivered_quantity"
                                  ],
                                  "type": "string"
                                },
                                "id": {
                                  "description": "Unique in the connection.",
                                  "type": "string"
                                },
                                "op": {
                                  "description": "How it compares: an `op` of `ops` in `GET /settings/status-map/vocabulary`, one its field’s `type` lists.",
                                  "enum": [
                                    "is",
                                    "is_not",
                                    "contains",
                                    "not_contains",
                                    "starts_with",
                                    "ends_with",
                                    "is_empty",
                                    "is_not_empty",
                                    "eq",
                                    "neq",
                                    "gt",
                                    "gte",
                                    "lt",
                                    "lte",
                                    "is_set",
                                    "is_not_set",
                                    "is_yes",
                                    "is_no",
                                    "is_one_of",
                                    "is_not_one_of",
                                    "has",
                                    "has_not",
                                    "has_any",
                                    "has_all",
                                    "has_none"
                                  ],
                                  "type": "string"
                                },
                                "value": {
                                  "description": "What it compares with: text, a number, true or false, a list of texts (`is_one_of`, `has_any`, …), or null. Left out when the `op` takes none (`takes_value: false` in `ops` of `GET /settings/status-map/vocabulary`). A choice field takes the `value` of its `values`, or an id of the `options` list its `values_from` names."
                                }
                              },
                              "required": ["id", "field", "op"],
                              "type": "object"
                            },
                            "type": "array"
                          }
                        },
                        "required": ["id", "scope"],
                        "type": "object"
                      },
                      "type": "array"
                    },
                    "event": {
                      "description": "Its When, lowercased: an `event` of `events` in `GET /settings/status-map/vocabulary` (`staff_button`, `created`, …); null for a branch.",
                      "nullable": true,
                      "type": "string"
                    },
                    "event_choices": {
                      "description": "Each a `choice` of the When’s `choices` in `GET /settings/status-map/vocabulary`.",
                      "items": {
                        "type": "string"
                      },
                      "type": "array"
                    },
                    "from": {
                      "description": "The card it leaves (a node `key`).",
                      "type": "string"
                    },
                    "handover_methods": {
                      "description": "“Items are handed over” only: each a `method` of `handover_methods` in `GET /settings/status-map/vocabulary`; none means any way.",
                      "items": {
                        "type": "string"
                      },
                      "type": "array"
                    },
                    "key": {
                      "description": "Stable across versions.",
                      "type": "string"
                    },
                    "kind": {
                      "description": "It moves by itself (`auto`), on a staff `button`, or is a junction’s `branch`.",
                      "enum": ["auto", "button", "branch"],
                      "type": "string"
                    },
                    "label": {
                      "type": "string"
                    },
                    "match": {
                      "description": "All or any of its conditions.",
                      "enum": ["all", "any"],
                      "type": "string"
                    },
                    "position": {
                      "description": "Its place in the priority list of the card it leaves.",
                      "type": "integer"
                    },
                    "role": {
                      "description": "Primary or backup: the app’s; ignored on a save.",
                      "enum": ["primary", "backup"],
                      "type": "string"
                    },
                    "scope": {
                      "description": "A split order: its parts together or each on its own.",
                      "enum": ["whole_order", "each_part"],
                      "type": "string"
                    },
                    "send_status_email": {
                      "description": "Send the target status’s own email on the move.",
                      "type": "boolean"
                    },
                    "system_key": {
                      "description": "Set on the app’s own connections: their When, conditions and target are locked; their actions, email and priority can change.",
                      "nullable": true,
                      "type": "string"
                    },
                    "to": {
                      "description": "The card it leads to.",
                      "type": "string"
                    },
                    "unlock_event": {
                      "description": "A button’s “Unlocked when”: an `event` of `unlock_events` in `GET /settings/status-map/vocabulary`.",
                      "nullable": true,
                      "type": "string"
                    }
                  },
                  "required": [
                    "key",
                    "from",
                    "to",
                    "kind",
                    "event",
                    "label",
                    "match",
                    "conditions",
                    "actions"
                  ],
                  "type": "object"
                },
                "type": "array"
              },
              "nodes": {
                "items": {
                  "properties": {
                    "key": {
                      "description": "Stable across versions: the status id for a status card.",
                      "type": "string"
                    },
                    "kind": {
                      "description": "A status’s card, a junction, or Any status.",
                      "enum": ["status", "junction", "any"],
                      "type": "string"
                    },
                    "name": {
                      "description": "A junction’s label.",
                      "nullable": true,
                      "type": "string"
                    },
                    "status_id": {
                      "nullable": true,
                      "type": "string"
                    },
                    "x": {
                      "type": "number"
                    },
                    "y": {
                      "type": "number"
                    }
                  },
                  "required": ["key", "kind", "status_id", "name", "x", "y"],
                  "type": "object"
                },
                "type": "array"
              }
            },
            "required": ["nodes", "connections"],
            "type": "object"
          },
          "draft_updated_at": {
            "description": "When the draft was last saved: send it as `expected_updated_at` (`version` holds it).",
            "type": "string"
          },
          "dropped_connections": {
            "type": "integer"
          },
          "groups": {
            "items": {
              "properties": {
                "customer_text": {
                  "description": "What the customer reads under the group’s name.",
                  "nullable": true,
                  "type": "string"
                },
                "id": {
                  "type": "string"
                },
                "name": {
                  "type": "string"
                },
                "position": {
                  "type": "integer"
                },
                "system_key": {
                  "description": "A default group’s stable key; null for one you added.",
                  "enum": [
                    "quote",
                    "confirmed",
                    "in_production",
                    "ready",
                    "on_its_way",
                    "complete",
                    "cancelled",
                    null
                  ],
                  "nullable": true,
                  "type": "string"
                }
              },
              "required": [
                "id",
                "name",
                "customer_text",
                "position",
                "system_key"
              ],
              "type": "object"
            },
            "type": "array"
          },
          "has_unpublished_changes": {
            "type": "boolean"
          },
          "open_order_count": {
            "description": "Open orders check-open-orders would check (0 without Change order status).",
            "type": "integer"
          },
          "options": {
            "description": "The choices conditions and actions take (ids and labels).",
            "properties": {
              "categories": {
                "items": {
                  "properties": {
                    "label": {
                      "type": "string"
                    },
                    "value": {
                      "type": "string"
                    }
                  },
                  "required": ["value", "label"],
                  "type": "object"
                },
                "type": "array"
              },
              "email_templates": {
                "items": {
                  "properties": {
                    "label": {
                      "type": "string"
                    },
                    "value": {
                      "type": "string"
                    }
                  },
                  "required": ["value", "label"],
                  "type": "object"
                },
                "type": "array"
              },
              "locations": {
                "items": {
                  "properties": {
                    "label": {
                      "type": "string"
                    },
                    "value": {
                      "type": "string"
                    }
                  },
                  "required": ["value", "label"],
                  "type": "object"
                },
                "type": "array"
              },
              "staff": {
                "items": {
                  "properties": {
                    "label": {
                      "type": "string"
                    },
                    "value": {
                      "type": "string"
                    }
                  },
                  "required": ["value", "label"],
                  "type": "object"
                },
                "type": "array"
              },
              "tags": {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              "vendors": {
                "items": {
                  "properties": {
                    "label": {
                      "type": "string"
                    },
                    "value": {
                      "type": "string"
                    }
                  },
                  "required": ["value", "label"],
                  "type": "object"
                },
                "type": "array"
              }
            },
            "type": "object"
          },
          "order_counts_shown": {
            "description": "False without View quotes and orders: the status counts are 0.",
            "type": "boolean"
          },
          "problems": {
            "items": {
              "properties": {
                "connection_key": {
                  "nullable": true,
                  "type": "string"
                },
                "field": {
                  "description": "Where, by key: `connections[<key>]`, `nodes[<key>]`, or `document` for the whole map.",
                  "type": "string"
                },
                "message": {
                  "type": "string"
                },
                "node_key": {
                  "nullable": true,
                  "type": "string"
                },
                "problem": {
                  "description": "`value`: not something the map takes, as the error envelope says it.",
                  "enum": ["value"],
                  "type": "string"
                }
              },
              "required": [
                "field",
                "problem",
                "connection_key",
                "node_key",
                "message"
              ],
              "type": "object"
            },
            "type": "array"
          },
          "published": {
            "nullable": true,
            "properties": {
              "published_at": {
                "format": "date-time",
                "type": "string"
              },
              "published_by": {
                "nullable": true,
                "type": "string"
              },
              "version_number": {
                "type": "integer"
              }
            },
            "type": "object"
          },
          "statuses": {
            "items": {
              "properties": {
                "color": {
                  "type": "string"
                },
                "group_id": {
                  "nullable": true,
                  "type": "string"
                },
                "id": {
                  "type": "string"
                },
                "is_active": {
                  "type": "boolean"
                },
                "is_system": {
                  "type": "boolean"
                },
                "live_connection_count": {
                  "description": "Connections the published map has into or out of it: while above 0 it can’t be deleted.",
                  "type": "integer"
                },
                "name": {
                  "type": "string"
                },
                "order_count": {
                  "description": "Records in it (0 when `order_counts_shown` is false).",
                  "type": "integer"
                },
                "waits_for_placement": {
                  "type": "boolean"
                }
              },
              "required": [
                "id",
                "name",
                "color",
                "group_id",
                "is_system",
                "is_active",
                "waits_for_placement"
              ],
              "type": "object"
            },
            "type": "array"
          },
          "version": {
            "description": "Send it back as `version` with the next write, exactly as it is: it stands for `draft_updated_at` (saving, publishing, discarding or restoring the draft), and every write answers the new one, so no read is needed between writes.",
            "type": "string"
          },
          "version_number": {
            "type": "integer"
          }
        },
        "required": [
          "draft",
          "draft_updated_at",
          "version",
          "has_unpublished_changes",
          "published",
          "statuses",
          "groups",
          "options",
          "can_edit",
          "order_counts_shown",
          "open_order_count",
          "version_number",
          "dropped_connections",
          "problems"
        ],
        "type": "object"
      },
      "StatusMapStamp": {
        "properties": {
          "expected_updated_at": {
            "description": "The `draft_updated_at` you read, when you don’t send `version`: a draft changed since is `409 STALE_VERSION`.",
            "type": "string"
          },
          "version": {
            "description": "The `version` of the last answer about this record (GET /settings/status-map, or the last change to the map), sent back exactly as it is: no read needed first. A change made since is refused (409) with the current `version` and what `changed`. Send this or `expected_updated_at`.",
            "type": "string"
          }
        },
        "type": "object"
      },
      "StatusMapTest": {
        "properties": {
          "choice": {
            "description": "The When’s choice: a `choice` of its `choices` in `GET /settings/status-map/vocabulary`.",
            "nullable": true,
            "type": "string"
          },
          "event": {
            "description": "A When to play as happening now: an `event` of `events` in `GET /settings/status-map/vocabulary`; null for nothing new.",
            "nullable": true,
            "type": "string"
          },
          "order": {
            "description": "The quote or order: its id or number.",
            "type": "string"
          },
          "use_draft": {
            "description": "True (default): the draft. False: the published map.",
            "type": "boolean"
          }
        },
        "required": ["order"],
        "type": "object"
      },
      "StatusMapTestResult": {
        "properties": {
          "checked": {
            "description": "The connections checked, in priority order, up to the one that moves it: `{ connection_key, label, passed, results, is_system, from_any_status }`.",
            "items": {
              "type": "object"
            },
            "type": "array"
          },
          "choice": {
            "nullable": true,
            "type": "string"
          },
          "connection_key": {
            "nullable": true,
            "type": "string"
          },
          "event": {
            "nullable": true,
            "type": "string"
          },
          "moves_to": {
            "nullable": true,
            "properties": {
              "color": {
                "type": "string"
              },
              "group_id": {
                "nullable": true,
                "type": "string"
              },
              "id": {
                "type": "string"
              },
              "is_active": {
                "type": "boolean"
              },
              "is_system": {
                "type": "boolean"
              },
              "live_connection_count": {
                "description": "Connections the published map has into or out of it: while above 0 it can’t be deleted.",
                "type": "integer"
              },
              "name": {
                "type": "string"
              },
              "order_count": {
                "description": "Records in it (0 when `order_counts_shown` is false).",
                "type": "integer"
              },
              "waits_for_placement": {
                "type": "boolean"
              }
            },
            "required": [
              "id",
              "name",
              "color",
              "group_id",
              "is_system",
              "is_active",
              "waits_for_placement"
            ],
            "type": "object"
          },
          "order": {
            "properties": {
              "id": {
                "type": "string"
              },
              "name": {
                "type": "string"
              },
              "status": {
                "properties": {
                  "color": {
                    "type": "string"
                  },
                  "group_id": {
                    "nullable": true,
                    "type": "string"
                  },
                  "id": {
                    "type": "string"
                  },
                  "is_active": {
                    "type": "boolean"
                  },
                  "is_system": {
                    "type": "boolean"
                  },
                  "live_connection_count": {
                    "description": "Connections the published map has into or out of it: while above 0 it can’t be deleted.",
                    "type": "integer"
                  },
                  "name": {
                    "type": "string"
                  },
                  "order_count": {
                    "description": "Records in it (0 when `order_counts_shown` is false).",
                    "type": "integer"
                  },
                  "waits_for_placement": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "id",
                  "name",
                  "color",
                  "group_id",
                  "is_system",
                  "is_active",
                  "waits_for_placement"
                ],
                "type": "object"
              }
            },
            "type": "object"
          },
          "stays": {
            "description": "The deciding connection keeps it where it is but runs its actions.",
            "type": "boolean"
          }
        },
        "required": [
          "order",
          "event",
          "choice",
          "checked",
          "moves_to",
          "connection_key",
          "stays"
        ],
        "type": "object"
      },
      "StatusMapVersionPreview": {
        "properties": {
          "document": {
            "description": "The status map’s cards (`nodes`) and connections. Send it back whole: a card or connection left out is removed (a status’s card comes back while the status exists; the app’s own connections are redrawn). Up to 256 KB through the API.",
            "properties": {
              "connections": {
                "items": {
                  "properties": {
                    "actions": {
                      "items": {
                        "description": "What the connection does as well as the move. `add_tag` and `remove_tag` carry `tag`; `activity_note` carries `text`; `email_customer` carries `template_key`; `notify_staff` carries `text` and, when it also emails, `emails`; the others carry nothing more. The app’s own (`system` in the vocabulary) sit only on its own connections, locked.",
                        "properties": {
                          "emails": {
                            "description": "`notify_staff`: addresses emailed besides the order’s salespeople. Left out when there are none.",
                            "items": {
                              "type": "string"
                            },
                            "type": "array"
                          },
                          "id": {
                            "description": "Unique in the connection.",
                            "type": "string"
                          },
                          "tag": {
                            "description": "`add_tag`, `remove_tag`: the order tag.",
                            "type": "string"
                          },
                          "template_key": {
                            "description": "`email_customer`: the email to send, a `value` of `options.email_templates` in `GET /settings/status-map`.",
                            "type": "string"
                          },
                          "text": {
                            "description": "`activity_note`: the note. `notify_staff`: the message to staff.",
                            "type": "string"
                          },
                          "type": {
                            "description": "A `type` of `actions` in `GET /settings/status-map/vocabulary`.",
                            "enum": [
                              "add_tag",
                              "remove_tag",
                              "activity_note",
                              "email_customer",
                              "draft_replacement_po",
                              "turn_customer_payment_on",
                              "notify_staff",
                              "waive_signature",
                              "place_order",
                              "mark_as_order",
                              "convert_draft_pay_later",
                              "refresh_invoice",
                              "clear_review_flag",
                              "mark_as_quote",
                              "note_changes_requested"
                            ],
                            "type": "string"
                          }
                        },
                        "required": ["id", "type"],
                        "type": "object"
                      },
                      "type": "array"
                    },
                    "conditions": {
                      "items": {
                        "description": "A check the order must pass. `scope: order` reads the order or quote: `field`, `op` and `value`. `scope: lines` reads its lines: `quant` (how many lines) and `where` (what each such line is).",
                        "properties": {
                          "field": {
                            "description": "`order` only: what it reads, a `field` of `condition_fields` with `scope: order` in `GET /settings/status-map/vocabulary`.",
                            "enum": [
                              "is_quote",
                              "placed_in_shopify",
                              "status_waits_for_placement",
                              "unconfirmed_quote",
                              "saved_in_shopify",
                              "origin",
                              "location_id",
                              "tags",
                              "note",
                              "assigned_to_staff_id",
                              "in_store_sale",
                              "is_split_part",
                              "split_part",
                              "cancelled",
                              "cancellation_reason",
                              "change_source",
                              "review_required",
                              "review_required_for_all_orders",
                              "signed",
                              "signature_status",
                              "signature_required",
                              "signature_waived",
                              "financial_status",
                              "fully_paid",
                              "total_price",
                              "total_paid",
                              "remaining_balance",
                              "deposit_percentage",
                              "deposit_required_percent",
                              "payment_due_later",
                              "customer_payment_on",
                              "latest_refund_amount",
                              "total_refunded",
                              "refund_owed",
                              "refund_source",
                              "purchasing_progress",
                              "not_fully_on_pos",
                              "missing_vendor",
                              "fulfillment_status",
                              "delivery_progress",
                              "ever_delivered",
                              "follow_ups_sent"
                            ],
                            "type": "string"
                          },
                          "id": {
                            "description": "Unique in the connection.",
                            "type": "string"
                          },
                          "op": {
                            "description": "`order` only. How it compares: an `op` of `ops` in `GET /settings/status-map/vocabulary`, one its field’s `type` lists.",
                            "enum": [
                              "is",
                              "is_not",
                              "contains",
                              "not_contains",
                              "starts_with",
                              "ends_with",
                              "is_empty",
                              "is_not_empty",
                              "eq",
                              "neq",
                              "gt",
                              "gte",
                              "lt",
                              "lte",
                              "is_set",
                              "is_not_set",
                              "is_yes",
                              "is_no",
                              "is_one_of",
                              "is_not_one_of",
                              "has",
                              "has_not",
                              "has_any",
                              "has_all",
                              "has_none"
                            ],
                            "type": "string"
                          },
                          "quant": {
                            "description": "`lines` only: at least one line, every line or no line (`line_quants` in `GET /settings/status-map/vocabulary`).",
                            "enum": ["any", "all", "none"],
                            "type": "string"
                          },
                          "scope": {
                            "description": "The order or quote, or its lines.",
                            "enum": ["order", "lines"],
                            "type": "string"
                          },
                          "value": {
                            "description": "`order` only. What it compares with: text, a number, true or false, a list of texts (`is_one_of`, `has_any`, …), or null. Left out when the `op` takes none (`takes_value: false` in `ops` of `GET /settings/status-map/vocabulary`). A choice field takes the `value` of its `values`, or an id of the `options` list its `values_from` names."
                          },
                          "where": {
                            "description": "`lines` only: the checks each such line passes.",
                            "items": {
                              "description": "One check on a line; all of a `lines` condition’s checks hold on the same line.",
                              "properties": {
                                "field": {
                                  "description": "What it reads on the line: a `field` of `condition_fields` with `scope: lines` in `GET /settings/status-map/vocabulary`.",
                                  "enum": [
                                    "title",
                                    "sku",
                                    "vendor_id",
                                    "category_id",
                                    "quantity",
                                    "price",
                                    "review_required",
                                    "delivery_method",
                                    "stock_source",
                                    "stock_arrived",
                                    "po_required",
                                    "on_purchase_order",
                                    "on_open_po",
                                    "po_sent",
                                    "fully_on_sent_pos",
                                    "not_fully_on_pos",
                                    "purchase_order_status",
                                    "fully_received",
                                    "any_part_received",
                                    "received_quantity",
                                    "any_rejected",
                                    "all_received_rejected",
                                    "rejected_quantity",
                                    "rejection_reason",
                                    "shipped_quantity",
                                    "delivered_quantity"
                                  ],
                                  "type": "string"
                                },
                                "id": {
                                  "description": "Unique in the connection.",
                                  "type": "string"
                                },
                                "op": {
                                  "description": "How it compares: an `op` of `ops` in `GET /settings/status-map/vocabulary`, one its field’s `type` lists.",
                                  "enum": [
                                    "is",
                                    "is_not",
                                    "contains",
                                    "not_contains",
                                    "starts_with",
                                    "ends_with",
                                    "is_empty",
                                    "is_not_empty",
                                    "eq",
                                    "neq",
                                    "gt",
                                    "gte",
                                    "lt",
                                    "lte",
                                    "is_set",
                                    "is_not_set",
                                    "is_yes",
                                    "is_no",
                                    "is_one_of",
                                    "is_not_one_of",
                                    "has",
                                    "has_not",
                                    "has_any",
                                    "has_all",
                                    "has_none"
                                  ],
                                  "type": "string"
                                },
                                "value": {
                                  "description": "What it compares with: text, a number, true or false, a list of texts (`is_one_of`, `has_any`, …), or null. Left out when the `op` takes none (`takes_value: false` in `ops` of `GET /settings/status-map/vocabulary`). A choice field takes the `value` of its `values`, or an id of the `options` list its `values_from` names."
                                }
                              },
                              "required": ["id", "field", "op"],
                              "type": "object"
                            },
                            "type": "array"
                          }
                        },
                        "required": ["id", "scope"],
                        "type": "object"
                      },
                      "type": "array"
                    },
                    "event": {
                      "description": "Its When, lowercased: an `event` of `events` in `GET /settings/status-map/vocabulary` (`staff_button`, `created`, …); null for a branch.",
                      "nullable": true,
                      "type": "string"
                    },
                    "event_choices": {
                      "description": "Each a `choice` of the When’s `choices` in `GET /settings/status-map/vocabulary`.",
                      "items": {
                        "type": "string"
                      },
                      "type": "array"
                    },
                    "from": {
                      "description": "The card it leaves (a node `key`).",
                      "type": "string"
                    },
                    "handover_methods": {
                      "description": "“Items are handed over” only: each a `method` of `handover_methods` in `GET /settings/status-map/vocabulary`; none means any way.",
                      "items": {
                        "type": "string"
                      },
                      "type": "array"
                    },
                    "key": {
                      "description": "Stable across versions.",
                      "type": "string"
                    },
                    "kind": {
                      "description": "It moves by itself (`auto`), on a staff `button`, or is a junction’s `branch`.",
                      "enum": ["auto", "button", "branch"],
                      "type": "string"
                    },
                    "label": {
                      "type": "string"
                    },
                    "match": {
                      "description": "All or any of its conditions.",
                      "enum": ["all", "any"],
                      "type": "string"
                    },
                    "position": {
                      "description": "Its place in the priority list of the card it leaves.",
                      "type": "integer"
                    },
                    "role": {
                      "description": "Primary or backup: the app’s; ignored on a save.",
                      "enum": ["primary", "backup"],
                      "type": "string"
                    },
                    "scope": {
                      "description": "A split order: its parts together or each on its own.",
                      "enum": ["whole_order", "each_part"],
                      "type": "string"
                    },
                    "send_status_email": {
                      "description": "Send the target status’s own email on the move.",
                      "type": "boolean"
                    },
                    "system_key": {
                      "description": "Set on the app’s own connections: their When, conditions and target are locked; their actions, email and priority can change.",
                      "nullable": true,
                      "type": "string"
                    },
                    "to": {
                      "description": "The card it leads to.",
                      "type": "string"
                    },
                    "unlock_event": {
                      "description": "A button’s “Unlocked when”: an `event` of `unlock_events` in `GET /settings/status-map/vocabulary`.",
                      "nullable": true,
                      "type": "string"
                    }
                  },
                  "required": [
                    "key",
                    "from",
                    "to",
                    "kind",
                    "event",
                    "label",
                    "match",
                    "conditions",
                    "actions"
                  ],
                  "type": "object"
                },
                "type": "array"
              },
              "nodes": {
                "items": {
                  "properties": {
                    "key": {
                      "description": "Stable across versions: the status id for a status card.",
                      "type": "string"
                    },
                    "kind": {
                      "description": "A status’s card, a junction, or Any status.",
                      "enum": ["status", "junction", "any"],
                      "type": "string"
                    },
                    "name": {
                      "description": "A junction’s label.",
                      "nullable": true,
                      "type": "string"
                    },
                    "status_id": {
                      "nullable": true,
                      "type": "string"
                    },
                    "x": {
                      "type": "number"
                    },
                    "y": {
                      "type": "number"
                    }
                  },
                  "required": ["key", "kind", "status_id", "name", "x", "y"],
                  "type": "object"
                },
                "type": "array"
              }
            },
            "required": ["nodes", "connections"],
            "type": "object"
          },
          "version": {
            "properties": {
              "connection_count": {
                "description": "The store’s own connections.",
                "type": "integer"
              },
              "id": {
                "type": "string"
              },
              "live": {
                "description": "The version that runs now.",
                "type": "boolean"
              },
              "published_at": {
                "format": "date-time",
                "type": "string"
              },
              "published_by": {
                "nullable": true,
                "type": "string"
              },
              "version_number": {
                "type": "integer"
              }
            },
            "required": [
              "id",
              "version_number",
              "published_at",
              "published_by",
              "connection_count",
              "live"
            ],
            "type": "object"
          }
        },
        "required": ["version", "document"],
        "type": "object"
      },
      "StatusMapVersions": {
        "properties": {
          "items": {
            "items": {
              "properties": {
                "connection_count": {
                  "description": "The store’s own connections.",
                  "type": "integer"
                },
                "id": {
                  "type": "string"
                },
                "live": {
                  "description": "The version that runs now.",
                  "type": "boolean"
                },
                "published_at": {
                  "format": "date-time",
                  "type": "string"
                },
                "published_by": {
                  "nullable": true,
                  "type": "string"
                },
                "version_number": {
                  "type": "integer"
                }
              },
              "required": [
                "id",
                "version_number",
                "published_at",
                "published_by",
                "connection_count",
                "live"
              ],
              "type": "object"
            },
            "type": "array"
          },
          "more": {
            "type": "boolean"
          }
        },
        "required": ["items", "more"],
        "type": "object"
      },
      "StatusMapVocabulary": {
        "properties": {
          "actions": {
            "description": "What an action’s `type` takes (`add_tag` / `remove_tag` with `tag`, `activity_note` with `text`, `email_customer` with `template_key`, `notify_staff` with `text` and `emails`). A `system` one is the app’s own: locked, never added.",
            "items": {
              "properties": {
                "hint": {
                  "nullable": true,
                  "type": "string"
                },
                "label": {
                  "type": "string"
                },
                "system": {
                  "type": "boolean"
                },
                "type": {
                  "enum": [
                    "add_tag",
                    "remove_tag",
                    "activity_note",
                    "email_customer",
                    "draft_replacement_po",
                    "turn_customer_payment_on",
                    "notify_staff",
                    "waive_signature",
                    "place_order",
                    "mark_as_order",
                    "convert_draft_pay_later",
                    "refresh_invoice",
                    "clear_review_flag",
                    "mark_as_quote",
                    "note_changes_requested"
                  ],
                  "type": "string"
                }
              },
              "required": ["type", "label", "hint", "system"],
              "type": "object"
            },
            "type": "array"
          },
          "condition_fields": {
            "description": "The fields a condition checks: `{ scope: order, field, op, value }` or, for `lines`, inside `where`.",
            "items": {
              "properties": {
                "field": {
                  "description": "What a condition’s `field` takes (an order’s, or a line’s by `scope`).",
                  "enum": [
                    "is_quote",
                    "placed_in_shopify",
                    "status_waits_for_placement",
                    "unconfirmed_quote",
                    "saved_in_shopify",
                    "origin",
                    "location_id",
                    "tags",
                    "note",
                    "assigned_to_staff_id",
                    "in_store_sale",
                    "is_split_part",
                    "split_part",
                    "cancelled",
                    "cancellation_reason",
                    "change_source",
                    "review_required",
                    "review_required_for_all_orders",
                    "signed",
                    "signature_status",
                    "signature_required",
                    "signature_waived",
                    "financial_status",
                    "fully_paid",
                    "total_price",
                    "total_paid",
                    "remaining_balance",
                    "deposit_percentage",
                    "deposit_required_percent",
                    "payment_due_later",
                    "customer_payment_on",
                    "latest_refund_amount",
                    "total_refunded",
                    "refund_owed",
                    "refund_source",
                    "purchasing_progress",
                    "not_fully_on_pos",
                    "missing_vendor",
                    "fulfillment_status",
                    "delivery_progress",
                    "ever_delivered",
                    "follow_ups_sent",
                    "title",
                    "sku",
                    "vendor_id",
                    "category_id",
                    "quantity",
                    "price",
                    "delivery_method",
                    "stock_source",
                    "stock_arrived",
                    "po_required",
                    "on_purchase_order",
                    "on_open_po",
                    "po_sent",
                    "fully_on_sent_pos",
                    "purchase_order_status",
                    "fully_received",
                    "any_part_received",
                    "received_quantity",
                    "any_rejected",
                    "all_received_rejected",
                    "rejected_quantity",
                    "rejection_reason",
                    "shipped_quantity",
                    "delivered_quantity"
                  ],
                  "type": "string"
                },
                "group": {
                  "type": "string"
                },
                "hint": {
                  "nullable": true,
                  "type": "string"
                },
                "label": {
                  "type": "string"
                },
                "scope": {
                  "enum": ["order", "lines"],
                  "type": "string"
                },
                "type": {
                  "description": "Its comparisons are the `ops` of this type.",
                  "enum": [
                    "text",
                    "number",
                    "money",
                    "percent",
                    "yesno",
                    "choice",
                    "list"
                  ],
                  "type": "string"
                },
                "values": {
                  "description": "A choice field’s fixed values (`value` is what a condition’s `value` takes).",
                  "items": {
                    "properties": {
                      "label": {
                        "type": "string"
                      },
                      "value": {
                        "type": "string"
                      }
                    },
                    "required": ["value", "label"],
                    "type": "object"
                  },
                  "nullable": true,
                  "type": "array"
                },
                "values_from": {
                  "description": "A choice field whose values are one of the `options` lists of `GET /settings/status-map`; null otherwise.",
                  "enum": [
                    "locations",
                    "vendors",
                    "categories",
                    "staff",
                    "tags",
                    null
                  ],
                  "nullable": true,
                  "type": "string"
                }
              },
              "required": [
                "scope",
                "field",
                "label",
                "hint",
                "type",
                "group",
                "values",
                "values_from"
              ],
              "type": "object"
            },
            "type": "array"
          },
          "events": {
            "description": "Every When, in the picker’s order. `legacy` ones still run but are no longer offered.",
            "items": {
              "properties": {
                "choices": {
                  "description": "What `event_choices` takes on a connection with this When (and the map test’s `choice`).",
                  "items": {
                    "properties": {
                      "choice": {
                        "type": "string"
                      },
                      "label": {
                        "type": "string"
                      }
                    },
                    "required": ["choice", "label"],
                    "type": "object"
                  },
                  "type": "array"
                },
                "custom": {
                  "description": "A custom connection may start on it (false: only the app’s own).",
                  "type": "boolean"
                },
                "event": {
                  "description": "What a connection’s `event` takes.",
                  "type": "string"
                },
                "group": {
                  "description": "The picker’s group heading.",
                  "type": "string"
                },
                "hint": {
                  "nullable": true,
                  "type": "string"
                },
                "kind": {
                  "description": "`happens` (counts only while the order is in the starting status), `while_true` (checked whenever the order changes) or `button` (staff press it).",
                  "enum": ["happens", "while_true", "button"],
                  "type": "string"
                },
                "label": {
                  "type": "string"
                },
                "legacy": {
                  "type": "boolean"
                }
              },
              "required": [
                "event",
                "label",
                "hint",
                "group",
                "kind",
                "custom",
                "legacy",
                "choices"
              ],
              "type": "object"
            },
            "type": "array"
          },
          "handover_methods": {
            "description": "What `handover_methods` takes on “Items are handed over”; none means any way.",
            "items": {
              "properties": {
                "label": {
                  "type": "string"
                },
                "method": {
                  "type": "string"
                }
              },
              "required": ["method", "label"],
              "type": "object"
            },
            "type": "array"
          },
          "line_quants": {
            "description": "What a `lines` condition’s `quant` takes.",
            "items": {
              "properties": {
                "label": {
                  "type": "string"
                },
                "quant": {
                  "enum": ["any", "all", "none"],
                  "type": "string"
                }
              },
              "required": ["quant", "label"],
              "type": "object"
            },
            "type": "array"
          },
          "ops": {
            "items": {
              "properties": {
                "ops": {
                  "items": {
                    "properties": {
                      "label": {
                        "type": "string"
                      },
                      "op": {
                        "description": "What a condition’s `op` takes.",
                        "type": "string"
                      },
                      "takes_value": {
                        "description": "False: the condition has no `value`.",
                        "type": "boolean"
                      }
                    },
                    "required": ["op", "label", "takes_value"],
                    "type": "object"
                  },
                  "type": "array"
                },
                "type": {
                  "enum": [
                    "text",
                    "number",
                    "money",
                    "percent",
                    "yesno",
                    "choice",
                    "list"
                  ],
                  "type": "string"
                }
              },
              "required": ["type", "ops"],
              "type": "object"
            },
            "type": "array"
          },
          "unlock_events": {
            "description": "What a button’s `unlock_event` takes, as “Unlocked when” lists them.",
            "items": {
              "properties": {
                "event": {
                  "type": "string"
                },
                "hint": {
                  "nullable": true,
                  "type": "string"
                },
                "label": {
                  "type": "string"
                },
                "refusal": {
                  "description": "Why it can’t unlock a button, or null when it can.",
                  "nullable": true,
                  "type": "string"
                }
              },
              "required": ["event", "label", "hint", "refusal"],
              "type": "object"
            },
            "type": "array"
          }
        },
        "required": [
          "events",
          "unlock_events",
          "handover_methods",
          "condition_fields",
          "ops",
          "line_quants",
          "actions"
        ],
        "type": "object"
      },
      "StoreCredit": {
        "properties": {
          "available": {
            "description": "The customer’s Shopify store credit in `currency`; 0 when they have none, or the record has no customer.",
            "type": "number"
          },
          "balance_due": {
            "description": "What is still to pay on the record.",
            "type": "number"
          },
          "blocked_reason": {
            "description": "Why store credit can’t pay this record now (no customer, nothing due, no credit, a split order, still syncing, not saved yet, less credit than a placed order’s whole balance without Plus); null when it can.",
            "nullable": true,
            "type": "string"
          },
          "currency": {
            "type": "string"
          },
          "placed": {
            "description": "Placed in Shopify: the credit pays the order now. Before placing it pays a deposit (without Shopify Plus) or places the order (on Plus).",
            "type": "boolean"
          },
          "shopify_plus": {
            "description": "The store is on Shopify Plus; null when Shopify didn’t say just now.",
            "nullable": true,
            "type": "boolean"
          },
          "suggested_amount": {
            "description": "What the dialog offers: the whole balance on a placed order without Plus, otherwise as much of the balance as the credit covers (before placing, a cent less than the balance).",
            "type": "number"
          }
        },
        "type": "object"
      },
      "StoreCreditPaid": {
        "properties": {
          "amount": {
            "description": "What the store credit paid.",
            "type": "number"
          },
          "balance_due": {
            "description": "What is still due on the record now.",
            "type": "number"
          },
          "currency": {
            "type": "string"
          },
          "payment_request_id": {
            "description": "That deposit’s payment request; null otherwise.",
            "nullable": true,
            "type": "string"
          },
          "placed": {
            "description": "The order is placed in Shopify, and the credit is paid on it.",
            "type": "boolean"
          },
          "queued": {
            "description": "Without Shopify Plus before placing: a deposit paid from the credit is being made on the queue; its row is in the record’s payment requests, and the credit is taken when it runs.",
            "type": "boolean"
          },
          "shopify_order_number": {
            "description": "On Shopify Plus before placing: the Shopify order the payment placed.",
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "StoreCreditPay": {
        "properties": {
          "amount": {
            "description": "Above 0, at most 2 decimals, no more than `available` or the balance due: without Shopify Plus a placed order takes exactly the balance, and before placing it stays below the balance.",
            "type": "number"
          },
          "override_requirements": {
            "description": "On Shopify Plus before placing: place the order with the credit paid even though it usually needs a signature or a larger deposit first (`409 REQUIREMENTS_NOT_MET` names them). It needs Prices and exceptions.",
            "type": "boolean"
          }
        },
        "required": ["amount"],
        "type": "object"
      },
      "SyncRetry": {
        "properties": {
          "id": {
            "type": "string"
          },
          "mode": {
            "description": "`create`: its Shopify draft is made again. `update`: the draft is updated.",
            "enum": ["create", "update"],
            "type": "string"
          },
          "sync_status": {
            "description": "Read the record again until it is `synced` (or `failed` once more).",
            "enum": ["pending"],
            "type": "string"
          }
        },
        "type": "object"
      },
      "TagList": {
        "properties": {
          "items": {
            "items": {
              "properties": {
                "name": {
                  "description": "What `tags` takes.",
                  "type": "string"
                }
              },
              "type": "object"
            },
            "type": "array"
          }
        },
        "type": "object"
      },
      "Template": {
        "properties": {
          "base_price": {
            "description": "In `currency`, two decimals.",
            "nullable": true,
            "type": "number"
          },
          "categories": {
            "description": "OrderPilot categories it is in (up to 20, A–Z), as a Shopify product’s type.",
            "items": {
              "properties": {
                "id": {
                  "type": "string"
                },
                "name": {
                  "type": "string"
                }
              },
              "type": "object"
            },
            "type": "array"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "description": {
            "nullable": true,
            "type": "string"
          },
          "finished_units": {
            "description": "How many finished units (made-up versions kept in stock) it has in Shopify. Where each is: `GET /product-templates/{id}/availability`.",
            "type": "integer"
          },
          "handle": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "image_url": {
            "nullable": true,
            "type": "string"
          },
          "kind": {
            "description": "Always `product_template`: one of OrderPilot’s own product templates. A Shopify product says `shopify_product`.",
            "enum": ["product_template"],
            "type": "string"
          },
          "offers_all_vendors": {
            "description": "true: it is offered with every active vendor, not a list of its own.",
            "type": "boolean"
          },
          "options": {
            "description": "On one template only: its options. A line takes values for these as `options` [{ field_id, value }]; every type is settable: a size as text such as `96 × 38 × 30` (its `parts`), a text-and-image option as its text in `value` with its picture in `image_url`.",
            "items": {
              "properties": {
                "field_id": {
                  "type": "string"
                },
                "label": {
                  "nullable": true,
                  "type": "string"
                },
                "parts": {
                  "description": "A size’s boxes, in order, with each one’s bounds (null for other types): a `dimensions` value is their numbers joined by ` × `.",
                  "items": {
                    "properties": {
                      "key": {
                        "type": "string"
                      },
                      "label": {
                        "type": "string"
                      },
                      "max": {
                        "nullable": true,
                        "type": "number"
                      },
                      "min": {
                        "nullable": true,
                        "type": "number"
                      },
                      "step": {
                        "nullable": true,
                        "type": "number"
                      }
                    },
                    "type": "object"
                  },
                  "nullable": true,
                  "type": "array"
                },
                "required": {
                  "type": "boolean"
                },
                "settable": {
                  "type": "boolean"
                },
                "type": {
                  "enum": [
                    "text",
                    "number",
                    "dropdown",
                    "textarea",
                    "text_image",
                    "dimensions"
                  ],
                  "type": "string"
                },
                "unit": {
                  "nullable": true,
                  "type": "string"
                },
                "values": {
                  "items": {
                    "properties": {
                      "is_default": {
                        "type": "boolean"
                      },
                      "label": {
                        "type": "string"
                      },
                      "option_id": {
                        "type": "string"
                      },
                      "price": {
                        "nullable": true,
                        "type": "number"
                      },
                      "value": {
                        "type": "string"
                      }
                    },
                    "type": "object"
                  },
                  "type": "array"
                }
              },
              "type": "object"
            },
            "type": "array"
          },
          "pinned_at": {
            "description": "When it was pinned to the top of the pickers; null when not pinned.",
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "shopify_product_id": {
            "nullable": true,
            "type": "string"
          },
          "sku_prefix": {
            "type": "string"
          },
          "status": {
            "description": "`active`: it can be sold and is on Shopify. `draft`: not sold, not sent to Shopify.",
            "enum": ["active", "draft"],
            "type": "string"
          },
          "sync_error": {
            "description": "The last failed sync’s message (beside `live` it is a note).",
            "nullable": true,
            "type": "string"
          },
          "sync_status": {
            "description": "Its Shopify product, as the Products list’s badge says: `draft` (not sent), `syncing`, `live`, `failed` (`sync_error` says why; `POST /product-templates/{id}/sync-retry`) or `not_synced` (active, never sent).",
            "enum": ["draft", "syncing", "live", "failed", "not_synced"],
            "type": "string"
          },
          "synced_at": {
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "total_inventory": {
            "description": "Units in stock across its finished units, as Shopify counts them (tracked units only), as a Shopify product’s `total_inventory`. 0 with no finished unit. Null when Shopify couldn’t be read just now, or a page held more units than one read counts.",
            "nullable": true,
            "type": "integer"
          },
          "updated_at": {
            "format": "date-time",
            "type": "string"
          },
          "vendors": {
            "description": "The vendors it is from (up to 20, A–Z), as a Shopify product’s `vendor`. Empty with `offers_all_vendors`.",
            "items": {
              "properties": {
                "id": {
                  "type": "string"
                },
                "name": {
                  "type": "string"
                }
              },
              "type": "object"
            },
            "type": "array"
          }
        },
        "type": "object"
      },
      "TemplateActive": {
        "properties": {
          "active": {
            "description": "true: activate. false: set to draft.",
            "type": "boolean"
          }
        },
        "required": ["active"],
        "type": "object"
      },
      "TemplateAvailability": {
        "properties": {
          "availability": {
            "properties": {
              "count": {
                "description": "Units at that location (every location’s when `location` is null).",
                "type": "integer"
              },
              "currency": {
                "type": "string"
              },
              "location": {
                "description": "The location read at; null for every location.",
                "nullable": true,
                "properties": {
                  "id": {
                    "type": "string"
                  },
                  "name": {
                    "type": "string"
                  }
                },
                "type": "object"
              },
              "on_the_way": {
                "description": "Units on open purchase orders not received yet; null when the role sees no purchase orders.",
                "nullable": true,
                "type": "integer"
              },
              "others": {
                "description": "Units at every other location; null when reading every location.",
                "nullable": true,
                "type": "integer"
              },
              "partial": {
                "description": "True when there are more configurations than are counted (200).",
                "type": "boolean"
              },
              "units": {
                "description": "The configurations stocked there, most units first.",
                "items": {
                  "properties": {
                    "count": {
                      "type": "integer"
                    },
                    "label": {
                      "description": "Its option values, “8 ft · Antique Black”.",
                      "type": "string"
                    },
                    "price": {
                      "description": "Its own price there; null: the template’s.",
                      "nullable": true,
                      "type": "number"
                    },
                    "template_price": {
                      "nullable": true,
                      "type": "number"
                    },
                    "unit_id": {
                      "type": "string"
                    }
                  },
                  "type": "object"
                },
                "type": "array"
              }
            },
            "type": "object"
          }
        },
        "type": "object"
      },
      "TemplateAvailabilityLocations": {
        "properties": {
          "locations": {
            "items": {
              "properties": {
                "count": {
                  "type": "integer"
                },
                "id": {
                  "type": "string"
                },
                "name": {
                  "type": "string"
                }
              },
              "type": "object"
            },
            "type": "array"
          },
          "matches": {
            "description": "How many locations match (all with no `q`).",
            "type": "integer"
          }
        },
        "type": "object"
      },
      "TemplateBundleDetached": {
        "properties": {
          "options": {
            "$ref": "#/components/schemas/TemplateOptions"
          },
          "removed": {
            "properties": {
              "deleted": {
                "description": "Options taken off the template.",
                "type": "integer"
              },
              "reassigned": {
                "description": "Options kept, now another bundle’s.",
                "type": "integer"
              },
              "severed": {
                "description": "Options kept as the template’s own.",
                "type": "integer"
              }
            },
            "type": "object"
          }
        },
        "type": "object"
      },
      "TemplateCosts": {
        "properties": {
          "current": {
            "properties": {
              "cost_status": {
                "enum": ["planned", "estimated", "final", "missing"],
                "type": "string"
              },
              "effective_unit_cost": {
                "description": "What the next unit out costs under the method.",
                "nullable": true,
                "type": "number"
              },
              "method": {
                "description": "The store’s costing method.",
                "enum": ["fifo", "lifo", "moving_weighted_average"],
                "type": "string"
              },
              "on_hand": {
                "description": "Units costed and not yet sold.",
                "type": "integer"
              },
              "on_hand_value": {
                "nullable": true,
                "type": "number"
              },
              "range": {
                "nullable": true,
                "properties": {
                  "high": {
                    "type": "number"
                  },
                  "low": {
                    "type": "number"
                  }
                },
                "type": "object"
              },
              "weighted_average": {
                "nullable": true,
                "type": "number"
              }
            },
            "type": "object"
          },
          "history": {
            "description": "The last 25 deliveries received for it, newest first.",
            "items": {
              "properties": {
                "adjusted": {
                  "description": "Its cost was corrected after receipt.",
                  "type": "boolean"
                },
                "allocated_charges": {
                  "description": "Its share of shipping, duty, …",
                  "type": "number"
                },
                "bought_for_order": {
                  "description": "Bought for an order: its cost went to that order’s line.",
                  "type": "boolean"
                },
                "configuration": {
                  "description": "The options received (“Sage · Oak”).",
                  "type": "string"
                },
                "landed_unit_cost": {
                  "nullable": true,
                  "type": "number"
                },
                "purchase_order_id": {
                  "nullable": true,
                  "type": "string"
                },
                "purchase_order_number": {
                  "nullable": true,
                  "type": "string"
                },
                "quantity": {
                  "type": "integer"
                },
                "receipt_line_id": {
                  "type": "string"
                },
                "received_at": {
                  "format": "date-time",
                  "type": "string"
                },
                "vendor_unit_cost": {
                  "nullable": true,
                  "type": "number"
                }
              },
              "type": "object"
            },
            "type": "array"
          },
          "shopify_published": {
            "description": "The cost per item Shopify was last given, one per variant.",
            "items": {
              "properties": {
                "configuration": {
                  "description": "Empty for the template’s own.",
                  "type": "string"
                },
                "unit_cost": {
                  "type": "number"
                }
              },
              "type": "object"
            },
            "type": "array"
          },
          "supplier_cost": {
            "description": "The template’s cost estimate, not a received cost.",
            "nullable": true,
            "type": "number"
          },
          "template_id": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "TemplateDeleted": {
        "properties": {
          "deleted": {
            "type": "boolean"
          },
          "id": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "TemplateExport": {
        "properties": {
          "bytes": {
            "nullable": true,
            "type": "integer"
          },
          "completed_at": {
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "download_url": {
            "description": "When `completed`: the CSV, for 15 minutes, no sign-in needed. Read the export again for a fresh one.",
            "nullable": true,
            "type": "string"
          },
          "failure_message": {
            "nullable": true,
            "type": "string"
          },
          "file_name": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "import_notice": {
            "description": "Set when the file is past the import’s limits: it won’t re-import as one file.",
            "nullable": true,
            "type": "string"
          },
          "includes_costs": {
            "type": "boolean"
          },
          "scope": {
            "enum": ["all", "active"],
            "type": "string"
          },
          "status": {
            "enum": ["queued", "running", "completed", "failed", "expired"],
            "type": "string"
          },
          "template_count": {
            "type": "integer"
          }
        },
        "type": "object"
      },
      "TemplateExportInput": {
        "properties": {
          "scope": {
            "description": "Every template (the default) or only active ones.",
            "enum": ["all", "active"],
            "type": "string"
          }
        },
        "type": "object"
      },
      "TemplateImport": {
        "properties": {
          "applied": {
            "description": "What the apply did; null until it ran.",
            "nullable": true,
            "properties": {
              "attachments": {
                "properties": {
                  "create": {
                    "type": "integer"
                  },
                  "skipped": {
                    "type": "integer"
                  },
                  "unchanged": {
                    "type": "integer"
                  },
                  "update": {
                    "type": "integer"
                  }
                },
                "type": "object"
              },
              "options": {
                "properties": {
                  "create": {
                    "type": "integer"
                  },
                  "skipped": {
                    "type": "integer"
                  },
                  "unchanged": {
                    "type": "integer"
                  },
                  "update": {
                    "type": "integer"
                  }
                },
                "type": "object"
              },
              "overrides": {
                "properties": {
                  "create": {
                    "type": "integer"
                  },
                  "skipped": {
                    "type": "integer"
                  },
                  "unchanged": {
                    "type": "integer"
                  },
                  "update": {
                    "type": "integer"
                  }
                },
                "type": "object"
              },
              "templates": {
                "properties": {
                  "create": {
                    "type": "integer"
                  },
                  "skipped": {
                    "type": "integer"
                  },
                  "unchanged": {
                    "type": "integer"
                  },
                  "update": {
                    "type": "integer"
                  }
                },
                "type": "object"
              },
              "values": {
                "properties": {
                  "create": {
                    "type": "integer"
                  },
                  "skipped": {
                    "type": "integer"
                  },
                  "unchanged": {
                    "type": "integer"
                  },
                  "update": {
                    "type": "integer"
                  }
                },
                "type": "object"
              }
            },
            "type": "object"
          },
          "applied_at": {
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "apply": {
            "enum": ["manual", "after_check"],
            "type": "string"
          },
          "completed_at": {
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "error_count": {
            "type": "integer"
          },
          "failed_row_count": {
            "description": "Rows the apply couldn’t save (the first 20 are in `failures`).",
            "type": "integer"
          },
          "failure_message": {
            "description": "Why it `failed`.",
            "nullable": true,
            "type": "string"
          },
          "failures": {
            "description": "The first 20 rows the apply couldn’t save, with why.",
            "items": {
              "properties": {
                "message": {
                  "type": "string"
                },
                "row": {
                  "nullable": true,
                  "type": "integer"
                }
              },
              "type": "object"
            },
            "type": "array"
          },
          "file_name": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "issues": {
            "description": "The check’s errors and warnings, at most 500, errors first, then by row (the counts are complete). Null with `?issues=0`, before the check, or once the report is gone (a day after the import ended).",
            "items": {
              "properties": {
                "code": {
                  "description": "What is wrong, as a short code.",
                  "type": "string"
                },
                "column": {
                  "description": "The column’s header.",
                  "nullable": true,
                  "type": "string"
                },
                "message": {
                  "description": "What to change.",
                  "type": "string"
                },
                "row": {
                  "description": "The sheet row (the header is row 1); null for the whole file.",
                  "nullable": true,
                  "type": "integer"
                },
                "severity": {
                  "enum": ["error", "warning"],
                  "type": "string"
                }
              },
              "type": "object"
            },
            "nullable": true,
            "type": "array"
          },
          "needs": {
            "description": "What applying needs beyond Change the catalog, from the check: `prices` (a selling price changes), `costs` (a vendor cost is set or cleared) and `new_vendors` (it creates vendors: Manage purchase orders). Null until checked.",
            "nullable": true,
            "properties": {
              "costs": {
                "type": "boolean"
              },
              "new_vendors": {
                "type": "boolean"
              },
              "prices": {
                "type": "boolean"
              }
            },
            "type": "object"
          },
          "overwrite": {
            "type": "boolean"
          },
          "planned": {
            "description": "What the check found it would create, update, leave or skip.",
            "nullable": false,
            "properties": {
              "attachments": {
                "properties": {
                  "create": {
                    "type": "integer"
                  },
                  "skipped": {
                    "type": "integer"
                  },
                  "unchanged": {
                    "type": "integer"
                  },
                  "update": {
                    "type": "integer"
                  }
                },
                "type": "object"
              },
              "options": {
                "properties": {
                  "create": {
                    "type": "integer"
                  },
                  "skipped": {
                    "type": "integer"
                  },
                  "unchanged": {
                    "type": "integer"
                  },
                  "update": {
                    "type": "integer"
                  }
                },
                "type": "object"
              },
              "overrides": {
                "properties": {
                  "create": {
                    "type": "integer"
                  },
                  "skipped": {
                    "type": "integer"
                  },
                  "unchanged": {
                    "type": "integer"
                  },
                  "update": {
                    "type": "integer"
                  }
                },
                "type": "object"
              },
              "templates": {
                "properties": {
                  "create": {
                    "type": "integer"
                  },
                  "skipped": {
                    "type": "integer"
                  },
                  "unchanged": {
                    "type": "integer"
                  },
                  "update": {
                    "type": "integer"
                  }
                },
                "type": "object"
              },
              "values": {
                "properties": {
                  "create": {
                    "type": "integer"
                  },
                  "skipped": {
                    "type": "integer"
                  },
                  "unchanged": {
                    "type": "integer"
                  },
                  "update": {
                    "type": "integer"
                  }
                },
                "type": "object"
              }
            },
            "type": "object"
          },
          "progress": {
            "description": "Where the check or the apply stands, in batches of up to 200 templates.",
            "nullable": true,
            "properties": {
              "batches_done": {
                "nullable": true,
                "type": "integer"
              },
              "batches_total": {
                "nullable": true,
                "type": "integer"
              },
              "stage": {
                "enum": ["check", "apply", null],
                "nullable": true,
                "type": "string"
              },
              "templates_done": {
                "type": "integer"
              },
              "templates_total": {
                "type": "integer"
              },
              "updated_at": {
                "format": "date-time",
                "type": "string"
              }
            },
            "type": "object"
          },
          "rows": {
            "description": "The file’s data rows by kind, once checked.",
            "properties": {
              "attachments": {
                "type": "integer"
              },
              "options": {
                "type": "integer"
              },
              "overrides": {
                "type": "integer"
              },
              "templates": {
                "type": "integer"
              },
              "total": {
                "type": "integer"
              },
              "values": {
                "type": "integer"
              }
            },
            "type": "object"
          },
          "started_by_api_key": {
            "description": "The name of the API key that started it; null for one started in OrderPilot.",
            "nullable": true,
            "type": "string"
          },
          "status": {
            "description": "`uploading` (waiting for the file and confirm), `validating` (being checked), `validated` (checked, nothing written yet), `failed_validation` (the file has errors: nothing was written), `applying`, `completed`, `failed` (stopped: what it saved stays, `failure_message` says why) or `expired` (never applied: discarded, replaced, never confirmed within an hour, or checked over a day ago).",
            "enum": [
              "uploading",
              "validating",
              "validated",
              "failed_validation",
              "applying",
              "completed",
              "failed",
              "expired"
            ],
            "type": "string"
          },
          "warning_count": {
            "type": "integer"
          },
          "written_template_count": {
            "description": "How many templates it wrote, all of them (null with `written_template_ids`).",
            "nullable": true,
            "type": "integer"
          },
          "written_template_ids": {
            "description": "Once it ended after applying: the ids of the templates it created or updated, at most 1,000 (`GET /product-templates/{id}`). Null before.",
            "items": {
              "type": "string"
            },
            "nullable": true,
            "type": "array"
          }
        },
        "type": "object"
      },
      "TemplateImportCreate": {
        "properties": {
          "apply": {
            "description": "`manual` (default): it waits, checked, for `POST /product-templates/imports/{id}/apply`. `after_check`: it applies itself once the check finds no errors, as this key; when it can’t start then (another import is applying, or the key lacks a scope the file needs), it stays `validated` for apply.",
            "enum": ["manual", "after_check"],
            "type": "string"
          },
          "bytes": {
            "description": "The file’s exact size in bytes, 1 to 262,144,000 (250 MB). The upload link takes exactly this many.",
            "type": "integer"
          },
          "file_name": {
            "description": "The file’s name, ending in .csv (or .txt holding CSV). Up to 255 characters.",
            "type": "string"
          },
          "overwrite": {
            "description": "Update templates, options and values whose Handle already exists (default false: rows for them are skipped, as Shopify skips a product it has).",
            "type": "boolean"
          }
        },
        "required": ["file_name", "bytes"],
        "type": "object"
      },
      "TemplateImportList": {
        "properties": {
          "items": {
            "description": "Each import as `GET /product-templates/imports/{id}` answers it, `issues` null.",
            "items": {
              "$ref": "#/components/schemas/TemplateImport"
            },
            "type": "array"
          },
          "limit": {
            "type": "integer"
          },
          "next_offset": {
            "nullable": true,
            "type": "integer"
          },
          "offset": {
            "type": "integer"
          }
        },
        "required": ["items", "offset", "limit", "next_offset"],
        "type": "object"
      },
      "TemplateImportStarted": {
        "properties": {
          "import": {
            "$ref": "#/components/schemas/TemplateImport"
          },
          "upload_content_type": {
            "description": "Always `text/csv; charset=utf-8`.",
            "type": "string"
          },
          "upload_expires_at": {
            "description": "The link works until then (30 minutes). Start a new import after it.",
            "format": "date-time",
            "type": "string"
          },
          "upload_url": {
            "description": "Where to PUT the file: exactly `bytes` bytes, with `Content-Type` set to `upload_content_type`. Signed for this import only.",
            "type": "string"
          }
        },
        "type": "object"
      },
      "TemplateList": {
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/Template"
            },
            "type": "array"
          },
          "next_cursor": {
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "TemplateOnlineOptions": {
        "properties": {
          "block_too_large": {
            "description": "The last sync couldn’t publish the block: too large.",
            "type": "boolean"
          },
          "labels": {
            "description": "The buttons’ words (up to 40 characters each); empty: the default.",
            "properties": {
              "request_quote": {
                "description": "Default “Request a quote”.",
                "type": "string"
              },
              "save_design": {
                "description": "Default “Copy design link”.",
                "type": "string"
              }
            },
            "type": "object"
          },
          "links": {
            "description": "Where the template’s Shopify product is (read from Shopify; both null when it can’t be read).",
            "properties": {
              "preview_url": {
                "description": "Shopify’s preview, which opens an unpublished product too.",
                "nullable": true,
                "type": "string"
              },
              "product_page_url": {
                "description": "The live product page; null while it isn’t on the online store.",
                "nullable": true,
                "type": "string"
              }
            },
            "type": "object"
          },
          "offer_quote": {
            "description": "Also offer Request a quote, where the block takes orders.",
            "type": "boolean"
          },
          "options": {
            "description": "In the order the block shows them.",
            "items": {
              "properties": {
                "field_id": {
                  "type": "string"
                },
                "hidden": {
                  "description": "Hide online: left out of the block, filled with its Starts as.",
                  "type": "boolean"
                },
                "label": {
                  "type": "string"
                },
                "look": {
                  "description": "This template’s look; null: the option’s, then the automatic one.",
                  "enum": [
                    "dropdown",
                    "buttons",
                    "segmented",
                    "radio_list",
                    "colour_swatches",
                    "image_swatches",
                    "image_cards",
                    "add_on_checkbox",
                    "number_box",
                    "stepper",
                    "slider",
                    "text_box",
                    "text_area",
                    "info_block",
                    null
                  ],
                  "nullable": true,
                  "type": "string"
                },
                "option_look": {
                  "enum": [
                    "dropdown",
                    "buttons",
                    "segmented",
                    "radio_list",
                    "colour_swatches",
                    "image_swatches",
                    "image_cards",
                    "add_on_checkbox",
                    "number_box",
                    "stepper",
                    "slider",
                    "text_box",
                    "text_area",
                    "info_block",
                    null
                  ],
                  "nullable": true,
                  "type": "string"
                },
                "settings": {
                  "description": "The look’s settings: `columns` (2–6, swatches and image cards), `shape` (`square` or `round`), `show_value_names` (`always` or `selected`), `show_prices` (true by default). Absent: the option’s own.",
                  "properties": {
                    "columns": {
                      "nullable": true,
                      "type": "integer"
                    },
                    "shape": {
                      "enum": ["square", "round", null],
                      "nullable": true,
                      "type": "string"
                    },
                    "show_prices": {
                      "nullable": true,
                      "type": "boolean"
                    },
                    "show_value_names": {
                      "enum": ["always", "selected", null],
                      "nullable": true,
                      "type": "string"
                    }
                  },
                  "type": "object"
                },
                "starts_as": {
                  "nullable": true,
                  "type": "string"
                }
              },
              "type": "object"
            },
            "type": "array"
          },
          "price_line": {
            "enum": ["options_and_total", "total", "hidden"],
            "type": "string"
          },
          "show_lead_time": {
            "type": "boolean"
          },
          "template_id": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "TemplateOnlineOptionsEdit": {
        "properties": {
          "labels": {
            "description": "The buttons’ words (up to 40 characters each); empty: the default.",
            "properties": {
              "request_quote": {
                "description": "Default “Request a quote”.",
                "type": "string"
              },
              "save_design": {
                "description": "Default “Copy design link”.",
                "type": "string"
              }
            },
            "type": "object"
          },
          "offer_quote": {
            "type": "boolean"
          },
          "options": {
            "description": "Options to change, by `field_id`; the others stay.",
            "items": {
              "properties": {
                "field_id": {
                  "description": "An option on the template: an `options[].field_id` of this read.",
                  "type": "string"
                },
                "hidden": {
                  "type": "boolean"
                },
                "look": {
                  "description": "`null`: the option’s own look.",
                  "enum": [
                    "dropdown",
                    "buttons",
                    "segmented",
                    "radio_list",
                    "colour_swatches",
                    "image_swatches",
                    "image_cards",
                    "add_on_checkbox",
                    "number_box",
                    "stepper",
                    "slider",
                    "text_box",
                    "text_area",
                    "info_block",
                    null
                  ],
                  "nullable": true,
                  "type": "string"
                },
                "settings": {
                  "description": "The look’s settings: `columns` (2–6, swatches and image cards), `shape` (`square` or `round`), `show_value_names` (`always` or `selected`), `show_prices` (true by default). Absent: the option’s own.",
                  "properties": {
                    "columns": {
                      "nullable": true,
                      "type": "integer"
                    },
                    "shape": {
                      "enum": ["square", "round", null],
                      "nullable": true,
                      "type": "string"
                    },
                    "show_prices": {
                      "nullable": true,
                      "type": "boolean"
                    },
                    "show_value_names": {
                      "enum": ["always", "selected", null],
                      "nullable": true,
                      "type": "string"
                    }
                  },
                  "type": "object"
                }
              },
              "required": ["field_id"],
              "type": "object"
            },
            "type": "array"
          },
          "order": {
            "description": "The options top to bottom, by `field_id` (the template’s option order, the Options card’s too).",
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "price_line": {
            "enum": ["options_and_total", "total", "hidden"],
            "type": "string"
          },
          "show_lead_time": {
            "type": "boolean"
          }
        },
        "type": "object"
      },
      "TemplateOptionAttach": {
        "description": "One of `field_id` or `bundle_id`.",
        "properties": {
          "bundle_id": {
            "description": "A bundle: an `id` from `GET /bundles`.",
            "type": "string"
          },
          "field_id": {
            "description": "An option of the library: an `id` from `GET /options`.",
            "type": "string"
          }
        },
        "type": "object"
      },
      "TemplateOptionEdit": {
        "properties": {
          "auto_offer_new_values": {
            "type": "boolean"
          },
          "default_value": {
            "description": "Starts as of a typed option on this template: text (a number as text), or `{ text, image_url, image_file_id }` for a text-and-image option (a picture `POST /files` uploaded). `null`: the option’s own.",
            "nullable": true
          },
          "expected_updated_at": {
            "description": "This option’s `updated_at` from `GET /product-templates/{id}/options`, when you don’t send `version`.",
            "type": "string"
          },
          "locked": {
            "description": "Stop following the bundle (`true`: its values, required and rules are frozen as they are) or follow it again.",
            "type": "boolean"
          },
          "offered_option_ids": {
            "description": "Exactly the values this template offers, by `option_id` (up to 500). Values added to the option later are then not offered unless `auto_offer_new_values` is sent `true`.",
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "required": {
            "description": "This template’s own; `null`: the bundle’s or the option’s again.",
            "nullable": true,
            "type": "boolean"
          },
          "shown_when": {
            "description": "Show it only when another dropdown option of this template (`field_id`, a `field_id` from `GET /product-templates/{id}/options`) is set to one of `option_ids` (its values’ `option_id`; null: to anything). `null` clears the template’s own rule (the bundle’s applies again).",
            "nullable": true,
            "properties": {
              "field_id": {
                "type": "string"
              },
              "option_ids": {
                "items": {
                  "type": "string"
                },
                "nullable": true,
                "type": "array"
              }
            },
            "type": "object"
          },
          "values": {
            "description": "Up to 500 values to change.",
            "items": {
              "properties": {
                "cost_override": {
                  "description": "This template’s cost for it; `null`: the option’s own. Needs costs.",
                  "nullable": true,
                  "type": "number"
                },
                "is_default": {
                  "description": "Starts as. `true` makes it the only one.",
                  "type": "boolean"
                },
                "lead_time_override": {
                  "description": "Days it adds here (0 is Same day); `null`: the option’s own.",
                  "nullable": true,
                  "type": "integer"
                },
                "offered": {
                  "type": "boolean"
                },
                "option_id": {
                  "description": "One of this option’s values: a `values[].option_id` of the read.",
                  "type": "string"
                },
                "price_override": {
                  "description": "This template’s price for it, 0 or more (0 is Included); `null`: the option’s own price.",
                  "nullable": true,
                  "type": "number"
                },
                "product_image_url": {
                  "description": "One of this template’s own photos (its `image_url`), which the gallery jumps to when the value is picked; `null`: none. Dropdowns only.",
                  "nullable": true,
                  "type": "string"
                },
                "shown_when": {
                  "description": "Show it only when another dropdown option of this template (`field_id`, a `field_id` from `GET /product-templates/{id}/options`) is set to one of `option_ids` (its values’ `option_id`; null: to anything). `null` clears the template’s own rule (the bundle’s applies again).",
                  "nullable": true,
                  "properties": {
                    "field_id": {
                      "type": "string"
                    },
                    "option_ids": {
                      "items": {
                        "type": "string"
                      },
                      "nullable": true,
                      "type": "array"
                    }
                  },
                  "type": "object"
                }
              },
              "required": ["option_id"],
              "type": "object"
            },
            "type": "array"
          },
          "version": {
            "description": "The `version` this option’s entry of `GET /product-templates/{id}/options` (or the last change) answered, sent back as it is: no read needed first. A change made since is `409 STALE_VERSION` with the current `version` and what `changed`. Send this or `expected_updated_at`.",
            "type": "string"
          }
        },
        "type": "object"
      },
      "TemplateOptionValueAdd": {
        "properties": {
          "cost": {
            "description": "Its cost in the library. Needs costs.",
            "nullable": true,
            "type": "number"
          },
          "image_file_id": {
            "description": "The picture’s `shopify_file_id` from `POST /files`: required with `image_url`.",
            "nullable": true,
            "type": "string"
          },
          "image_url": {
            "description": "Its picture: the `url` `POST /files` answered (a Shopify Files address).",
            "nullable": true,
            "type": "string"
          },
          "label": {
            "description": "What customers see, when it differs.",
            "nullable": true,
            "type": "string"
          },
          "lead_time_days": {
            "description": "Days it adds to the lead time (0 is Same day).",
            "nullable": true,
            "type": "integer"
          },
          "price": {
            "description": "Its price in the library, 0 or more (default 0).",
            "type": "number"
          },
          "swatch_color": {
            "description": "`#rrggbb`, for a swatches option.",
            "nullable": true,
            "type": "string"
          },
          "value": {
            "description": "The value’s name, up to 255 characters.",
            "type": "string"
          }
        },
        "required": ["value"],
        "type": "object"
      },
      "TemplateOptionValueAdded": {
        "properties": {
          "field_id": {
            "type": "string"
          },
          "option_id": {
            "description": "The new value.",
            "type": "string"
          },
          "options": {
            "$ref": "#/components/schemas/TemplateOptions"
          }
        },
        "type": "object"
      },
      "TemplateOptions": {
        "properties": {
          "bundles": {
            "description": "The bundles the template follows.",
            "items": {
              "properties": {
                "attached_at": {
                  "format": "date-time",
                  "type": "string"
                },
                "bundle_id": {
                  "type": "string"
                },
                "name": {
                  "type": "string"
                }
              },
              "type": "object"
            },
            "type": "array"
          },
          "locked": {
            "description": "The whole template stopped following its bundles.",
            "type": "boolean"
          },
          "options": {
            "items": {
              "properties": {
                "auto_offer_new_values": {
                  "description": "A value added to the option later is offered here too.",
                  "type": "boolean"
                },
                "bundle_id": {
                  "description": "The bundle that brought it; null: added alone.",
                  "nullable": true,
                  "type": "string"
                },
                "bundle_name": {
                  "nullable": true,
                  "type": "string"
                },
                "changed": {
                  "description": "This template changed something the bundle set.",
                  "type": "boolean"
                },
                "default_option_id": {
                  "description": "Starts as of a dropdown: one of its values’ `option_id`.",
                  "nullable": true,
                  "type": "string"
                },
                "default_value": {
                  "description": "Starts as of a typed option: text, a number as text, or `{ text, image_url }` for a text-and-image option. Null: none.",
                  "nullable": true
                },
                "default_value_source": {
                  "description": "`template`: this template’s own; `bundle`: a bundle it follows; `option`: the option’s own in the library.",
                  "enum": ["template", "bundle", "option", null],
                  "nullable": true,
                  "type": "string"
                },
                "field_id": {
                  "description": "The option’s `id` in the library (`GET /options`): what a line’s options take.",
                  "type": "string"
                },
                "follows_bundle": {
                  "description": "A bundle still supplies its values, required or rules.",
                  "type": "boolean"
                },
                "label": {
                  "description": "What customers see.",
                  "type": "string"
                },
                "locked": {
                  "description": "This option stopped following its bundle (the template’s own lock aside).",
                  "type": "boolean"
                },
                "name": {
                  "type": "string"
                },
                "required": {
                  "type": "boolean"
                },
                "required_source": {
                  "description": "`template`: this template’s own; `bundle`: a bundle it follows; `option`: the option’s own in the library.",
                  "enum": ["template", "bundle", "option"],
                  "type": "string"
                },
                "shown_when": {
                  "description": "Shown only when another option of this template (`field_id`, a dropdown) is set to one of `option_ids` (null: to anything). Null: always shown.",
                  "nullable": true,
                  "properties": {
                    "field_id": {
                      "type": "string"
                    },
                    "option_ids": {
                      "items": {
                        "type": "string"
                      },
                      "nullable": true,
                      "type": "array"
                    }
                  },
                  "type": "object"
                },
                "shown_when_source": {
                  "enum": ["template", "bundle", null],
                  "nullable": true,
                  "type": "string"
                },
                "sort_order": {
                  "type": "integer"
                },
                "swatches": {
                  "description": "A dropdown whose values show as colours.",
                  "type": "boolean"
                },
                "type": {
                  "enum": [
                    "text",
                    "number",
                    "dropdown",
                    "textarea",
                    "text_image",
                    "dimensions"
                  ],
                  "type": "string"
                },
                "unit": {
                  "nullable": true,
                  "type": "string"
                },
                "updated_at": {
                  "description": "What `version` checks (sent alone as `expected_updated_at`, as before).",
                  "format": "date-time",
                  "type": "string"
                },
                "values": {
                  "items": {
                    "properties": {
                      "base_cost": {
                        "description": "Only for a caller who may see costs.",
                        "nullable": true,
                        "type": "number"
                      },
                      "base_lead_time_days": {
                        "nullable": true,
                        "type": "integer"
                      },
                      "base_price": {
                        "description": "The option’s own price in the library.",
                        "type": "number"
                      },
                      "cost": {
                        "description": "Only for a caller who may see costs (absent otherwise). Null: unknown.",
                        "nullable": true,
                        "type": "number"
                      },
                      "cost_overridden": {
                        "description": "Only for a caller who may see costs.",
                        "type": "boolean"
                      },
                      "image_url": {
                        "nullable": true,
                        "type": "string"
                      },
                      "is_default": {
                        "description": "Starts as: picked on a new line.",
                        "type": "boolean"
                      },
                      "label": {
                        "description": "What customers see.",
                        "type": "string"
                      },
                      "lead_time_days": {
                        "description": "Days it adds to the lead time here; 0 is Same day, null none.",
                        "nullable": true,
                        "type": "integer"
                      },
                      "lead_time_overridden": {
                        "type": "boolean"
                      },
                      "offered": {
                        "description": "This template sells it.",
                        "type": "boolean"
                      },
                      "offered_source": {
                        "description": "`template`: set here; `bundle`: a bundle narrows it; `auto`: every value is offered (`auto_offer_new_values`).",
                        "enum": ["template", "bundle", "auto"],
                        "type": "string"
                      },
                      "option_id": {
                        "type": "string"
                      },
                      "price": {
                        "description": "What this template charges for it.",
                        "type": "number"
                      },
                      "price_overridden": {
                        "type": "boolean"
                      },
                      "product_image_url": {
                        "description": "The template photo the gallery jumps to when it is picked.",
                        "nullable": true,
                        "type": "string"
                      },
                      "shown_when": {
                        "description": "Shown only when another option of this template (`field_id`, a dropdown) is set to one of `option_ids` (null: to anything). Null: always shown.",
                        "nullable": true,
                        "properties": {
                          "field_id": {
                            "type": "string"
                          },
                          "option_ids": {
                            "items": {
                              "type": "string"
                            },
                            "nullable": true,
                            "type": "array"
                          }
                        },
                        "type": "object"
                      },
                      "swatch_color": {
                        "nullable": true,
                        "type": "string"
                      },
                      "value": {
                        "type": "string"
                      }
                    },
                    "type": "object"
                  },
                  "type": "array"
                },
                "version": {
                  "description": "Send it back as `version` with a change to this option.",
                  "type": "string"
                }
              },
              "type": "object"
            },
            "type": "array"
          },
          "template_id": {
            "type": "string"
          },
          "updated_at": {
            "description": "The options as a whole: what `version` checks.",
            "format": "date-time",
            "type": "string"
          },
          "version": {
            "description": "The options as a whole: send it back as `version` to reorder or lock them.",
            "type": "string"
          }
        },
        "type": "object"
      },
      "TemplateOptionsEdit": {
        "properties": {
          "expected_updated_at": {
            "description": "The `updated_at` of `GET /product-templates/{id}/options`, when you don’t send `version`.",
            "type": "string"
          },
          "locked": {
            "description": "Lock the whole template (`true`: bundle edits no longer reach it) or unlock it.",
            "type": "boolean"
          },
          "order": {
            "description": "The options top to bottom, by `field_id`; any left out keep their order after them.",
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "version": {
            "description": "The `version` of `GET /product-templates/{id}/options` (or the last change) answered, sent back as it is: no read needed first. A change made since is `409 STALE_VERSION` with the current `version` and what `changed`. Send this or `expected_updated_at`.",
            "type": "string"
          }
        },
        "type": "object"
      },
      "TemplatePin": {
        "properties": {
          "pinned": {
            "type": "boolean"
          }
        },
        "required": ["pinned"],
        "type": "object"
      },
      "TemplateSyncRetry": {
        "properties": {
          "queued": {
            "description": "Templates sent in this batch.",
            "type": "integer"
          },
          "remaining": {
            "description": "Templates that still need a sync after it.",
            "type": "integer"
          },
          "status": {
            "enum": ["nothing", "queued", "running", "already_queued"],
            "type": "string"
          }
        },
        "type": "object"
      },
      "TemplateUnitPrices": {
        "properties": {
          "name": {
            "description": "Its own name; null: the template’s.",
            "nullable": true,
            "type": "string"
          },
          "prices": {
            "description": "The locations where the unit has its own price; everywhere else it sells at the template’s.",
            "items": {
              "properties": {
                "location_id": {
                  "description": "A Shopify location id (`gid://shopify/Location/…`), as `GET /locations` lists them.",
                  "type": "string"
                },
                "price": {
                  "type": "number"
                }
              },
              "type": "object"
            },
            "type": "array"
          },
          "unit_id": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "TemplateUnitPricesInput": {
        "properties": {
          "name": {
            "description": "The unit’s own name; `null` uses the template’s. Absent: unchanged.",
            "nullable": true,
            "type": "string"
          },
          "prices": {
            "description": "Up to 50: the unit’s price at each location sent. Absent: unchanged.",
            "items": {
              "properties": {
                "location_id": {
                  "description": "A Shopify location id (`gid://shopify/Location/…` or the number; an `id` from `GET /locations`).",
                  "type": "string"
                },
                "price": {
                  "description": "Above 0, two decimals; `null` sells it at the template’s price there. A price that changes needs Change the catalog.",
                  "nullable": true,
                  "type": "number"
                }
              },
              "required": ["location_id"],
              "type": "object"
            },
            "type": "array"
          }
        },
        "type": "object"
      },
      "TemplateWarranty": {
        "properties": {
          "category_name": {
            "nullable": true,
            "type": "string"
          },
          "fallback_months": {
            "description": "What clearing `own_months` would give.",
            "nullable": true,
            "type": "integer"
          },
          "fallback_source_label": {
            "type": "string"
          },
          "following": {
            "description": "Options that follow the product’s term: what can be given its own.",
            "items": {
              "properties": {
                "field_id": {
                  "type": "string"
                },
                "months": {
                  "description": "Months of cover, 0–1200 (0: never covered); null: nothing set.",
                  "nullable": true,
                  "type": "integer"
                },
                "name": {
                  "type": "string"
                }
              },
              "type": "object"
            },
            "type": "array"
          },
          "options": {
            "description": "Options whose term differs from the product’s.",
            "items": {
              "properties": {
                "fallback_months": {
                  "description": "Months of cover, 0–1200 (0: never covered); null: nothing set.",
                  "nullable": true,
                  "type": "integer"
                },
                "fallback_source_label": {
                  "type": "string"
                },
                "field_id": {
                  "type": "string"
                },
                "locked": {
                  "description": "Staff can’t change it on an order line.",
                  "type": "boolean"
                },
                "months": {
                  "description": "Months of cover, 0–1200 (0: never covered); null: nothing set.",
                  "nullable": true,
                  "type": "integer"
                },
                "name": {
                  "type": "string"
                },
                "own": {
                  "description": "This template sets it (`months: null` follows the product again).",
                  "type": "boolean"
                },
                "source_label": {
                  "description": "Where the term comes from, as the card says.",
                  "type": "string"
                }
              },
              "type": "object"
            },
            "type": "array"
          },
          "own_months": {
            "description": "This template’s own term; null: it follows its category and vendor.",
            "nullable": true,
            "type": "integer"
          },
          "preview_vendor_id": {
            "description": "The vendor this preview used.",
            "nullable": true,
            "type": "string"
          },
          "product_months": {
            "description": "The product’s term a new order gets today.",
            "nullable": true,
            "type": "integer"
          },
          "product_source_label": {
            "description": "Where it comes from, as the card says.",
            "type": "string"
          },
          "serial_required": {
            "description": "Every unit sold needs a serial number once fulfilled.",
            "type": "boolean"
          },
          "template_id": {
            "type": "string"
          },
          "term_presets": {
            "description": "The store’s usual terms, in months.",
            "items": {
              "type": "integer"
            },
            "type": "array"
          },
          "vendors": {
            "items": {
              "properties": {
                "id": {
                  "type": "string"
                },
                "name": {
                  "type": "string"
                }
              },
              "type": "object"
            },
            "type": "array"
          }
        },
        "type": "object"
      },
      "TemplateWarrantyEdit": {
        "properties": {
          "options": {
            "description": "Up to 100 options’ terms on this template.",
            "items": {
              "properties": {
                "field_id": {
                  "description": "An option on the template: a `field_id` of its options.",
                  "type": "string"
                },
                "locked": {
                  "description": "Staff can’t change it on an order line. Needs a term.",
                  "type": "boolean"
                },
                "months": {
                  "description": "Its own term (0–1200); `null`: follow the product’s term again.",
                  "nullable": true,
                  "type": "integer"
                }
              },
              "required": ["field_id"],
              "type": "object"
            },
            "type": "array"
          },
          "own_months": {
            "description": "This template’s own term (0–1200); `null`: follow the category and vendor.",
            "nullable": true,
            "type": "integer"
          },
          "serial_required": {
            "type": "boolean"
          }
        },
        "type": "object"
      },
      "Today": {
        "properties": {
          "today": {
            "properties": {
              "inbox": {
                "description": "Null without the right to see the Inbox. `hero` is the conversation that has waited longest for a reply (a row as `GET /conversations` gives it), or null when none waits.",
                "nullable": true,
                "properties": {
                  "counts": {
                    "description": "The tab counts.",
                    "nullable": true,
                    "type": "object"
                  },
                  "hero": {
                    "nullable": true,
                    "type": "object"
                  },
                  "unread": {
                    "type": "integer"
                  }
                },
                "type": "object"
              },
              "needs_you": {
                "description": "Records that need attention now and are not ignored, longest waiting first (up to 5), with how many there are in all: the Orders list as Home’s “need attention” link opens it, so a role that can be credited sees its own. Null without View quotes and orders.",
                "nullable": true,
                "properties": {
                  "count": {
                    "type": "integer"
                  },
                  "items": {
                    "items": {
                      "description": "An order or quote as the lists give it (`id`, `number`, `status`, `customer`, `total`, …), with `record_kind` (`order` or `quote`).",
                      "properties": {
                        "attention": {
                          "description": "`kind`, `party` (who it waits on), `since`, and the `label` and `title` of the reason.",
                          "type": "object"
                        }
                      },
                      "type": "object"
                    },
                    "type": "array"
                  }
                },
                "type": "object"
              }
            },
            "type": "object"
          }
        },
        "type": "object"
      },
      "Token": {
        "properties": {
          "access_token": {
            "type": "string"
          },
          "expires_in": {
            "type": "integer"
          },
          "refresh_token": {
            "type": "string"
          },
          "shop": {
            "type": "string"
          },
          "token_type": {
            "enum": ["Bearer"],
            "type": "string"
          }
        },
        "type": "object"
      },
      "Unit": {
        "properties": {
          "unit": {
            "properties": {
              "claims": {
                "description": "Null without View warranty claims.",
                "nullable": true,
                "properties": {
                  "open": {
                    "items": {
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "number": {
                          "type": "string"
                        },
                        "status": {
                          "type": "string"
                        },
                        "waiting_on": {
                          "type": "string"
                        }
                      },
                      "type": "object"
                    },
                    "type": "array"
                  },
                  "past": {
                    "description": "Resolved or declined claims on the order.",
                    "type": "integer"
                  }
                },
                "type": "object"
              },
              "delivered_at": {
                "format": "date-time",
                "nullable": true,
                "type": "string"
              },
              "delivery": {
                "description": "Whether it reached the customer: `delivered` (its cover runs), `not_shipped` (Shopify hasn’t fulfilled it), `delivery_cancelled` (a delivery was recorded, then voided) or `not_recorded` (fulfilled, or nothing says otherwise, but no delivery on record: a claim can still be taken).",
                "enum": [
                  "delivered",
                  "not_shipped",
                  "delivery_cancelled",
                  "not_recorded"
                ],
                "type": "string"
              },
              "image": {
                "description": "The first picture’s URL (the product’s main picture), or null.",
                "nullable": true,
                "type": "string"
              },
              "images": {
                "description": "Every picture’s URL, the main one first. Empty when there is none.",
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              "line_quantity": {
                "type": "integer"
              },
              "notes": {
                "description": "Notes saved on the unit, newest first (up to 30).",
                "items": {
                  "properties": {
                    "at": {
                      "format": "date-time",
                      "type": "string"
                    },
                    "by": {
                      "nullable": true,
                      "type": "string"
                    },
                    "text": {
                      "type": "string"
                    }
                  },
                  "type": "object"
                },
                "type": "array"
              },
              "order": {
                "properties": {
                  "customer": {
                    "nullable": true,
                    "properties": {
                      "name": {
                        "nullable": true,
                        "type": "string"
                      }
                    },
                    "type": "object"
                  },
                  "id": {
                    "type": "string"
                  },
                  "number": {
                    "type": "string"
                  },
                  "sold_at": {
                    "format": "date-time",
                    "nullable": true,
                    "type": "string"
                  }
                },
                "type": "object"
              },
              "serial": {
                "type": "string"
              },
              "title": {
                "description": "The product on the order line.",
                "type": "string"
              },
              "unit_number": {
                "description": "Which unit of the line, from 1.",
                "type": "integer"
              },
              "warranty": {
                "description": "The cover of each part.",
                "items": {
                  "properties": {
                    "component_key": {
                      "type": "string"
                    },
                    "expires_at": {
                      "format": "date-time",
                      "nullable": true,
                      "type": "string"
                    },
                    "headline": {
                      "description": "“Covered until Mar 14, 2028”.",
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    },
                    "state": {
                      "description": "covered, expired, stopped, not_started, not_covered or excluded.",
                      "type": "string"
                    },
                    "status_text": {
                      "type": "string"
                    }
                  },
                  "type": "object"
                },
                "type": "array"
              }
            },
            "type": "object"
          }
        },
        "type": "object"
      },
      "Vendor": {
        "properties": {
          "address1": {
            "nullable": true,
            "type": "string"
          },
          "address2": {
            "nullable": true,
            "type": "string"
          },
          "build_lead_days": {
            "nullable": true,
            "type": "integer"
          },
          "city": {
            "nullable": true,
            "type": "string"
          },
          "contact_person": {
            "nullable": true,
            "type": "string"
          },
          "country": {
            "nullable": true,
            "type": "string"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "display_name": {
            "type": "string"
          },
          "email": {
            "nullable": true,
            "type": "string"
          },
          "enforce_min_order_quantity": {
            "type": "boolean"
          },
          "enforce_min_order_value": {
            "type": "boolean"
          },
          "id": {
            "type": "string"
          },
          "include_sku_on_purchase_orders": {
            "type": "boolean"
          },
          "is_active": {
            "type": "boolean"
          },
          "min_order_quantity": {
            "nullable": true,
            "type": "integer"
          },
          "min_order_value": {
            "description": "Left out without “View costs”.",
            "nullable": true,
            "type": "number"
          },
          "min_order_value_hidden": {
            "description": "Present, and true when a value minimum is set, only when `min_order_value` is left out without “View costs”.",
            "type": "boolean"
          },
          "name": {
            "type": "string"
          },
          "notes": {
            "nullable": true,
            "type": "string"
          },
          "phone": {
            "nullable": true,
            "type": "string"
          },
          "province": {
            "nullable": true,
            "type": "string"
          },
          "source": {
            "enum": ["manual", "shopify"],
            "type": "string"
          },
          "transfer_lead_days": {
            "nullable": true,
            "type": "integer"
          },
          "updated_at": {
            "format": "date-time",
            "type": "string"
          },
          "zip": {
            "nullable": true,
            "type": "string"
          }
        },
        "required": [
          "id",
          "display_name",
          "name",
          "email",
          "phone",
          "contact_person",
          "address1",
          "address2",
          "city",
          "province",
          "zip",
          "country",
          "notes",
          "is_active",
          "source",
          "min_order_quantity",
          "enforce_min_order_quantity",
          "enforce_min_order_value",
          "include_sku_on_purchase_orders",
          "build_lead_days",
          "transfer_lead_days",
          "created_at",
          "updated_at"
        ],
        "type": "object"
      },
      "VendorCreate": {
        "properties": {
          "address1": {
            "nullable": true,
            "type": "string"
          },
          "address2": {
            "type": "string"
          },
          "build_lead_days": {
            "description": "Whole days, 0 to 3,650.",
            "nullable": true,
            "type": "integer"
          },
          "city": {
            "type": "string"
          },
          "contact_person": {
            "nullable": true,
            "type": "string"
          },
          "country": {
            "type": "string"
          },
          "display_name": {
            "description": "The name people see. Defaults to `name`.",
            "type": "string"
          },
          "email": {
            "nullable": true,
            "type": "string"
          },
          "enforce_min_order_quantity": {
            "type": "boolean"
          },
          "enforce_min_order_value": {
            "type": "boolean"
          },
          "include_sku_on_purchase_orders": {
            "type": "boolean"
          },
          "is_active": {
            "type": "boolean"
          },
          "min_order_quantity": {
            "description": "Whole units across a purchase order. Null or 0: no minimum.",
            "nullable": true,
            "type": "integer"
          },
          "min_order_value": {
            "description": "Goods value of a purchase order. Needs “View costs” to read or set.",
            "nullable": true,
            "type": "number"
          },
          "name": {
            "description": "The vendor’s name; kept lower-cased as its key.",
            "type": "string"
          },
          "notes": {
            "nullable": true,
            "type": "string"
          },
          "phone": {
            "nullable": true,
            "type": "string"
          },
          "province": {
            "type": "string"
          },
          "transfer_lead_days": {
            "description": "Whole days, 0 to 3,650.",
            "nullable": true,
            "type": "integer"
          },
          "zip": {
            "type": "string"
          }
        },
        "required": ["name"],
        "type": "object"
      },
      "VendorDeleted": {
        "properties": {
          "deleted": {
            "type": "boolean"
          },
          "id": {
            "type": "string"
          }
        },
        "required": ["id", "deleted"],
        "type": "object"
      },
      "VendorEdit": {
        "description": "Any of the fields; the ones sent change, `null` clears the fields that allow it.",
        "properties": {
          "address1": {
            "nullable": true,
            "type": "string"
          },
          "address2": {
            "type": "string"
          },
          "build_lead_days": {
            "description": "Whole days, 0 to 3,650.",
            "nullable": true,
            "type": "integer"
          },
          "city": {
            "type": "string"
          },
          "contact_person": {
            "nullable": true,
            "type": "string"
          },
          "country": {
            "type": "string"
          },
          "display_name": {
            "description": "The name people see. Defaults to `name`.",
            "type": "string"
          },
          "email": {
            "nullable": true,
            "type": "string"
          },
          "enforce_min_order_quantity": {
            "type": "boolean"
          },
          "enforce_min_order_value": {
            "type": "boolean"
          },
          "include_sku_on_purchase_orders": {
            "type": "boolean"
          },
          "is_active": {
            "type": "boolean"
          },
          "min_order_quantity": {
            "description": "Whole units across a purchase order. Null or 0: no minimum.",
            "nullable": true,
            "type": "integer"
          },
          "min_order_value": {
            "description": "Goods value of a purchase order. Needs “View costs” to read or set.",
            "nullable": true,
            "type": "number"
          },
          "name": {
            "description": "The vendor’s name; kept lower-cased as its key.",
            "type": "string"
          },
          "notes": {
            "nullable": true,
            "type": "string"
          },
          "phone": {
            "nullable": true,
            "type": "string"
          },
          "province": {
            "type": "string"
          },
          "transfer_lead_days": {
            "description": "Whole days, 0 to 3,650.",
            "nullable": true,
            "type": "integer"
          },
          "zip": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "VendorList": {
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/Vendor"
            },
            "type": "array"
          },
          "next_cursor": {
            "nullable": true,
            "type": "string"
          }
        },
        "required": ["items", "next_cursor"],
        "type": "object"
      },
      "VendorSync": {
        "properties": {
          "job_id": {
            "type": "string"
          },
          "state": {
            "enum": ["queued", "running", "completed", "failed", "unknown"],
            "type": "string"
          }
        },
        "required": ["job_id", "state"],
        "type": "object"
      },
      "Warehouse": {
        "properties": {
          "address": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          }
        },
        "required": ["id", "name", "address"],
        "type": "object"
      },
      "WarehouseCreate": {
        "properties": {
          "address": {
            "description": "Its address as a purchase order prints it: one line per row (`\\n`), up to 1,000 characters; empty rows are dropped.",
            "type": "string"
          },
          "name": {
            "description": "The warehouse’s name, up to 120 characters; spaces inside are made single.",
            "type": "string"
          }
        },
        "required": ["name", "address"],
        "type": "object"
      },
      "WarehouseDeleted": {
        "properties": {
          "deleted": {
            "type": "boolean"
          },
          "id": {
            "type": "string"
          }
        },
        "required": ["id", "deleted"],
        "type": "object"
      },
      "WarehouseEdit": {
        "description": "At least one of `name` and `address`.",
        "properties": {
          "address": {
            "description": "Its address as a purchase order prints it: one line per row (`\\n`), up to 1,000 characters; empty rows are dropped.",
            "type": "string"
          },
          "name": {
            "description": "The warehouse’s name, up to 120 characters; spaces inside are made single.",
            "type": "string"
          }
        },
        "type": "object"
      },
      "WarehouseList": {
        "properties": {
          "items": {
            "items": {
              "properties": {
                "address": {
                  "type": "string"
                },
                "id": {
                  "type": "string"
                },
                "name": {
                  "type": "string"
                }
              },
              "required": ["id", "name", "address"],
              "type": "object"
            },
            "type": "array"
          }
        },
        "required": ["items"],
        "type": "object"
      },
      "WarrantyCategoryRuleCreate": {
        "properties": {
          "category_id": {
            "description": "The category, its `id` from `GET /categories`.",
            "type": "string"
          },
          "months": {
            "description": "The rule’s term. Months, 0–1200: `0` is no warranty, null is not set (follows the step above).",
            "nullable": true,
            "type": "integer"
          },
          "vendor_id": {
            "description": "Only this vendor’s products: an `id` in `vendors` of `GET /settings/warranty/ladder`. Left out or null: every vendor.",
            "nullable": true,
            "type": "string"
          }
        },
        "required": ["category_id", "months"],
        "type": "object"
      },
      "WarrantyClaim": {
        "description": "One claim as its page shows it. Enum values are lowercase. `costs`, `cost_totals` and the vendor claim’s amounts are null for a role without View costs (`costs_hidden` says why). Notes are events of type `note`.",
        "properties": {
          "assigned_to": {
            "nullable": true,
            "properties": {
              "id": {
                "type": "string"
              },
              "name": {
                "type": "string"
              }
            },
            "type": "object"
          },
          "attachments": {
            "items": {
              "properties": {
                "content_type": {
                  "type": "string"
                },
                "created_at": {
                  "format": "date-time",
                  "type": "string"
                },
                "file_name": {
                  "type": "string"
                },
                "fix_id": {
                  "nullable": true,
                  "type": "string"
                },
                "id": {
                  "type": "string"
                },
                "size_bytes": {
                  "type": "integer"
                }
              },
              "type": "object"
            },
            "type": "array"
          },
          "auto_emails": {
            "description": "The emails the store sends by itself.",
            "items": {
              "enum": [
                "received",
                "more_info",
                "approved",
                "visit_booked",
                "resolved",
                "declined",
                "delivery_booked",
                "arrange_time"
              ],
              "type": "string"
            },
            "type": "array"
          },
          "billing_block": {
            "nullable": true,
            "type": "string"
          },
          "channel": {
            "enum": [
              "phone",
              "email",
              "in_store",
              "online",
              "pos",
              "text",
              "on_delivery"
            ],
            "type": "string"
          },
          "claim_number": {
            "type": "string"
          },
          "closed_at": {
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "cost_totals": {
            "nullable": true,
            "properties": {
              "customer": {
                "type": "number"
              },
              "store": {
                "type": "number"
              },
              "total": {
                "type": "number"
              },
              "vendor": {
                "type": "number"
              }
            },
            "type": "object"
          },
          "costs": {
            "description": "Null when the person can’t see costs.",
            "items": {
              "properties": {
                "amount": {
                  "type": "number"
                },
                "fix_id": {
                  "nullable": true,
                  "type": "string"
                },
                "from_label": {
                  "nullable": true,
                  "type": "string"
                },
                "id": {
                  "type": "string"
                },
                "kind": {
                  "enum": [
                    "part",
                    "labour",
                    "shipping",
                    "other",
                    "replacement"
                  ],
                  "type": "string"
                },
                "label": {
                  "type": "string"
                },
                "payer": {
                  "enum": ["store", "vendor", "customer"],
                  "type": "string"
                }
              },
              "type": "object"
            },
            "nullable": true,
            "type": "array"
          },
          "costs_hidden": {
            "description": "Set when costs are hidden from this person.",
            "nullable": true,
            "properties": {
              "reason": {
                "type": "string"
              }
            },
            "type": "object"
          },
          "created_by_name": {
            "nullable": true,
            "type": "string"
          },
          "currency": {
            "type": "string"
          },
          "customer_said_delivered_on": {
            "description": "YYYY-MM-DD.",
            "nullable": true,
            "type": "string"
          },
          "customer_words": {
            "type": "string"
          },
          "decided_at": {
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "decided_by_name": {
            "nullable": true,
            "type": "string"
          },
          "decision": {
            "enum": [
              "covered",
              "partly_covered",
              "goodwill",
              "paid_repair",
              "declined",
              null
            ],
            "nullable": true,
            "type": "string"
          },
          "decision_note": {
            "nullable": true,
            "type": "string"
          },
          "decline_reason_id": {
            "nullable": true,
            "type": "string"
          },
          "decline_reason_label": {
            "nullable": true,
            "type": "string"
          },
          "decline_reasons": {
            "items": {
              "properties": {
                "customer_message": {
                  "nullable": true,
                  "type": "string"
                },
                "id": {
                  "type": "string"
                },
                "kind": {
                  "enum": ["problem", "decline"],
                  "type": "string"
                },
                "label": {
                  "type": "string"
                },
                "position": {
                  "type": "integer"
                }
              },
              "type": "object"
            },
            "type": "array"
          },
          "events": {
            "description": "The timeline, newest 200. Notes are type `note`.",
            "items": {
              "properties": {
                "actor_name": {
                  "nullable": true,
                  "type": "string"
                },
                "created_at": {
                  "format": "date-time",
                  "type": "string"
                },
                "detail_lines": {
                  "items": {
                    "type": "string"
                  },
                  "type": "array"
                },
                "id": {
                  "type": "string"
                },
                "message": {
                  "description": "A signature request’s line names the address it went to only with Read customers (a phone: View quotes and orders).",
                  "type": "string"
                },
                "type": {
                  "enum": [
                    "created",
                    "note",
                    "status_changed",
                    "assigned",
                    "waiting_on_changed",
                    "decided",
                    "reopened",
                    "fix_added",
                    "fix_updated",
                    "cost_changed",
                    "vendor_claim",
                    "email_sent",
                    "file_added",
                    "file_removed",
                    "repair_order",
                    "vendor_ask",
                    "report_edited"
                  ],
                  "type": "string"
                }
              },
              "type": "object"
            },
            "type": "array"
          },
          "fixes": {
            "items": {
              "properties": {
                "amount": {
                  "nullable": true,
                  "type": "number"
                },
                "cancelled_at": {
                  "format": "date-time",
                  "nullable": true,
                  "type": "string"
                },
                "created_at": {
                  "format": "date-time",
                  "type": "string"
                },
                "done_at": {
                  "format": "date-time",
                  "nullable": true,
                  "type": "string"
                },
                "external_ref": {
                  "nullable": true,
                  "type": "string"
                },
                "from_stock_at": {
                  "format": "date-time",
                  "nullable": true,
                  "type": "string"
                },
                "id": {
                  "type": "string"
                },
                "minutes_spent": {
                  "nullable": true,
                  "type": "integer"
                },
                "notes": {
                  "nullable": true,
                  "type": "string"
                },
                "old_unit_outcome": {
                  "enum": ["return_to_vendor", "dispose", "keep", null],
                  "nullable": true,
                  "type": "string"
                },
                "ordered_outside_at": {
                  "format": "date-time",
                  "nullable": true,
                  "type": "string"
                },
                "picked_up_at": {
                  "format": "date-time",
                  "nullable": true,
                  "type": "string"
                },
                "purchase_order": {
                  "nullable": true,
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "label": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string"
                    }
                  },
                  "type": "object"
                },
                "replacement_order": {
                  "nullable": true,
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "label": {
                      "type": "string"
                    }
                  },
                  "type": "object"
                },
                "returned_at": {
                  "format": "date-time",
                  "nullable": true,
                  "type": "string"
                },
                "setup_pending": {
                  "type": "boolean"
                },
                "status": {
                  "enum": ["open", "done", "cancelled"],
                  "type": "string"
                },
                "technician": {
                  "nullable": true,
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    }
                  },
                  "type": "object"
                },
                "title": {
                  "type": "string"
                },
                "type": {
                  "enum": [
                    "repair_visit",
                    "part",
                    "replacement",
                    "refund",
                    "store_credit",
                    "pickup"
                  ],
                  "type": "string"
                },
                "visit_on": {
                  "nullable": true,
                  "type": "string"
                },
                "visit_result": {
                  "enum": ["fixed", "another_visit", "not_fixed", null],
                  "nullable": true,
                  "type": "string"
                },
                "visit_window": {
                  "nullable": true,
                  "type": "string"
                }
              },
              "type": "object"
            },
            "type": "array"
          },
          "goodwill_amount": {
            "nullable": true,
            "type": "number"
          },
          "goodwill_percent": {
            "nullable": true,
            "type": "number"
          },
          "id": {
            "type": "string"
          },
          "labour_hourly_rate": {
            "nullable": true,
            "type": "number"
          },
          "order": {
            "properties": {
              "covered_units": {
                "type": "integer"
              },
              "customer_address": {
                "description": "Only with Read customers (a phone: View quotes and orders); left out otherwise.",
                "nullable": true,
                "type": "string"
              },
              "customer_email": {
                "description": "Only with Read customers (a phone: View quotes and orders); left out otherwise.",
                "nullable": true,
                "type": "string"
              },
              "customer_name": {
                "description": "The customer’s name: “No name” for a customer with none (never their email), “No customer” for a claim with none.",
                "type": "string"
              },
              "customer_phone": {
                "description": "Only with Read customers (a phone: View quotes and orders); left out otherwise.",
                "nullable": true,
                "type": "string"
              },
              "customer_shopify_id": {
                "nullable": true,
                "type": "string"
              },
              "delivered_at": {
                "format": "date-time",
                "nullable": true,
                "type": "string"
              },
              "id": {
                "type": "string"
              },
              "is_quote": {
                "type": "boolean"
              },
              "label": {
                "type": "string"
              },
              "other_open_claims": {
                "items": {
                  "properties": {
                    "claim_number": {
                      "type": "string"
                    },
                    "id": {
                      "type": "string"
                    }
                  },
                  "type": "object"
                },
                "type": "array"
              }
            },
            "type": "object"
          },
          "order_change_refusal": {
            "description": "Why this person can’t change the order, or null.",
            "nullable": true,
            "type": "string"
          },
          "order_location_blocked": {
            "nullable": true,
            "type": "string"
          },
          "paid_repair_start": {
            "properties": {
              "deposit_percent": {
                "type": "number"
              },
              "mode": {
                "enum": ["signed", "deposit_paid"],
                "type": "string"
              }
            },
            "type": "object"
          },
          "pickup_first": {
            "type": "boolean"
          },
          "planned_fix": {
            "enum": [
              "repair_visit",
              "part",
              "replacement",
              "refund",
              "store_credit",
              "pickup",
              null
            ],
            "nullable": true,
            "type": "string"
          },
          "problem_reasons": {
            "items": {
              "properties": {
                "customer_message": {
                  "nullable": true,
                  "type": "string"
                },
                "id": {
                  "type": "string"
                },
                "kind": {
                  "enum": ["problem", "decline"],
                  "type": "string"
                },
                "label": {
                  "type": "string"
                },
                "position": {
                  "type": "integer"
                }
              },
              "type": "object"
            },
            "type": "array"
          },
          "problem_started_on": {
            "description": "YYYY-MM-DD.",
            "nullable": true,
            "type": "string"
          },
          "reason_id": {
            "nullable": true,
            "type": "string"
          },
          "reason_label": {
            "type": "string"
          },
          "replacement_cover": {
            "properties": {
              "min_days": {
                "type": "integer"
              },
              "policy": {
                "enum": [
                  "keep_end_date",
                  "keep_end_date_min_days",
                  "fresh_term"
                ],
                "type": "string"
              }
            },
            "type": "object"
          },
          "reported_at": {
            "format": "date-time",
            "type": "string"
          },
          "resolved_at": {
            "format": "date-time",
            "nullable": true,
            "type": "string"
          },
          "staff_options": {
            "description": "Who the claim can be assigned to; the ones not `suspended` are who a repair visit can be booked with (`technician_staff_id`).",
            "items": {
              "properties": {
                "id": {
                  "type": "string"
                },
                "name": {
                  "type": "string"
                },
                "suspended": {
                  "type": "boolean"
                }
              },
              "type": "object"
            },
            "type": "array"
          },
          "status": {
            "enum": [
              "new",
              "in_review",
              "approved",
              "in_progress",
              "resolved",
              "declined"
            ],
            "type": "string"
          },
          "suggestion": {
            "properties": {
              "decision": {
                "enum": [
                  "covered",
                  "partly_covered",
                  "goodwill",
                  "paid_repair",
                  "declined"
                ],
                "type": "string"
              },
              "text": {
                "type": "string"
              },
              "title": {
                "type": "string"
              }
            },
            "type": "object"
          },
          "time_zone": {
            "description": "The shop’s IANA time zone.",
            "type": "string"
          },
          "units": {
            "items": {
              "properties": {
                "component_key": {
                  "type": "string"
                },
                "component_name": {
                  "type": "string"
                },
                "coverage_ends_at": {
                  "format": "date-time",
                  "nullable": true,
                  "type": "string"
                },
                "coverage_start_at": {
                  "format": "date-time",
                  "nullable": true,
                  "type": "string"
                },
                "delivery_confirmed": {
                  "nullable": true,
                  "properties": {
                    "at": {
                      "format": "date-time",
                      "type": "string"
                    },
                    "by_name": {
                      "nullable": true,
                      "type": "string"
                    },
                    "on": {
                      "type": "string"
                    },
                    "source": {
                      "enum": [
                        "shopify_delivered",
                        "shopify_collected",
                        "shopify_shipped",
                        "on_record",
                        "staff"
                      ],
                      "type": "string"
                    }
                  },
                  "type": "object"
                },
                "id": {
                  "type": "string"
                },
                "inactive_vendor_name": {
                  "nullable": true,
                  "type": "string"
                },
                "line_title": {
                  "type": "string"
                },
                "order_line_item_id": {
                  "nullable": true,
                  "type": "string"
                },
                "plan_months": {
                  "type": "integer"
                },
                "serial_number": {
                  "nullable": true,
                  "type": "string"
                },
                "term_months": {
                  "nullable": true,
                  "type": "integer"
                },
                "term_source_label": {
                  "nullable": true,
                  "type": "string"
                },
                "term_text": {
                  "type": "string"
                },
                "unit_dates": {
                  "nullable": true,
                  "properties": {
                    "goodwill_ends_on": {
                      "nullable": true,
                      "type": "string"
                    },
                    "min_days_after_start": {
                      "nullable": true,
                      "type": "integer"
                    },
                    "replaced_started_on": {
                      "nullable": true,
                      "type": "string"
                    }
                  },
                  "type": "object"
                },
                "unit_index": {
                  "type": "integer"
                },
                "unit_price": {
                  "nullable": true,
                  "type": "number"
                },
                "verdict": {
                  "description": "Where the unit stands against its cover.",
                  "enum": [
                    "covered",
                    "ended",
                    "not_started",
                    "not_covered",
                    "excluded",
                    "stopped"
                  ],
                  "type": "string"
                }
              },
              "type": "object"
            },
            "type": "array"
          },
          "vendor": {
            "nullable": true,
            "properties": {
              "active": {
                "type": "boolean"
              },
              "assignable": {
                "type": "boolean"
              },
              "email": {
                "nullable": true,
                "type": "string"
              },
              "id": {
                "type": "string"
              },
              "name": {
                "type": "string"
              }
            },
            "type": "object"
          },
          "vendor_ask": {
            "nullable": true,
            "properties": {
              "answer": {
                "enum": ["approved", "approved_in_part", "denied", null],
                "nullable": true,
                "type": "string"
              },
              "answer_action": {
                "enum": [
                  "send_replacement",
                  "send_part",
                  "pay_back",
                  "nothing",
                  null
                ],
                "nullable": true,
                "type": "string"
              },
              "answer_note": {
                "nullable": true,
                "type": "string"
              },
              "answer_recorded_by_name": {
                "nullable": true,
                "type": "string"
              },
              "answered_at": {
                "format": "date-time",
                "nullable": true,
                "type": "string"
              },
              "message": {
                "nullable": true,
                "type": "string"
              },
              "reference": {
                "nullable": true,
                "type": "string"
              },
              "reminded_at": {
                "format": "date-time",
                "nullable": true,
                "type": "string"
              },
              "sent_at": {
                "format": "date-time",
                "nullable": true,
                "type": "string"
              },
              "sent_to": {
                "nullable": true,
                "type": "string"
              },
              "skip_reason": {
                "nullable": true,
                "type": "string"
              },
              "skipped_at": {
                "format": "date-time",
                "nullable": true,
                "type": "string"
              },
              "skipped_by_name": {
                "nullable": true,
                "type": "string"
              },
              "status": {
                "enum": ["asked", "answered", "skipped"],
                "type": "string"
              },
              "vendor_name": {
                "type": "string"
              }
            },
            "type": "object"
          },
          "vendor_claim": {
            "nullable": true,
            "properties": {
              "amount_asked": {
                "nullable": true,
                "type": "number"
              },
              "amount_credited": {
                "nullable": true,
                "type": "number"
              },
              "answered_at": {
                "format": "date-time",
                "nullable": true,
                "type": "string"
              },
              "asked_via": {
                "nullable": true,
                "type": "string"
              },
              "credited_at": {
                "format": "date-time",
                "nullable": true,
                "type": "string"
              },
              "credited_via": {
                "nullable": true,
                "type": "string"
              },
              "note": {
                "nullable": true,
                "type": "string"
              },
              "reference": {
                "nullable": true,
                "type": "string"
              },
              "sent_at": {
                "format": "date-time",
                "nullable": true,
                "type": "string"
              },
              "sent_to": {
                "nullable": true,
                "type": "string"
              },
              "shortfall_kept_at": {
                "format": "date-time",
                "nullable": true,
                "type": "string"
              },
              "status": {
                "enum": ["not_sent", "sent", "approved", "credited", "denied"],
                "type": "string"
              },
              "vendor_id": {
                "nullable": true,
                "type": "string"
              },
              "vendor_name": {
                "type": "string"
              }
            },
            "type": "object"
          },
          "waiting_on": {
            "enum": [
              "nobody",
              "customer",
              "vendor",
              "part",
              "visit",
              "delivery"
            ],
            "type": "string"
          },
          "warranty_order": {
            "description": "The paid repair or replacement order made for the claim.",
            "nullable": true,
            "properties": {
              "cancelled": {
                "type": "boolean"
              },
              "claim_writes_order": {
                "type": "boolean"
              },
              "customer_owes": {
                "type": "number"
              },
              "deposit_needed": {
                "type": "number"
              },
              "fee_mismatches": {
                "items": {
                  "properties": {
                    "claim_amount": {
                      "type": "number"
                    },
                    "kind": {
                      "enum": ["missing", "price", "charge"],
                      "type": "string"
                    },
                    "label": {
                      "type": "string"
                    },
                    "order_amount": {
                      "nullable": true,
                      "type": "number"
                    }
                  },
                  "type": "object"
                },
                "type": "array"
              },
              "id": {
                "type": "string"
              },
              "is_quote": {
                "type": "boolean"
              },
              "label": {
                "type": "string"
              },
              "legacy_replacement": {
                "type": "boolean"
              },
              "paid": {
                "type": "number"
              },
              "past_claim": {
                "enum": ["cancelled", "split", "fulfilled", "placed", null],
                "nullable": true,
                "type": "string"
              },
              "shipping": {
                "type": "number"
              },
              "sign_requested_at": {
                "format": "date-time",
                "nullable": true,
                "type": "string"
              },
              "sign_requested_to": {
                "description": "The address the last signature request was emailed to. Only with Read customers (a phone: View quotes and orders); left out otherwise.",
                "nullable": true,
                "type": "string"
              },
              "signature_waived": {
                "type": "boolean"
              },
              "signed": {
                "type": "boolean"
              },
              "tax": {
                "type": "number"
              },
              "work_block": {
                "nullable": true,
                "type": "string"
              }
            },
            "type": "object"
          },
          "warranty_order_stale": {
            "type": "boolean"
          }
        },
        "required": [
          "id",
          "claim_number",
          "status",
          "waiting_on",
          "channel",
          "customer_words",
          "reported_at",
          "order",
          "units",
          "fixes",
          "events",
          "currency"
        ],
        "type": "object"
      },
      "WarrantyClaimAttachment": {
        "properties": {
          "content_type": {
            "type": "string"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "file_name": {
            "type": "string"
          },
          "fix_id": {
            "nullable": true,
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "size_bytes": {
            "type": "integer"
          }
        },
        "required": [
          "id",
          "file_name",
          "content_type",
          "size_bytes",
          "fix_id",
          "created_at"
        ],
        "type": "object"
      },
      "WarrantyClaimAttachmentDeleted": {
        "properties": {
          "deleted": {
            "type": "boolean"
          },
          "id": {
            "type": "string"
          }
        },
        "required": ["id", "deleted"],
        "type": "object"
      },
      "WarrantyClaimAttachmentList": {
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/WarrantyClaimAttachment"
            },
            "type": "array"
          }
        },
        "required": ["items"],
        "type": "object"
      },
      "WarrantyClaimAttachmentUrl": {
        "properties": {
          "filename": {
            "type": "string"
          },
          "url": {
            "type": "string"
          }
        },
        "required": ["url", "filename"],
        "type": "object"
      },
      "WarrantyClaimCost": {
        "properties": {
          "amount": {
            "description": "Two decimals.",
            "type": "number"
          },
          "claim_id": {
            "type": "string"
          },
          "fix_id": {
            "description": "The fix it came from (a part’s cost), or null.",
            "nullable": true,
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "kind": {
            "enum": ["part", "labour", "shipping", "other", "replacement"],
            "type": "string"
          },
          "label": {
            "type": "string"
          },
          "payer": {
            "enum": ["store", "vendor", "customer"],
            "type": "string"
          }
        },
        "required": [
          "claim_id",
          "id",
          "kind",
          "label",
          "amount",
          "payer",
          "fix_id"
        ],
        "type": "object"
      },
      "WarrantyClaimCostAdd": {
        "description": "Enum values in any case.",
        "properties": {
          "amount": {
            "description": "0 or more, at most 2 decimals.",
            "type": "number"
          },
          "kind": {
            "enum": ["part", "labour", "shipping", "other", "replacement"],
            "type": "string"
          },
          "label": {
            "description": "What it is. Up to 255 characters.",
            "type": "string"
          },
          "payer": {
            "description": "Who pays it.",
            "enum": ["store", "vendor", "customer"],
            "type": "string"
          }
        },
        "required": ["kind", "label", "amount", "payer"],
        "type": "object"
      },
      "WarrantyClaimCostDeleted": {
        "properties": {
          "claim_id": {
            "type": "string"
          },
          "deleted": {
            "type": "boolean"
          },
          "id": {
            "type": "string"
          }
        },
        "required": ["claim_id", "id", "deleted"],
        "type": "object"
      },
      "WarrantyClaimCostEdit": {
        "description": "At least one field; only the fields sent change. Enum values in any case.",
        "properties": {
          "amount": {
            "description": "0 or more, at most 2 decimals.",
            "type": "number"
          },
          "label": {
            "description": "Up to 255 characters.",
            "type": "string"
          },
          "payer": {
            "enum": ["store", "vendor", "customer"],
            "type": "string"
          }
        },
        "type": "object"
      },
      "WarrantyClaimCreate": {
        "properties": {
          "assigned_to_staff_id": {
            "nullable": true,
            "type": "string"
          },
          "channel": {
            "description": "Any case is accepted.",
            "enum": ["phone", "email", "in_store"],
            "type": "string"
          },
          "component_key": {
            "description": "The part that failed, a `component_key` from `GET /orders/{id}/warranty`.",
            "type": "string"
          },
          "customer_said_delivered_on": {
            "description": "YYYY-MM-DD.",
            "nullable": true,
            "type": "string"
          },
          "customer_words": {
            "description": "What the customer says. Up to 5,000 characters.",
            "type": "string"
          },
          "email_customer": {
            "description": "Send “we’ve got your claim”. Needs Email customers.",
            "type": "boolean"
          },
          "order_id": {
            "type": "string"
          },
          "problem_started_on": {
            "description": "YYYY-MM-DD.",
            "nullable": true,
            "type": "string"
          },
          "reason_id": {
            "description": "The problem: an `id` from `problem_reasons` in `GET /warranty/claims` (the store’s claim problems). Left out: none.",
            "nullable": true,
            "type": "string"
          },
          "units": {
            "description": "One to the app’s limit of units, each a line and the unit’s position on it (from 0).",
            "items": {
              "properties": {
                "order_line_item_id": {
                  "type": "string"
                },
                "unit_index": {
                  "type": "integer"
                }
              },
              "type": "object"
            },
            "type": "array"
          }
        },
        "required": [
          "order_id",
          "units",
          "component_key",
          "customer_words",
          "channel"
        ],
        "type": "object"
      },
      "WarrantyClaimCreated": {
        "properties": {
          "claim_id": {
            "type": "string"
          },
          "claim_number": {
            "type": "string"
          },
          "email_error": {
            "nullable": true,
            "type": "string"
          }
        },
        "required": ["claim_id", "claim_number"],
        "type": "object"
      },
      "WarrantyClaimDay": {
        "properties": {
          "on": {
            "description": "YYYY-MM-DD, not in the future.",
            "type": "string"
          }
        },
        "required": ["on"],
        "type": "object"
      },
      "WarrantyClaimDecided": {
        "properties": {
          "decision": {
            "enum": [
              "covered",
              "partly_covered",
              "goodwill",
              "paid_repair",
              "declined",
              null
            ],
            "nullable": true,
            "type": "string"
          },
          "email_error": {
            "description": "Why the customer’s email wasn’t sent, when it was asked for.",
            "nullable": true,
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "order_error": {
            "description": "Why the warranty order wasn’t created or updated; the decision is saved. Null when it was, or when no lines were sent.",
            "nullable": true,
            "type": "string"
          },
          "planned_fix": {
            "enum": [
              "repair_visit",
              "part",
              "replacement",
              "refund",
              "store_credit",
              "pickup",
              null
            ],
            "nullable": true,
            "type": "string"
          },
          "status": {
            "enum": [
              "new",
              "in_review",
              "approved",
              "in_progress",
              "resolved",
              "declined"
            ],
            "type": "string"
          }
        },
        "required": [
          "id",
          "status",
          "decision",
          "planned_fix",
          "email_error",
          "order_error"
        ],
        "type": "object"
      },
      "WarrantyClaimDecision": {
        "description": "Enum values in any case.",
        "properties": {
          "customer_message": {
            "description": "Declined: the message the customer gets. Up to 5,000 characters.",
            "type": "string"
          },
          "decision": {
            "enum": [
              "covered",
              "partly_covered",
              "goodwill",
              "paid_repair",
              "declined"
            ],
            "type": "string"
          },
          "decline_reason_id": {
            "description": "Required to decline: an `id` from the claim’s `decline_reasons` (`get_warranty_claim`), or from `decline_reasons` in `GET /warranty/claims`.",
            "nullable": true,
            "type": "string"
          },
          "delivery_dates": {
            "description": "Covered: the delivery date of each unit claimed with no delivery on record, `offered` (the order’s or Shopify’s) or `typed` (needs Override warranty coverage).",
            "items": {
              "properties": {
                "from": {
                  "enum": ["offered", "typed"],
                  "type": "string"
                },
                "on": {
                  "description": "YYYY-MM-DD.",
                  "type": "string"
                },
                "unit_id": {
                  "description": "A unit’s `id` from the claim.",
                  "type": "string"
                }
              },
              "required": ["unit_id", "on", "from"],
              "type": "object"
            },
            "type": "array"
          },
          "email_customer": {
            "description": "Email the customer the decision. Needs Email customers.",
            "type": "boolean"
          },
          "goodwill_amount": {
            "description": "Goodwill as an amount instead of a share. Part of the plan: saved with `planned_fix` (the claim’s own when left out).",
            "nullable": true,
            "type": "number"
          },
          "goodwill_percent": {
            "description": "Goodwill: the share the store covers, 1–100 (default 100). Part of the plan: saved with `planned_fix` (the claim’s own when left out).",
            "nullable": true,
            "type": "number"
          },
          "lines": {
            "description": "The warranty order’s lines: what is needed, what it is worth and who pays. Sent, they replace the claim’s costs and make or update its warranty order. Left out while the plan is sent, the Decide dialog’s starting lines are used (see `planned_fix`).",
            "items": {
              "properties": {
                "amount": {
                  "description": "At most 2 decimals.",
                  "type": "number"
                },
                "kind": {
                  "enum": [
                    "part",
                    "labour",
                    "shipping",
                    "other",
                    "replacement"
                  ],
                  "type": "string"
                },
                "label": {
                  "description": "Up to 255 characters.",
                  "type": "string"
                },
                "payer": {
                  "enum": ["store", "vendor", "customer"],
                  "type": "string"
                }
              },
              "required": ["kind", "label", "amount", "payer"],
              "type": "object"
            },
            "type": "array"
          },
          "note": {
            "description": "An internal note. Up to 2,000 characters.",
            "type": "string"
          },
          "pickup_first": {
            "description": "Money back or a workshop repair: the product is collected first. Part of the plan: saved with `planned_fix` (the claim’s own when left out).",
            "type": "boolean"
          },
          "planned_fix": {
            "description": "How the claim is fixed (the plan). The replacement or part to order is a `replacement` or `part` line in `lines`, which `POST /warranty/claims/{id}/goods` then orders. Sent without `lines`, the lines are the ones the claim page’s Decide starts from: the claim’s own, plus the fix’s (a `replacement` line, a `part` line named after the claimed part, or a `labour` line “Repair visit”, each at 0) paid as the decision pays; send `lines` to say otherwise.",
            "enum": [
              "repair_visit",
              "part",
              "replacement",
              "refund",
              "store_credit",
              "pickup",
              null
            ],
            "nullable": true,
            "type": "string"
          }
        },
        "required": ["decision"],
        "type": "object"
      },
      "WarrantyClaimDelivered": {
        "properties": {
          "delivered_on": {
            "description": "YYYY-MM-DD, not in the future.",
            "type": "string"
          },
          "old_unit_outcome": {
            "description": "What happens to the unit it replaced. Any case is accepted.",
            "enum": ["return_to_vendor", "dispose", "keep", null],
            "nullable": true,
            "type": "string"
          }
        },
        "required": ["delivered_on"],
        "type": "object"
      },
      "WarrantyClaimDelivery": {
        "properties": {
          "email_customer": {
            "description": "Tell the customer the day (default false). Needs Email customers.",
            "type": "boolean"
          },
          "notes": {
            "description": "Up to 5,000 characters.",
            "nullable": true,
            "type": "string"
          },
          "pick_up_old": {
            "description": "Pick up the old unit on the same trip (default false).",
            "type": "boolean"
          },
          "technician_staff_id": {
            "description": "Who takes it: an `id` from the claim’s `staff_options` (`get_warranty_claim`) that is not `suspended`.",
            "nullable": true,
            "type": "string"
          },
          "visit_on": {
            "description": "YYYY-MM-DD.",
            "type": "string"
          },
          "visit_window": {
            "description": "The time window, as the store writes it (“10:00 AM – 12:00 PM”).",
            "type": "string"
          }
        },
        "required": ["visit_on", "visit_window"],
        "type": "object"
      },
      "WarrantyClaimEdit": {
        "description": "At least one field; only the fields sent change. Enum values in any case.",
        "properties": {
          "assigned_to_staff_id": {
            "description": "Who works the claim: an `id` from the claim’s `staff_options` (`get_warranty_claim`), or null for nobody.",
            "nullable": true,
            "type": "string"
          },
          "email_customer": {
            "description": "With `status: resolved`: email “Your claim is resolved”. Needs Email customers.",
            "type": "boolean"
          },
          "status": {
            "enum": [
              "new",
              "in_review",
              "approved",
              "in_progress",
              "resolved",
              "declined"
            ],
            "type": "string"
          },
          "waiting_on": {
            "enum": [
              "nobody",
              "customer",
              "vendor",
              "part",
              "visit",
              "delivery"
            ],
            "type": "string"
          }
        },
        "type": "object"
      },
      "WarrantyClaimEdited": {
        "properties": {
          "assigned_to_staff_id": {
            "nullable": true,
            "type": "string"
          },
          "email_error": {
            "description": "Why the resolved email wasn’t sent, when it was asked for.",
            "nullable": true,
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "status": {
            "enum": [
              "new",
              "in_review",
              "approved",
              "in_progress",
              "resolved",
              "declined"
            ],
            "type": "string"
          },
          "waiting_on": {
            "enum": [
              "nobody",
              "customer",
              "vendor",
              "part",
              "visit",
              "delivery"
            ],
            "type": "string"
          }
        },
        "required": [
          "id",
          "status",
          "waiting_on",
          "assigned_to_staff_id",
          "email_error"
        ],
        "type": "object"
      },
      "WarrantyClaimEmail": {
        "properties": {
          "kind": {
            "description": "Which email (any case): `more_info` and `arrange_time` take your `message`; the rest send their standard words. `declined` is refused here: it goes with the decision.",
            "enum": [
              "received",
              "more_info",
              "approved",
              "visit_booked",
              "resolved",
              "declined",
              "delivery_booked",
              "arrange_time"
            ],
            "type": "string"
          },
          "message": {
            "description": "Your words to the customer. Up to 10,000 characters.",
            "type": "string"
          }
        },
        "required": ["kind"],
        "type": "object"
      },
      "WarrantyClaimEmailSent": {
        "properties": {
          "claim_id": {
            "type": "string"
          },
          "kind": {
            "enum": [
              "received",
              "more_info",
              "approved",
              "visit_booked",
              "resolved",
              "declined",
              "delivery_booked",
              "arrange_time"
            ],
            "type": "string"
          },
          "sent": {
            "type": "boolean"
          },
          "waiting_on": {
            "enum": [
              "nobody",
              "customer",
              "vendor",
              "part",
              "visit",
              "delivery"
            ],
            "type": "string"
          }
        },
        "required": ["claim_id", "kind", "sent", "waiting_on"],
        "type": "object"
      },
      "WarrantyClaimFileFromUrl": {
        "description": "The file sent as its address: fetched from a public https address (up to three redirects), a photo or a PDF by its bytes, up to 10 MB.",
        "properties": {
          "file_name": {
            "description": "The name to keep it under (up to 255 characters; its extension becomes the one its bytes are). Default: the address’s last part.",
            "nullable": true,
            "type": "string"
          },
          "fix_id": {
            "description": "The repair visit the photo was taken at: a fix’s `id` from the claim.",
            "nullable": true,
            "type": "string"
          },
          "url": {
            "description": "Where the file is: a public https address (up to 2,048 characters). A key fetches at most 50 files from web addresses a day, each counted before it is fetched (`403 CAP_EXCEEDED`, `reason` `daily_url_fetches`).",
            "type": "string"
          }
        },
        "required": ["url"],
        "type": "object"
      },
      "WarrantyClaimFixChanged": {
        "properties": {
          "claim_id": {
            "type": "string"
          },
          "email_error": {
            "description": "A visit: why the customer’s email wasn’t sent, when it was asked for.",
            "nullable": true,
            "type": "string"
          },
          "fix_id": {
            "nullable": true,
            "type": "string"
          },
          "minutes_spent": {
            "nullable": true,
            "type": "integer"
          },
          "notes": {
            "nullable": true,
            "type": "string"
          },
          "purchase_order_id": {
            "description": "A part: the draft purchase order it is on.",
            "nullable": true,
            "type": "string"
          },
          "status": {
            "enum": ["open", "done", "cancelled"],
            "type": "string"
          },
          "technician_staff_id": {
            "nullable": true,
            "type": "string"
          },
          "type": {
            "enum": [
              "repair_visit",
              "part",
              "replacement",
              "refund",
              "store_credit",
              "pickup"
            ],
            "type": "string"
          },
          "visit_on": {
            "description": "YYYY-MM-DD.",
            "nullable": true,
            "type": "string"
          },
          "visit_result": {
            "enum": ["fixed", "another_visit", "not_fixed", null],
            "nullable": true,
            "type": "string"
          },
          "visit_window": {
            "nullable": true,
            "type": "string"
          }
        },
        "required": ["claim_id", "fix_id"],
        "type": "object"
      },
      "WarrantyClaimFixEdit": {
        "description": "At least one field; only the fields sent change.",
        "properties": {
          "notes": {
            "description": "Up to 5,000 characters.",
            "nullable": true,
            "type": "string"
          },
          "status": {
            "enum": ["open", "done", "cancelled"],
            "type": "string"
          },
          "technician_staff_id": {
            "description": "An `id` from the claim’s `staff_options` that is not `suspended`.",
            "type": "string"
          },
          "visit_on": {
            "description": "YYYY-MM-DD.",
            "type": "string"
          },
          "visit_window": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "WarrantyClaimGoodsChanged": {
        "properties": {
          "claim_id": {
            "type": "string"
          },
          "email_error": {
            "description": "Goods damaged or wrong: why the vendor’s email wasn’t sent, when it was asked for.",
            "nullable": true,
            "type": "string"
          },
          "purchase_order_id": {
            "description": "The purchase order the goods are on; null when they came from stock.",
            "nullable": true,
            "type": "string"
          },
          "purchase_order_number": {
            "nullable": true,
            "type": "string"
          },
          "purchase_order_status": {
            "enum": [
              "draft",
              "sending",
              "sent",
              "partial",
              "partially_received",
              "received",
              "rejected",
              "completed",
              null
            ],
            "nullable": true,
            "type": "string"
          },
          "queued": {
            "description": "A send: true when the vendor’s email is queued, false when the purchase order was marked sent with no email (the vendor has no address). Null when nothing was sent.",
            "nullable": true,
            "type": "boolean"
          },
          "status": {
            "enum": [
              "new",
              "in_review",
              "approved",
              "in_progress",
              "resolved",
              "declined",
              null
            ],
            "nullable": true,
            "type": "string"
          },
          "waiting_on": {
            "enum": [
              "nobody",
              "customer",
              "vendor",
              "part",
              "visit",
              "delivery",
              null
            ],
            "nullable": true,
            "type": "string"
          },
          "warning": {
            "description": "Ordering with `send`: why the purchase order wasn’t sent (it is kept as a draft).",
            "nullable": true,
            "type": "string"
          }
        },
        "required": ["claim_id", "status", "waiting_on", "purchase_order_id"],
        "type": "object"
      },
      "WarrantyClaimGoodsOrder": {
        "properties": {
          "needed_by": {
            "description": "YYYY-MM-DD.",
            "nullable": true,
            "type": "string"
          },
          "send": {
            "description": "Send the purchase order to the vendor straight away. Needs Send and cancel purchase orders (a key: Send emails as well).",
            "type": "boolean"
          },
          "ship_to": {
            "description": "Where the goods go: the store (the only choice for now). Default store.",
            "enum": ["store"],
            "type": "string"
          }
        },
        "type": "object"
      },
      "WarrantyClaimGoodsProblem": {
        "description": "Enum values in any case.",
        "properties": {
          "email": {
            "description": "The email asking the vendor to send them again. Needs Send and cancel purchase orders (a key: Send emails as well).",
            "nullable": true,
            "properties": {
              "message": {
                "description": "Up to 10,000 characters.",
                "type": "string"
              },
              "subject": {
                "description": "Up to 300 characters.",
                "type": "string"
              },
              "to": {
                "description": "The vendor’s email address.",
                "type": "string"
              }
            },
            "required": ["to", "subject", "message"],
            "type": "object"
          },
          "note": {
            "description": "Up to 500 characters.",
            "nullable": true,
            "type": "string"
          },
          "problem": {
            "enum": ["damaged", "wrong"],
            "type": "string"
          }
        },
        "required": ["problem"],
        "type": "object"
      },
      "WarrantyClaimList": {
        "properties": {
          "counts": {
            "description": "Each tab’s count.",
            "properties": {
              "all": {
                "type": "integer"
              },
              "approved": {
                "type": "integer"
              },
              "declined": {
                "type": "integer"
              },
              "in_progress": {
                "type": "integer"
              },
              "in_review": {
                "type": "integer"
              },
              "new": {
                "type": "integer"
              },
              "resolved": {
                "type": "integer"
              },
              "waiting_vendor": {
                "type": "integer"
              }
            },
            "type": "object"
          },
          "decline_reasons": {
            "description": "The store’s decline reasons: what a decline’s `decline_reason_id` takes.",
            "items": {
              "properties": {
                "customer_message": {
                  "nullable": true,
                  "type": "string"
                },
                "id": {
                  "type": "string"
                },
                "kind": {
                  "enum": ["problem", "decline"],
                  "type": "string"
                },
                "label": {
                  "type": "string"
                },
                "position": {
                  "type": "integer"
                }
              },
              "type": "object"
            },
            "type": "array"
          },
          "items": {
            "items": {
              "properties": {
                "assigned_to": {
                  "nullable": true,
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    }
                  },
                  "type": "object"
                },
                "channel": {
                  "enum": [
                    "phone",
                    "email",
                    "in_store",
                    "online",
                    "pos",
                    "text",
                    "on_delivery"
                  ],
                  "type": "string"
                },
                "claim_number": {
                  "type": "string"
                },
                "closed_at": {
                  "format": "date-time",
                  "nullable": true,
                  "type": "string"
                },
                "customer_name": {
                  "description": "The customer’s name: “No name” for a customer with none (never their email), “No customer” for a claim with none.",
                  "type": "string"
                },
                "id": {
                  "type": "string"
                },
                "more_units": {
                  "description": "Further units on the claim beyond the one named.",
                  "type": "integer"
                },
                "next_visit_on": {
                  "description": "YYYY-MM-DD.",
                  "nullable": true,
                  "type": "string"
                },
                "order_id": {
                  "type": "string"
                },
                "order_label": {
                  "type": "string"
                },
                "part_name": {
                  "type": "string"
                },
                "product_title": {
                  "type": "string"
                },
                "reported_at": {
                  "format": "date-time",
                  "type": "string"
                },
                "status": {
                  "enum": [
                    "new",
                    "in_review",
                    "approved",
                    "in_progress",
                    "resolved",
                    "declined"
                  ],
                  "type": "string"
                },
                "updated_at": {
                  "format": "date-time",
                  "type": "string"
                },
                "vendor_asked_at": {
                  "format": "date-time",
                  "nullable": true,
                  "type": "string"
                },
                "vendor_name": {
                  "nullable": true,
                  "type": "string"
                },
                "vendor_reminded_at": {
                  "format": "date-time",
                  "nullable": true,
                  "type": "string"
                },
                "waiting_on": {
                  "enum": [
                    "nobody",
                    "customer",
                    "vendor",
                    "part",
                    "visit",
                    "delivery"
                  ],
                  "type": "string"
                },
                "waiting_purchase_order_label": {
                  "nullable": true,
                  "type": "string"
                }
              },
              "required": [
                "id",
                "claim_number",
                "status",
                "waiting_on",
                "channel",
                "order_id",
                "reported_at",
                "updated_at"
              ],
              "type": "object"
            },
            "type": "array"
          },
          "next_cursor": {
            "description": "Opaque: pass it back as `cursor` for the next page; null on the last page. `page` is accepted instead.",
            "nullable": true,
            "type": "string"
          },
          "page": {
            "type": "integer"
          },
          "page_size": {
            "type": "integer"
          },
          "problem_reasons": {
            "description": "The store’s claim problems (Settings › Warranty › Claims), in its order: what `reason_id` takes when starting a claim, and the warranty claims import’s Reason column by `label`.",
            "items": {
              "properties": {
                "customer_message": {
                  "nullable": true,
                  "type": "string"
                },
                "id": {
                  "type": "string"
                },
                "kind": {
                  "enum": ["problem", "decline"],
                  "type": "string"
                },
                "label": {
                  "type": "string"
                },
                "position": {
                  "type": "integer"
                }
              },
              "type": "object"
            },
            "type": "array"
          },
          "staff_options": {
            "description": "Who a claim can be assigned to; the ones not `suspended` are also who a repair visit can be booked with (`technician_staff_id`).",
            "items": {
              "properties": {
                "id": {
                  "type": "string"
                },
                "name": {
                  "type": "string"
                },
                "suspended": {
                  "type": "boolean"
                }
              },
              "type": "object"
            },
            "type": "array"
          },
          "total": {
            "description": "Claims in the tab or filter.",
            "type": "integer"
          },
          "vendor_options": {
            "description": "The `vendor_id` filter’s values.",
            "items": {
              "properties": {
                "id": {
                  "type": "string"
                },
                "name": {
                  "type": "string"
                }
              },
              "type": "object"
            },
            "type": "array"
          }
        },
        "required": [
          "items",
          "next_cursor",
          "counts",
          "page",
          "page_size",
          "total"
        ],
        "type": "object"
      },
      "WarrantyClaimMoneyBack": {
        "properties": {
          "amount": {
            "description": "What was given, in the order’s currency: more than 0, at most 2 decimals.",
            "type": "number"
          },
          "external_ref": {
            "description": "Shopify’s reference for it (the refund or gift card). Up to 200 characters.",
            "type": "string"
          },
          "notes": {
            "description": "Up to 2,000 characters.",
            "type": "string"
          },
          "type": {
            "description": "Any case is accepted.",
            "enum": ["refund", "store_credit"],
            "type": "string"
          }
        },
        "required": ["type", "amount"],
        "type": "object"
      },
      "WarrantyClaimNote": {
        "properties": {
          "body": {
            "description": "Up to 5,000 characters.",
            "type": "string"
          }
        },
        "required": ["body"],
        "type": "object"
      },
      "WarrantyClaimNoteAdded": {
        "properties": {
          "added": {
            "type": "boolean"
          },
          "body": {
            "type": "string"
          },
          "claim_id": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "WarrantyClaimOrderLinked": {
        "properties": {
          "claim_id": {
            "type": "string"
          },
          "is_quote": {
            "nullable": true,
            "type": "boolean"
          },
          "order_id": {
            "description": "The warranty or repair order’s `id` (`get_order`, or `get_quote` for a quote).",
            "nullable": true,
            "type": "string"
          }
        },
        "required": ["claim_id", "order_id"],
        "type": "object"
      },
      "WarrantyClaimPart": {
        "properties": {
          "cost": {
            "description": "Unit cost; above 0 needs Enter costs and charges (a key: Enter and correct costs). Default 0.",
            "type": "number"
          },
          "quantity": {
            "description": "1 to 1,000 (default 1).",
            "type": "integer"
          },
          "ship_to": {
            "enum": ["store", "customer"],
            "type": "string"
          },
          "title": {
            "description": "The part’s name. Up to 255 characters.",
            "type": "string"
          },
          "vendor_sku": {
            "description": "The vendor’s SKU. Up to 100 characters.",
            "type": "string"
          }
        },
        "required": ["title", "ship_to"],
        "type": "object"
      },
      "WarrantyClaimPickup": {
        "properties": {
          "notes": {
            "description": "Up to 5,000 characters.",
            "nullable": true,
            "type": "string"
          },
          "technician_staff_id": {
            "description": "Who collects it: an `id` from the claim’s `staff_options` (`get_warranty_claim`) that is not `suspended`.",
            "nullable": true,
            "type": "string"
          },
          "visit_on": {
            "description": "YYYY-MM-DD.",
            "type": "string"
          },
          "visit_window": {
            "description": "The time window, as the store writes it (“10:00 AM – 12:00 PM”).",
            "type": "string"
          }
        },
        "required": ["visit_on", "visit_window"],
        "type": "object"
      },
      "WarrantyClaimPlanAdopted": {
        "properties": {
          "id": {
            "type": "string"
          },
          "planned_fix": {
            "enum": [
              "repair_visit",
              "part",
              "replacement",
              "refund",
              "store_credit",
              "pickup",
              null
            ],
            "nullable": true,
            "type": "string"
          },
          "status": {
            "enum": [
              "new",
              "in_review",
              "approved",
              "in_progress",
              "resolved",
              "declined"
            ],
            "type": "string"
          }
        },
        "required": ["id", "status", "planned_fix"],
        "type": "object"
      },
      "WarrantyClaimQuoteSignatureRequested": {
        "properties": {
          "claim_id": {
            "type": "string"
          },
          "order_id": {
            "description": "The warranty quote’s `id`.",
            "type": "string"
          },
          "sent": {
            "type": "boolean"
          }
        },
        "required": ["claim_id", "order_id", "sent"],
        "type": "object"
      },
      "WarrantyClaimQuoteSigned": {
        "properties": {
          "consent": {
            "description": "true: the store has the customer’s signed copy. Nothing is recorded without it.",
            "type": "boolean"
          },
          "how": {
            "description": "A printed copy, another e-sign app, or another way. Any case is accepted.",
            "enum": ["printed", "other_app", "other"],
            "type": "string"
          },
          "note": {
            "description": "Up to 500 characters.",
            "nullable": true,
            "type": "string"
          },
          "signed_by": {
            "description": "Who signed it. Up to 120 characters.",
            "type": "string"
          },
          "signed_on": {
            "description": "YYYY-MM-DD, the day it was signed (not after today in the store’s time zone).",
            "type": "string"
          }
        },
        "required": ["signed_by", "signed_on", "how", "consent"],
        "type": "object"
      },
      "WarrantyClaimQuoteSignedRecorded": {
        "properties": {
          "claim_id": {
            "type": "string"
          },
          "order_id": {
            "description": "The warranty quote’s `id`.",
            "type": "string"
          },
          "signed": {
            "type": "boolean"
          }
        },
        "required": ["claim_id", "order_id", "signed"],
        "type": "object"
      },
      "WarrantyClaimReasonAdd": {
        "properties": {
          "customer_message": {
            "description": "A decline reason’s message to the customer (up to 5,000 characters), with placeholders such as `{{customerFirstName}}`. Ignored for a problem.",
            "nullable": true,
            "type": "string"
          },
          "kind": {
            "description": "`problem` (what went wrong) or `decline` (why a claim is declined).",
            "enum": ["problem", "decline"],
            "type": "string"
          },
          "label": {
            "description": "Up to 120 characters.",
            "type": "string"
          }
        },
        "required": ["kind", "label"],
        "type": "object"
      },
      "WarrantyClaimReasonEdit": {
        "description": "Only the fields to change.",
        "properties": {
          "customer_message": {
            "description": "A decline reason’s message; null clears it. Ignored for a problem.",
            "nullable": true,
            "type": "string"
          },
          "label": {
            "description": "Up to 120 characters.",
            "type": "string"
          }
        },
        "type": "object"
      },
      "WarrantyClaimReasonMove": {
        "properties": {
          "direction": {
            "enum": ["up", "down"],
            "type": "string"
          }
        },
        "required": ["direction"],
        "type": "object"
      },
      "WarrantyClaimReopened": {
        "properties": {
          "id": {
            "type": "string"
          },
          "status": {
            "enum": [
              "new",
              "in_review",
              "approved",
              "in_progress",
              "resolved",
              "declined"
            ],
            "type": "string"
          },
          "waiting_on": {
            "enum": [
              "nobody",
              "customer",
              "vendor",
              "part",
              "visit",
              "delivery"
            ],
            "type": "string"
          }
        },
        "required": ["id", "status", "waiting_on"],
        "type": "object"
      },
      "WarrantyClaimRepairOrder": {
        "properties": {
          "order_id": {
            "description": "The repair quote’s or order’s `id`, for the claim’s customer.",
            "type": "string"
          }
        },
        "required": ["order_id"],
        "type": "object"
      },
      "WarrantyClaimReplacement": {
        "properties": {
          "unit_ids": {
            "description": "The claim’s units to replace (their `id` from the claim), each with one new unit. Left out: every unit on the claim.",
            "items": {
              "type": "string"
            },
            "type": "array"
          }
        },
        "type": "object"
      },
      "WarrantyClaimReport": {
        "properties": {
          "channel": {
            "enum": [
              "phone",
              "email",
              "in_store",
              "online",
              "pos",
              "text",
              "on_delivery"
            ],
            "type": "string"
          },
          "customer_words": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "problem_started_on": {
            "description": "YYYY-MM-DD.",
            "nullable": true,
            "type": "string"
          },
          "reason_id": {
            "nullable": true,
            "type": "string"
          },
          "reason_label": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "customer_words",
          "reason_id",
          "reason_label",
          "problem_started_on",
          "channel"
        ],
        "type": "object"
      },
      "WarrantyClaimReportEdit": {
        "description": "At least one field; only the fields sent change. Enum values in any case.",
        "properties": {
          "channel": {
            "enum": [
              "phone",
              "email",
              "in_store",
              "online",
              "pos",
              "text",
              "on_delivery"
            ],
            "type": "string"
          },
          "customer_words": {
            "description": "What the customer says. Up to 5,000 characters.",
            "type": "string"
          },
          "problem_started_on": {
            "description": "YYYY-MM-DD, or null.",
            "nullable": true,
            "type": "string"
          },
          "reason_id": {
            "description": "One of the store’s claim reasons, or null for none.",
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "WarrantyClaimSettings": {
        "description": "Settings › Products › Claims.",
        "properties": {
          "auto_emails": {
            "description": "The claim emails whose “Email the customer” box starts ticked.",
            "items": {
              "enum": [
                "received",
                "more_info",
                "approved",
                "visit_booked",
                "resolved",
                "declined",
                "delivery_booked",
                "arrange_time"
              ],
              "type": "string"
            },
            "type": "array"
          },
          "decline_reasons": {
            "description": "Why a claim is declined, in their order.",
            "items": {
              "properties": {
                "customer_message": {
                  "description": "What the customer is sent when a claim is declined for this reason, with `{{customerFirstName}}`-style placeholders filled in on the claim.",
                  "nullable": true,
                  "type": "string"
                },
                "id": {
                  "type": "string"
                },
                "label": {
                  "type": "string"
                },
                "position": {
                  "type": "integer"
                }
              },
              "required": ["id", "label", "customer_message", "position"],
              "type": "object"
            },
            "type": "array"
          },
          "job_sheet": {
            "description": "What a printed job sheet includes.",
            "properties": {
              "completion": {
                "description": "Print the section the technician fills in.",
                "type": "boolean"
              },
              "sheet_text": {
                "description": "The store’s own text at the bottom of every sheet (up to 2,000 characters); empty for none.",
                "type": "string"
              },
              "show_amount": {
                "description": "Print “To collect”, what the customer still owes (never for staff without View costs).",
                "type": "boolean"
              },
              "show_photos": {
                "type": "boolean"
              }
            },
            "required": [
              "show_amount",
              "show_photos",
              "completion",
              "sheet_text"
            ],
            "type": "object"
          },
          "labour_hourly_rate": {
            "description": "An hour of a repair visit, in the store’s currency, for pricing labour; null when not set.",
            "nullable": true,
            "type": "number"
          },
          "next_number": {
            "description": "The next claim’s number; never under one a claim already holds.",
            "type": "integer"
          },
          "paid_repair_deposit_percent": {
            "description": "The deposit a paid repair asks for, in percent (1–100).",
            "type": "number"
          },
          "paid_repair_start": {
            "description": "When a paid repair starts: once its quote is `signed`, or once the deposit is paid (`deposit_paid`).",
            "enum": ["signed", "deposit_paid"],
            "type": "string"
          },
          "prefix": {
            "description": "The claim number’s prefix (up to 12 letters, numbers and `- _ # /`).",
            "type": "string"
          },
          "problem_reasons": {
            "description": "What a customer can say went wrong, in their order.",
            "items": {
              "properties": {
                "id": {
                  "type": "string"
                },
                "label": {
                  "type": "string"
                },
                "position": {
                  "type": "integer"
                }
              },
              "required": ["id", "label", "position"],
              "type": "object"
            },
            "type": "array"
          },
          "replacement_cover": {
            "description": "How long a replacement unit is covered: `keep_end_date` (the original’s end date), `keep_end_date_min_days` (that, but at least `replacement_min_days` from its delivery) or `fresh_term` (a fresh term from its delivery).",
            "enum": ["keep_end_date", "keep_end_date_min_days", "fresh_term"],
            "type": "string"
          },
          "replacement_min_days": {
            "description": "With `keep_end_date_min_days`: the fewest days a replacement is covered (1–3650).",
            "type": "integer"
          }
        },
        "required": [
          "prefix",
          "next_number",
          "replacement_cover",
          "replacement_min_days",
          "auto_emails",
          "paid_repair_start",
          "paid_repair_deposit_percent",
          "labour_hourly_rate",
          "job_sheet",
          "problem_reasons",
          "decline_reasons"
        ],
        "type": "object"
      },
      "WarrantyClaimSettingsEdit": {
        "description": "Only the fields to change.",
        "properties": {
          "auto_emails": {
            "description": "The claim emails whose “Email the customer” box starts ticked.",
            "items": {
              "enum": [
                "received",
                "more_info",
                "approved",
                "visit_booked",
                "resolved",
                "declined",
                "delivery_booked",
                "arrange_time"
              ],
              "type": "string"
            },
            "type": "array"
          },
          "job_sheet": {
            "description": "Only the parts to change.",
            "properties": {
              "completion": {
                "description": "Print the section the technician fills in.",
                "type": "boolean"
              },
              "sheet_text": {
                "description": "The store’s own text at the bottom of every sheet (up to 2,000 characters); empty for none.",
                "type": "string"
              },
              "show_amount": {
                "description": "Print “To collect”, what the customer still owes (never for staff without View costs).",
                "type": "boolean"
              },
              "show_photos": {
                "type": "boolean"
              }
            },
            "type": "object"
          },
          "labour_hourly_rate": {
            "description": "An hour of a repair visit, in the store’s currency, for pricing labour; null when not set.",
            "nullable": true,
            "type": "number"
          },
          "next_number": {
            "description": "The next claim’s number; never under one a claim already holds.",
            "type": "integer"
          },
          "paid_repair_deposit_percent": {
            "description": "The deposit a paid repair asks for, in percent (1–100).",
            "type": "number"
          },
          "paid_repair_start": {
            "description": "When a paid repair starts: once its quote is `signed`, or once the deposit is paid (`deposit_paid`).",
            "enum": ["signed", "deposit_paid"],
            "type": "string"
          },
          "prefix": {
            "description": "The claim number’s prefix (up to 12 letters, numbers and `- _ # /`).",
            "type": "string"
          },
          "replacement_cover": {
            "description": "How long a replacement unit is covered: `keep_end_date` (the original’s end date), `keep_end_date_min_days` (that, but at least `replacement_min_days` from its delivery) or `fresh_term` (a fresh term from its delivery).",
            "enum": ["keep_end_date", "keep_end_date_min_days", "fresh_term"],
            "type": "string"
          },
          "replacement_min_days": {
            "description": "With `keep_end_date_min_days`: the fewest days a replacement is covered (1–3650).",
            "type": "integer"
          }
        },
        "type": "object"
      },
      "WarrantyClaimStatus": {
        "properties": {
          "status": {
            "enum": [
              "new",
              "in_review",
              "approved",
              "in_progress",
              "resolved",
              "declined"
            ],
            "type": "string"
          }
        },
        "required": ["status"],
        "type": "object"
      },
      "WarrantyClaimStatusChanged": {
        "properties": {
          "changed": {
            "type": "boolean"
          },
          "id": {
            "type": "string"
          },
          "status": {
            "enum": [
              "new",
              "in_review",
              "approved",
              "in_progress",
              "resolved",
              "declined"
            ],
            "type": "string"
          }
        },
        "required": ["id", "status", "changed"],
        "type": "object"
      },
      "WarrantyClaimStepChanged": {
        "properties": {
          "claim_id": {
            "type": "string"
          },
          "claim_status": {
            "enum": [
              "new",
              "in_review",
              "approved",
              "in_progress",
              "resolved",
              "declined"
            ],
            "type": "string"
          },
          "coverage_error": {
            "description": "Delivered: why the new units’ cover didn’t start (start it from the order’s Warranty panel). The delivery is recorded either way.",
            "nullable": true,
            "type": "string"
          },
          "email_error": {
            "description": "A delivery: why the customer’s email wasn’t sent, when it was asked for.",
            "nullable": true,
            "type": "string"
          },
          "fix": {
            "description": "The step’s fix on the claim, as it is now.",
            "nullable": true,
            "properties": {
              "amount": {
                "description": "Money back: what was given, in the order’s currency.",
                "nullable": true,
                "type": "number"
              },
              "cancelled_at": {
                "format": "date-time",
                "nullable": true,
                "type": "string"
              },
              "done_at": {
                "format": "date-time",
                "nullable": true,
                "type": "string"
              },
              "external_ref": {
                "nullable": true,
                "type": "string"
              },
              "id": {
                "type": "string"
              },
              "notes": {
                "nullable": true,
                "type": "string"
              },
              "old_unit_outcome": {
                "enum": ["return_to_vendor", "dispose", "keep", null],
                "nullable": true,
                "type": "string"
              },
              "picked_up_on": {
                "description": "A pickup: the day it was collected.",
                "nullable": true,
                "type": "string"
              },
              "replacement_order_id": {
                "description": "A replacement: its $0 order’s `id`.",
                "nullable": true,
                "type": "string"
              },
              "returned_on": {
                "description": "A pickup: the day it was brought back.",
                "nullable": true,
                "type": "string"
              },
              "status": {
                "enum": ["open", "done", "cancelled"],
                "type": "string"
              },
              "technician_staff_id": {
                "nullable": true,
                "type": "string"
              },
              "title": {
                "type": "string"
              },
              "type": {
                "enum": [
                  "repair_visit",
                  "part",
                  "replacement",
                  "refund",
                  "store_credit",
                  "pickup"
                ],
                "type": "string"
              },
              "visit_on": {
                "description": "The booked day, YYYY-MM-DD.",
                "nullable": true,
                "type": "string"
              },
              "visit_window": {
                "nullable": true,
                "type": "string"
              }
            },
            "type": "object"
          },
          "waiting_on": {
            "enum": [
              "nobody",
              "customer",
              "vendor",
              "part",
              "visit",
              "delivery"
            ],
            "type": "string"
          }
        },
        "required": ["claim_id", "claim_status", "waiting_on", "fix"],
        "type": "object"
      },
      "WarrantyClaimStoreCredit": {
        "properties": {
          "amount": {
            "description": "The credit, in the order’s currency: more than 0 and at most 1,000,000, at most 2 decimals.",
            "type": "number"
          },
          "expires_on": {
            "description": "YYYY-MM-DD after today, or null (the default) for credit that never expires.",
            "nullable": true,
            "type": "string"
          },
          "notes": {
            "description": "Up to 2,000 characters.",
            "type": "string"
          },
          "notify_customer": {
            "description": "Shopify emails the customer about the credit (default true).",
            "type": "boolean"
          }
        },
        "required": ["amount"],
        "type": "object"
      },
      "WarrantyClaimUnits": {
        "properties": {
          "id": {
            "type": "string"
          },
          "units": {
            "items": {
              "properties": {
                "id": {
                  "type": "string"
                },
                "line_title": {
                  "type": "string"
                },
                "order_line_item_id": {
                  "nullable": true,
                  "type": "string"
                },
                "serial_number": {
                  "nullable": true,
                  "type": "string"
                },
                "unit_index": {
                  "type": "integer"
                },
                "verdict": {
                  "description": "The unit’s cover when it was read.",
                  "type": "string"
                }
              },
              "type": "object"
            },
            "type": "array"
          }
        },
        "required": ["id", "units"],
        "type": "object"
      },
      "WarrantyClaimUnitsEdit": {
        "properties": {
          "units": {
            "description": "One to 50 units, each a line and the unit’s position on it (from 0).",
            "items": {
              "properties": {
                "order_line_item_id": {
                  "type": "string"
                },
                "unit_index": {
                  "type": "integer"
                }
              },
              "required": ["order_line_item_id", "unit_index"],
              "type": "object"
            },
            "type": "array"
          }
        },
        "required": ["units"],
        "type": "object"
      },
      "WarrantyClaimVendorAnswer": {
        "description": "Enum values in any case.",
        "properties": {
          "answer": {
            "enum": ["approved", "approved_in_part", "denied"],
            "type": "string"
          },
          "answer_action": {
            "description": "What they will do. Required unless the answer is denied (then nothing).",
            "enum": ["send_replacement", "send_part", "pay_back", "nothing"],
            "type": "string"
          },
          "note": {
            "description": "Up to 2,000 characters.",
            "nullable": true,
            "type": "string"
          },
          "reference": {
            "description": "Their reference (RMA number). Up to 200 characters.",
            "nullable": true,
            "type": "string"
          }
        },
        "required": ["answer"],
        "type": "object"
      },
      "WarrantyClaimVendorAskChanged": {
        "properties": {
          "claim_id": {
            "type": "string"
          },
          "vendor_ask": {
            "description": "Asking the vendor before deciding, as `get_warranty_claim` shows it.",
            "nullable": true,
            "properties": {
              "answer": {
                "enum": ["approved", "approved_in_part", "denied", null],
                "nullable": true,
                "type": "string"
              },
              "answer_action": {
                "enum": [
                  "send_replacement",
                  "send_part",
                  "pay_back",
                  "nothing",
                  null
                ],
                "nullable": true,
                "type": "string"
              },
              "answer_note": {
                "nullable": true,
                "type": "string"
              },
              "answer_recorded_by_name": {
                "nullable": true,
                "type": "string"
              },
              "answered_at": {
                "format": "date-time",
                "nullable": true,
                "type": "string"
              },
              "message": {
                "description": "The message as sent.",
                "nullable": true,
                "type": "string"
              },
              "reference": {
                "nullable": true,
                "type": "string"
              },
              "reminded_at": {
                "format": "date-time",
                "nullable": true,
                "type": "string"
              },
              "sent_at": {
                "format": "date-time",
                "nullable": true,
                "type": "string"
              },
              "sent_to": {
                "nullable": true,
                "type": "string"
              },
              "skip_reason": {
                "nullable": true,
                "type": "string"
              },
              "skipped_at": {
                "format": "date-time",
                "nullable": true,
                "type": "string"
              },
              "skipped_by_name": {
                "nullable": true,
                "type": "string"
              },
              "status": {
                "enum": ["asked", "answered", "skipped"],
                "type": "string"
              },
              "vendor_name": {
                "type": "string"
              }
            },
            "type": "object"
          },
          "waiting_on": {
            "enum": [
              "nobody",
              "customer",
              "vendor",
              "part",
              "visit",
              "delivery",
              null
            ],
            "nullable": true,
            "type": "string"
          }
        },
        "required": ["claim_id", "waiting_on", "vendor_ask"],
        "type": "object"
      },
      "WarrantyClaimVendorAskSkip": {
        "properties": {
          "reason": {
            "description": "Why the vendor isn’t asked. Up to 500 characters.",
            "nullable": true,
            "type": "string"
          }
        },
        "type": "object"
      },
      "WarrantyClaimVendorClaimAsked": {
        "properties": {
          "on": {
            "description": "YYYY-MM-DD.",
            "type": "string"
          },
          "reference": {
            "description": "Their reference. Up to 200 characters.",
            "nullable": true,
            "type": "string"
          },
          "via": {
            "description": "How they were asked (“their warranty portal”). Up to 200 characters.",
            "type": "string"
          }
        },
        "required": ["via", "on"],
        "type": "object"
      },
      "WarrantyClaimVendorClaimChanged": {
        "properties": {
          "claim_id": {
            "type": "string"
          },
          "vendor_claim": {
            "description": "Getting paid back by the vendor, as `get_warranty_claim` shows it.",
            "nullable": true,
            "properties": {
              "amount_asked": {
                "type": "number"
              },
              "amount_credited": {
                "type": "number"
              },
              "answered_at": {
                "format": "date-time",
                "nullable": true,
                "type": "string"
              },
              "asked_via": {
                "nullable": true,
                "type": "string"
              },
              "credited_at": {
                "format": "date-time",
                "nullable": true,
                "type": "string"
              },
              "credited_via": {
                "nullable": true,
                "type": "string"
              },
              "note": {
                "nullable": true,
                "type": "string"
              },
              "reference": {
                "nullable": true,
                "type": "string"
              },
              "sent_at": {
                "format": "date-time",
                "nullable": true,
                "type": "string"
              },
              "sent_to": {
                "nullable": true,
                "type": "string"
              },
              "shortfall_kept_at": {
                "format": "date-time",
                "nullable": true,
                "type": "string"
              },
              "status": {
                "enum": ["not_sent", "sent", "approved", "credited", "denied"],
                "type": "string"
              },
              "vendor_id": {
                "nullable": true,
                "type": "string"
              },
              "vendor_name": {
                "type": "string"
              }
            },
            "type": "object"
          }
        },
        "required": ["claim_id", "vendor_claim"],
        "type": "object"
      },
      "WarrantyClaimVendorClaimSave": {
        "description": "At least one field; only the fields sent change. Enum values in any case.",
        "properties": {
          "amount_credited": {
            "description": "What they paid back, 0 or more with at most 2 decimals. Needs Enter costs and charges (a key: Enter and correct costs).",
            "type": "number"
          },
          "credited_via": {
            "description": "How they paid it back (“credit on their next invoice”). Up to 200 characters.",
            "nullable": true,
            "type": "string"
          },
          "keep_shortfall": {
            "description": "True: they credited less than asked and the store keeps the rest (no more asking). Needs Enter costs and charges (a key: Enter and correct costs).",
            "type": "boolean"
          },
          "note": {
            "description": "Up to 2,000 characters.",
            "nullable": true,
            "type": "string"
          },
          "reference": {
            "description": "The vendor’s reference (their RMA number). Up to 200 characters.",
            "nullable": true,
            "type": "string"
          },
          "status": {
            "description": "What the vendor answered.",
            "enum": ["approved", "credited", "denied"],
            "type": "string"
          }
        },
        "type": "object"
      },
      "WarrantyClaimVendorEmail": {
        "properties": {
          "message": {
            "description": "Up to 10,000 characters.",
            "type": "string"
          },
          "reminder": {
            "description": "A reminder of an earlier email. Default false.",
            "type": "boolean"
          },
          "subject": {
            "description": "Up to 300 characters.",
            "type": "string"
          },
          "to": {
            "description": "The vendor’s email address.",
            "type": "string"
          }
        },
        "required": ["to", "subject", "message"],
        "type": "object"
      },
      "WarrantyClaimVendorEmailed": {
        "properties": {
          "claim_id": {
            "type": "string"
          },
          "sent": {
            "description": "True: the email is queued.",
            "type": "boolean"
          },
          "to": {
            "type": "string"
          }
        },
        "required": ["claim_id", "to", "sent"],
        "type": "object"
      },
      "WarrantyClaimVendorStepEmail": {
        "description": "Enum values in any case.",
        "properties": {
          "message": {
            "description": "Up to 10,000 characters.",
            "type": "string"
          },
          "purpose": {
            "description": "What the email is for: `collect_old_unit` (the old unit is ready to collect).",
            "enum": ["collect_old_unit"],
            "type": "string"
          },
          "subject": {
            "description": "Up to 300 characters.",
            "type": "string"
          },
          "to": {
            "description": "The vendor’s email address.",
            "type": "string"
          }
        },
        "required": ["purpose", "to", "subject", "message"],
        "type": "object"
      },
      "WarrantyClaimVisit": {
        "properties": {
          "email_customer": {
            "description": "Tell the customer (not for a workshop repair). Needs Email customers.",
            "type": "boolean"
          },
          "notes": {
            "description": "Up to 5,000 characters.",
            "type": "string"
          },
          "technician_staff_id": {
            "description": "Who does the repair: an `id` from the claim’s `staff_options` (`get_warranty_claim`) that is not `suspended`, as the claim page offers them.",
            "type": "string"
          },
          "visit_on": {
            "description": "YYYY-MM-DD.",
            "type": "string"
          },
          "visit_window": {
            "description": "The time window, as the store writes it (“10:00 AM – 12:00 PM”).",
            "type": "string"
          }
        },
        "required": ["visit_on", "visit_window", "technician_staff_id"],
        "type": "object"
      },
      "WarrantyClaimVisitResult": {
        "properties": {
          "minutes_spent": {
            "description": "0 to 10,000.",
            "nullable": true,
            "type": "integer"
          },
          "notes": {
            "description": "Up to 5,000 characters.",
            "nullable": true,
            "type": "string"
          },
          "result": {
            "enum": ["fixed", "another_visit", "not_fixed"],
            "type": "string"
          }
        },
        "required": ["result"],
        "type": "object"
      },
      "WarrantyCoverStart": {
        "properties": {
          "delivered_on": {
            "description": "The day they arrived, YYYY-MM-DD (UTC calendar day).",
            "format": "date",
            "type": "string"
          },
          "lines": {
            "description": "1–250 lines, each once.",
            "items": {
              "properties": {
                "order_line_item_id": {
                  "description": "A line’s `order_line_item_id` from `GET /warranty/coverage`.",
                  "type": "string"
                },
                "quantity": {
                  "description": "How many of its units arrived (1–100000). Left out: the whole line.",
                  "type": "integer"
                }
              },
              "required": ["order_line_item_id"],
              "type": "object"
            },
            "type": "array"
          },
          "order_id": {
            "description": "The order’s `id` (from `GET /warranty/coverage`, `GET /orders` or `search`). Only an order the caller may change.",
            "type": "string"
          }
        },
        "required": ["order_id", "lines", "delivered_on"],
        "type": "object"
      },
      "WarrantyCoverStarted": {
        "properties": {
          "already_covered": {
            "description": "Units that were covered already.",
            "type": "integer"
          },
          "delivered_on": {
            "format": "date",
            "type": "string"
          },
          "order_id": {
            "type": "string"
          },
          "units_recorded": {
            "description": "Units whose cover started now.",
            "type": "integer"
          }
        },
        "required": [
          "order_id",
          "delivered_on",
          "units_recorded",
          "already_covered"
        ],
        "type": "object"
      },
      "WarrantyCoverage": {
        "properties": {
          "lines": {
            "description": "Order lines, newest order first.",
            "items": {
              "properties": {
                "claim_blocked_reason": {
                  "description": "Why a claim can’t be started on this order (its store isn’t billed); null when one can.",
                  "nullable": true,
                  "type": "string"
                },
                "has_no_record": {
                  "description": "The line has no warranty record at all (nothing to show).",
                  "type": "boolean"
                },
                "image": {
                  "nullable": true,
                  "type": "string"
                },
                "order": {
                  "properties": {
                    "customer": {
                      "nullable": true,
                      "properties": {
                        "email": {
                          "description": "Only for a caller who may read customers (a key: Read customers), as `GET /orders` gives it.",
                          "nullable": true,
                          "type": "string"
                        },
                        "name": {
                          "nullable": true,
                          "type": "string"
                        }
                      },
                      "type": "object"
                    },
                    "id": {
                      "type": "string"
                    },
                    "number": {
                      "description": "As every list names it (“#1185”).",
                      "type": "string"
                    }
                  },
                  "type": "object"
                },
                "order_line_item_id": {
                  "type": "string"
                },
                "plans": {
                  "items": {
                    "properties": {
                      "covered_component_names": {
                        "items": {
                          "type": "string"
                        },
                        "type": "array"
                      },
                      "covers_whole_product": {
                        "type": "boolean"
                      },
                      "months": {
                        "type": "integer"
                      },
                      "name": {
                        "type": "string"
                      },
                      "plan_key": {
                        "type": "string"
                      }
                    },
                    "type": "object"
                  },
                  "type": "array"
                },
                "quantity": {
                  "type": "integer"
                },
                "serial_required": {
                  "type": "boolean"
                },
                "serial_tracked": {
                  "description": "It requires serials or has one.",
                  "type": "boolean"
                },
                "title": {
                  "type": "string"
                },
                "units": {
                  "items": {
                    "properties": {
                      "components": {
                        "items": {
                          "properties": {
                            "component_key": {
                              "description": "What a claim’s `component_key` takes.",
                              "type": "string"
                            },
                            "expires_at": {
                              "format": "date-time",
                              "nullable": true,
                              "type": "string"
                            },
                            "extended_months": {
                              "description": "Months a plan adds.",
                              "type": "integer"
                            },
                            "headline": {
                              "description": "“Covered until Mar 14, 2028”, “Starts at delivery”.",
                              "type": "string"
                            },
                            "months": {
                              "description": "Null: not covered; 0: excluded.",
                              "nullable": true,
                              "type": "integer"
                            },
                            "name": {
                              "type": "string"
                            },
                            "option_label": {
                              "nullable": true,
                              "type": "string"
                            },
                            "option_value_label": {
                              "nullable": true,
                              "type": "string"
                            },
                            "source": {
                              "description": "Where the term came from.",
                              "enum": [
                                "store_policy",
                                "vendor_policy",
                                "category_policy",
                                "category_vendor_policy",
                                "template",
                                "product",
                                "line",
                                null
                              ],
                              "nullable": true,
                              "type": "string"
                            },
                            "source_label": {
                              "type": "string"
                            },
                            "state": {
                              "enum": [
                                "not_covered",
                                "excluded",
                                "not_started",
                                "covered",
                                "expired",
                                "stopped"
                              ],
                              "type": "string"
                            },
                            "status_text": {
                              "description": "“17 months left”, “Ended 8 months ago”.",
                              "type": "string"
                            },
                            "term_text": {
                              "description": "“3 years”, “Not covered”, “Excluded”.",
                              "type": "string"
                            }
                          },
                          "type": "object"
                        },
                        "type": "array"
                      },
                      "delivered_at": {
                        "format": "date-time",
                        "nullable": true,
                        "type": "string"
                      },
                      "delivery": {
                        "description": "Whether it reached the customer: `delivered` (its cover runs), `not_shipped` (Shopify hasn’t fulfilled it), `delivery_cancelled` (a delivery was recorded, then voided) or `not_recorded` (fulfilled, or nothing says otherwise, but no delivery on record: a claim can still be taken).",
                        "enum": [
                          "delivered",
                          "not_shipped",
                          "delivery_cancelled",
                          "not_recorded"
                        ],
                        "type": "string"
                      },
                      "delivery_cancelled_at": {
                        "format": "date-time",
                        "nullable": true,
                        "type": "string"
                      },
                      "goodwill_ends_on": {
                        "format": "date",
                        "nullable": true,
                        "type": "string"
                      },
                      "open_claims": {
                        "description": "Null without View warranty claims (a key: Read warranty claims).",
                        "items": {
                          "properties": {
                            "id": {
                              "type": "string"
                            },
                            "number": {
                              "type": "string"
                            },
                            "status": {
                              "enum": [
                                "new",
                                "in_review",
                                "approved",
                                "in_progress",
                                "resolved",
                                "declined"
                              ],
                              "type": "string"
                            },
                            "waiting_on": {
                              "enum": [
                                "nobody",
                                "customer",
                                "vendor",
                                "part",
                                "visit",
                                "delivery"
                              ],
                              "type": "string"
                            }
                          },
                          "type": "object"
                        },
                        "nullable": true,
                        "type": "array"
                      },
                      "replaced_started_on": {
                        "description": "A replacement: its terms run from the replaced unit’s delivery.",
                        "format": "date",
                        "nullable": true,
                        "type": "string"
                      },
                      "return_undoable": {
                        "description": "Marked returned by hand and nothing has accounted for it since: `POST /warranty/units/returned` with `returned: false` covers it again.",
                        "type": "boolean"
                      },
                      "serial": {
                        "nullable": true,
                        "type": "string"
                      },
                      "serial_state": {
                        "description": "On a line that takes serials.",
                        "enum": [
                          "delivered",
                          "in_transit",
                          "not_fulfilled",
                          null
                        ],
                        "nullable": true,
                        "type": "string"
                      },
                      "stop_reason": {
                        "description": "Why its cover stopped early.",
                        "enum": ["returned", "refunded", "replaced", null],
                        "nullable": true,
                        "type": "string"
                      },
                      "stopped_at": {
                        "format": "date-time",
                        "nullable": true,
                        "type": "string"
                      },
                      "unit_index": {
                        "description": "Which unit of the line, from 0.",
                        "type": "integer"
                      }
                    },
                    "type": "object"
                  },
                  "type": "array"
                },
                "units_total": {
                  "description": "The line’s units. A page lists at most 1,000 units: a line with more than `units` holds goes on in the next page (`next_cursor`), from the unit after.",
                  "type": "integer"
                }
              },
              "type": "object"
            },
            "type": "array"
          },
          "next_cursor": {
            "description": "More orders match: send it back as `cursor` with the same filters.",
            "nullable": true,
            "type": "string"
          }
        },
        "required": ["lines", "next_cursor"],
        "type": "object"
      },
      "WarrantyExceptionAdd": {
        "properties": {
          "months": {
            "description": "Its term, 0–1200 months (0 excludes it). Default 12.",
            "type": "integer"
          },
          "option_id": {
            "description": "The option, its `id` from `GET /options`.",
            "type": "string"
          },
          "tier": {
            "description": "The step it is set at: `{ kind: store }`, `{ kind: vendor, vendor_id }` or `{ kind: category, category_id, vendor_id? }`.",
            "properties": {
              "category_id": {
                "description": "With `category`: the category, its `id` from `GET /categories`.",
                "type": "string"
              },
              "kind": {
                "enum": ["store", "vendor", "category"],
                "type": "string"
              },
              "vendor_id": {
                "description": "With `vendor` (required) or `category` (optional): an `id` in `vendors` of `GET /settings/warranty/ladder`.",
                "nullable": true,
                "type": "string"
              }
            },
            "required": ["kind"],
            "type": "object"
          }
        },
        "required": ["tier", "option_id"],
        "type": "object"
      },
      "WarrantyExceptionEdit": {
        "properties": {
          "months": {
            "description": "Its term, 0–1200 months (0 excludes it).",
            "type": "integer"
          }
        },
        "required": ["months"],
        "type": "object"
      },
      "WarrantyExpectedCost": {
        "properties": {
          "basis": {
            "description": "What the rate is a share of: `product_cost` (the template’s cost), `selling_price` (its price), or `none` (the store doesn’t estimate).",
            "enum": ["none", "product_cost", "selling_price"],
            "type": "string"
          },
          "basis_text": {
            "description": "As the admin says it: `5% of product cost`.",
            "type": "string"
          },
          "missing_base": {
            "description": "The template has no cost (or price) to take the share of, so `per_unit` is 0.",
            "type": "boolean"
          },
          "per_unit": {
            "description": "What one unit is expected to cost while covered, in the store’s currency; null when the store doesn’t estimate.",
            "nullable": true,
            "type": "number"
          },
          "percent": {
            "description": "The rate that applies, two decimals.",
            "type": "number"
          },
          "rate_source": {
            "description": "Which rate applied: `category_vendor`, `category`, `vendor`, or `store` (the store’s own).",
            "enum": ["category_vendor", "category", "vendor", "store"],
            "type": "string"
          },
          "template_id": {
            "type": "string"
          },
          "vendor_id": {
            "nullable": true,
            "type": "string"
          }
        },
        "required": [
          "template_id",
          "vendor_id",
          "basis",
          "basis_text",
          "percent",
          "rate_source",
          "per_unit",
          "missing_base"
        ],
        "type": "object"
      },
      "WarrantyLadder": {
        "description": "Settings › Products › Warranty coverage, steps 1–4.",
        "properties": {
          "category_rules": {
            "description": "Step 3: the category rules.",
            "items": {
              "properties": {
                "beats": {
                  "description": "Which rule it wins over, in words.",
                  "type": "string"
                },
                "category_id": {
                  "type": "string"
                },
                "category_name": {
                  "type": "string"
                },
                "category_path": {
                  "description": "The category and its parents: `Furniture › Sofas`.",
                  "type": "string"
                },
                "id": {
                  "type": "string"
                },
                "months": {
                  "description": "The rule’s term. Months, 0–1200: `0` is no warranty, null is not set (follows the step above).",
                  "nullable": true,
                  "type": "integer"
                },
                "product_count": {
                  "type": "integer"
                },
                "vendor_id": {
                  "description": "Null: the rule applies whoever supplies it.",
                  "nullable": true,
                  "type": "string"
                },
                "vendor_name": {
                  "nullable": true,
                  "type": "string"
                }
              },
              "required": [
                "id",
                "category_id",
                "category_name",
                "category_path",
                "vendor_id",
                "vendor_name",
                "months",
                "beats",
                "product_count"
              ],
              "type": "object"
            },
            "type": "array"
          },
          "exceptions": {
            "description": "Step 4: options with a term of their own at a step.",
            "items": {
              "properties": {
                "component_key": {
                  "type": "string"
                },
                "detail": {
                  "nullable": true,
                  "type": "string"
                },
                "id": {
                  "type": "string"
                },
                "months": {
                  "description": "Its term in months; 0 excludes the option.",
                  "type": "integer"
                },
                "name": {
                  "description": "The option’s label.",
                  "type": "string"
                },
                "option_id": {
                  "description": "The option, its `id` in `GET /options`; null for one no longer in the library.",
                  "nullable": true,
                  "type": "string"
                },
                "origin": {
                  "description": "The step it is set at, in words.",
                  "type": "string"
                },
                "tier": {
                  "$ref": "#/components/schemas/WarrantyTierRef"
                }
              },
              "required": [
                "id",
                "origin",
                "tier",
                "option_id",
                "component_key",
                "name",
                "detail",
                "months"
              ],
              "type": "object"
            },
            "type": "array"
          },
          "nothing_configured": {
            "description": "No step anywhere carries a term.",
            "type": "boolean"
          },
          "store_default_missing": {
            "description": "Later steps are set but the store default is not.",
            "type": "boolean"
          },
          "store_months": {
            "description": "Step 1: the store default. Months, 0–1200: `0` is no warranty, null is not set (follows the step above).",
            "nullable": true,
            "type": "integer"
          },
          "term_presets": {
            "description": "The quick-pick terms the screens offer, in months (read-only).",
            "items": {
              "type": "integer"
            },
            "type": "array"
          },
          "vendor_count": {
            "type": "integer"
          },
          "vendors": {
            "description": "Step 2: every vendor, with its own term or null (follows the store default).",
            "items": {
              "properties": {
                "id": {
                  "type": "string"
                },
                "months": {
                  "description": "The vendor’s term. Months, 0–1200: `0` is no warranty, null is not set (follows the step above).",
                  "nullable": true,
                  "type": "integer"
                },
                "name": {
                  "type": "string"
                },
                "product_count": {
                  "description": "Product templates this vendor supplies.",
                  "type": "integer"
                }
              },
              "required": ["id", "name", "months", "product_count"],
              "type": "object"
            },
            "type": "array"
          }
        },
        "required": [
          "store_months",
          "term_presets",
          "vendors",
          "vendor_count",
          "category_rules",
          "exceptions",
          "nothing_configured",
          "store_default_missing"
        ],
        "type": "object"
      },
      "WarrantyLineChange": {
        "properties": {
          "action": {
            "description": "`add_plan` (`plan_id`), `remove_plan`, `override_term` (`component_key`, `months`), `clear_override` (`component_key`), `lift_exclusion` (`component_key`, `lifted`), `add_exception` (`definition_id`, `months`), `reset`.",
            "enum": [
              "add_plan",
              "remove_plan",
              "override_term",
              "clear_override",
              "lift_exclusion",
              "add_exception",
              "reset"
            ],
            "type": "string"
          },
          "component_key": {
            "description": "The part (the product, or one of its options): `lines[].rows[].component_key` of `GET /orders/{id}/warranty`.",
            "type": "string"
          },
          "definition_id": {
            "description": "The option an exception is for: `lines[].addable[].definition_id` of `GET /orders/{id}/warranty`.",
            "type": "string"
          },
          "lifted": {
            "description": "`lift_exclusion`: true covers the excluded part anyway; false excludes it again.",
            "type": "boolean"
          },
          "months": {
            "description": "The term in months: 0 is not covered. `override_term` also takes null (no term of its own). Above 0 overrides warranty.",
            "nullable": true,
            "type": "integer"
          },
          "order_line_item_id": {
            "description": "The line: `lines[].order_line_item_id` of `GET /orders/{id}/warranty`.",
            "type": "string"
          },
          "plan_id": {
            "description": "The warranty plan to sell: one of the store’s plans (Settings › Warranty › Plans). A plan already on the line is `plans[].plan_key` of `GET /orders/{id}/warranty`.",
            "type": "string"
          }
        },
        "required": ["action", "order_line_item_id"],
        "type": "object"
      },
      "WarrantyPlanArchive": {
        "properties": {
          "archived": {
            "description": "`true` archives it; `false` brings it back.",
            "type": "boolean"
          }
        },
        "required": ["archived"],
        "type": "object"
      },
      "WarrantyPlanCovers": {
        "properties": {
          "covers_whole_product": {
            "description": "Cover the whole product, options added later included. Default false.",
            "type": "boolean"
          },
          "option_ids": {
            "description": "The options it covers, by their `id` from `GET /options` (up to 200). Ignored when `covers_whole_product` is true.",
            "items": {
              "type": "string"
            },
            "type": "array"
          }
        },
        "type": "object"
      },
      "WarrantyPlanCreate": {
        "properties": {
          "cost": {
            "description": "What it costs the store; needs See costs and Enter and correct costs.",
            "nullable": true,
            "type": "number"
          },
          "covers_whole_product": {
            "description": "Cover the whole product (options added later included). Default false: send `option_ids`.",
            "type": "boolean"
          },
          "months": {
            "description": "The months it adds (1–1200).",
            "type": "integer"
          },
          "name": {
            "description": "Unique among the store’s plans (up to 120 characters).",
            "type": "string"
          },
          "option_ids": {
            "description": "The options it covers, by their `id` from `GET /options` (up to 200). Ignored when `covers_whole_product` is true.",
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "price": {
            "description": "What the customer pays, in the store’s currency.",
            "type": "number"
          },
          "serial_required": {
            "description": "Units it is sold on need a serial number. Default false.",
            "type": "boolean"
          },
          "taxable": {
            "description": "Default true.",
            "type": "boolean"
          }
        },
        "required": ["name", "price", "months"],
        "type": "object"
      },
      "WarrantyPlanEdit": {
        "description": "Only the fields to change.",
        "properties": {
          "cost": {
            "description": "Needs See costs and Enter and correct costs; null clears it.",
            "nullable": true,
            "type": "number"
          },
          "months": {
            "description": "The months it adds (1–1200).",
            "type": "integer"
          },
          "name": {
            "description": "Unique among the store’s plans (up to 120 characters).",
            "type": "string"
          },
          "price": {
            "description": "In the store’s currency, two decimals.",
            "type": "number"
          },
          "serial_required": {
            "type": "boolean"
          },
          "taxable": {
            "type": "boolean"
          }
        },
        "type": "object"
      },
      "WarrantyPlanList": {
        "properties": {
          "costs_hidden": {
            "description": "Present, with a `reason`, when plans’ costs were left out.",
            "properties": {
              "reason": {
                "type": "string"
              }
            },
            "required": ["reason"],
            "type": "object"
          },
          "plans": {
            "items": {
              "properties": {
                "archived": {
                  "type": "boolean"
                },
                "cost": {
                  "description": "What the plan costs the store, in its currency; null when not set. Absent without See costs.",
                  "nullable": true,
                  "type": "number"
                },
                "covers": {
                  "description": "The options it covers (empty when `covers_whole_product`).",
                  "items": {
                    "properties": {
                      "label": {
                        "type": "string"
                      },
                      "option_id": {
                        "type": "string"
                      }
                    },
                    "required": ["option_id", "label"],
                    "type": "object"
                  },
                  "type": "array"
                },
                "covers_whole_product": {
                  "description": "It covers the whole product, options added later included.",
                  "type": "boolean"
                },
                "id": {
                  "type": "string"
                },
                "months": {
                  "description": "The months the plan adds to the product’s own term.",
                  "type": "integer"
                },
                "name": {
                  "type": "string"
                },
                "price": {
                  "description": "What the customer pays for the plan, in the store’s currency.",
                  "type": "number"
                },
                "serial_required": {
                  "description": "Every unit it is sold on needs a serial number at fulfilment.",
                  "type": "boolean"
                },
                "sold_count": {
                  "description": "How many sold lines carry it (a sold plan can’t be deleted).",
                  "type": "integer"
                },
                "taxable": {
                  "type": "boolean"
                }
              },
              "required": [
                "id",
                "name",
                "price",
                "months",
                "taxable",
                "archived",
                "covers_whole_product",
                "covers",
                "serial_required",
                "sold_count"
              ],
              "type": "object"
            },
            "type": "array"
          }
        },
        "required": ["plans"],
        "type": "object"
      },
      "WarrantyPreview": {
        "properties": {
          "lines": {
            "description": "In the request’s order.",
            "items": {
              "properties": {
                "addable": {
                  "description": "Options following the product term: what an exception can be added for.",
                  "items": {
                    "properties": {
                      "component_key": {
                        "description": "What `warranty.exceptions[].component_key` takes for this option.",
                        "type": "string"
                      },
                      "current_months": {
                        "nullable": true,
                        "type": "integer"
                      },
                      "definition_id": {
                        "type": "string"
                      },
                      "name": {
                        "type": "string"
                      }
                    },
                    "type": "object"
                  },
                  "type": "array"
                },
                "carries_warranty": {
                  "type": "boolean"
                },
                "index": {
                  "description": "The line’s place in the request, from 0.",
                  "type": "integer"
                },
                "kind": {
                  "description": "What the line is, as sent.",
                  "enum": ["template", "shopify_product", "custom"],
                  "type": "string"
                },
                "plan_error": {
                  "description": "Why the line’s `warranty.plan_id` can’t be sold on it; null when it can.",
                  "nullable": true,
                  "type": "string"
                },
                "plans": {
                  "items": {
                    "properties": {
                      "covered_component_keys": {
                        "items": {
                          "type": "string"
                        },
                        "type": "array"
                      },
                      "covers_whole_product": {
                        "type": "boolean"
                      },
                      "line_total": {
                        "type": "number"
                      },
                      "months": {
                        "type": "integer"
                      },
                      "name": {
                        "type": "string"
                      },
                      "plan_key": {
                        "type": "string"
                      },
                      "quantity_sold": {
                        "type": "integer"
                      },
                      "unit_price": {
                        "type": "number"
                      }
                    },
                    "type": "object"
                  },
                  "type": "array"
                },
                "quantity": {
                  "type": "integer"
                },
                "resolved_category_name": {
                  "nullable": true,
                  "type": "string"
                },
                "resolved_vendor_name": {
                  "nullable": true,
                  "type": "string"
                },
                "rows": {
                  "items": {
                    "properties": {
                      "component_key": {
                        "description": "What `component_key` takes when starting a claim.",
                        "type": "string"
                      },
                      "component_name": {
                        "type": "string"
                      },
                      "excluded": {
                        "type": "boolean"
                      },
                      "extended_months": {
                        "type": "integer"
                      },
                      "extended_text": {
                        "type": "string"
                      },
                      "is_product": {
                        "type": "boolean"
                      },
                      "locked": {
                        "type": "boolean"
                      },
                      "months": {
                        "description": "Null: no cover.",
                        "nullable": true,
                        "type": "integer"
                      },
                      "option_label": {
                        "nullable": true,
                        "type": "string"
                      },
                      "option_swatch_color": {
                        "nullable": true,
                        "type": "string"
                      },
                      "option_value_label": {
                        "nullable": true,
                        "type": "string"
                      },
                      "overridden": {
                        "type": "boolean"
                      },
                      "source": {
                        "description": "Where the term came from.",
                        "enum": [
                          "store_policy",
                          "vendor_policy",
                          "category_policy",
                          "category_vendor_policy",
                          "template",
                          "product",
                          "line",
                          null
                        ],
                        "nullable": true,
                        "type": "string"
                      },
                      "source_label": {
                        "type": "string"
                      },
                      "term_text": {
                        "type": "string"
                      },
                      "total_text": {
                        "type": "string"
                      },
                      "unexcluded": {
                        "type": "boolean"
                      }
                    },
                    "type": "object"
                  },
                  "type": "array"
                },
                "shopify_product_id": {
                  "nullable": true,
                  "type": "string"
                },
                "template_id": {
                  "nullable": true,
                  "type": "string"
                },
                "title": {
                  "type": "string"
                },
                "trace": {
                  "items": {
                    "properties": {
                      "applied": {
                        "type": "boolean"
                      },
                      "label": {
                        "type": "string"
                      },
                      "note": {
                        "nullable": true,
                        "type": "string"
                      },
                      "says": {
                        "type": "string"
                      }
                    },
                    "type": "object"
                  },
                  "type": "array"
                }
              },
              "type": "object"
            },
            "type": "array"
          },
          "plans": {
            "description": "The plans the store sells (not archived), for `warranty.plan_id`.",
            "items": {
              "properties": {
                "covered_options": {
                  "description": "The options it extends, when not the whole product.",
                  "items": {
                    "type": "string"
                  },
                  "type": "array"
                },
                "covers_whole_product": {
                  "type": "boolean"
                },
                "id": {
                  "type": "string"
                },
                "months": {
                  "type": "integer"
                },
                "name": {
                  "type": "string"
                },
                "price": {
                  "description": "Each unit, in the store’s currency.",
                  "type": "number"
                }
              },
              "type": "object"
            },
            "type": "array"
          },
          "term_presets": {
            "description": "The store’s term choices, months.",
            "items": {
              "type": "integer"
            },
            "type": "array"
          }
        },
        "required": ["lines", "plans", "term_presets"],
        "type": "object"
      },
      "WarrantyPreviewInput": {
        "properties": {
          "lines": {
            "description": "1–100 lines.",
            "items": {
              "description": "A line as `POST /quotes` takes it (`template_id` with `options`, `shopify_variant_id` with `shopify_product_id`, or a custom item’s `title` and `price`), plus `warranty`. Its vendor is the one a new quote gives it.",
              "properties": {
                "note": {
                  "description": "Taken as `POST /quotes` takes it; cover ignores it.",
                  "type": "string"
                },
                "options": {
                  "description": "A template line’s option values, as `POST /quotes` takes them: `[{ field_id, value }]`, each option once. An option’s cover can follow its value.",
                  "items": {
                    "properties": {
                      "field_id": {
                        "type": "string"
                      },
                      "image_file_id": {
                        "description": "The picture’s Shopify file id, with `image_url`.",
                        "type": "string"
                      },
                      "image_url": {
                        "description": "A text-and-image option’s picture (its Shopify Files URL).",
                        "type": "string"
                      },
                      "value": {
                        "type": "string"
                      }
                    },
                    "type": "object"
                  },
                  "type": "array"
                },
                "price": {
                  "description": "Taken as `POST /quotes` takes it; cover ignores it.",
                  "type": "number"
                },
                "quantity": {
                  "description": "1–9999 (default 1): a plan’s price is per unit.",
                  "type": "integer"
                },
                "shopify_product_id": {
                  "type": "string"
                },
                "shopify_variant_id": {
                  "type": "string"
                },
                "sku": {
                  "description": "A custom item’s SKU; cover ignores it.",
                  "type": "string"
                },
                "template_id": {
                  "type": "string"
                },
                "title": {
                  "description": "A custom item’s name (it carries no warranty).",
                  "type": "string"
                },
                "warranty": {
                  "description": "Changes to try on this line, as the line’s Warranty dialog makes them (left out: the cover as the store sets it).",
                  "properties": {
                    "exceptions": {
                      "description": "An option’s own term on this line, up to 200.",
                      "items": {
                        "properties": {
                          "component_key": {
                            "description": "A part’s `component_key`: a row’s or an `addable` option’s in this preview’s answer, or `GET /orders/{id}/warranty`’s.",
                            "type": "string"
                          },
                          "months": {
                            "description": "Its term in months (0: excluded); null: not covered.",
                            "nullable": true,
                            "type": "integer"
                          }
                        },
                        "required": ["component_key", "months"],
                        "type": "object"
                      },
                      "type": "array"
                    },
                    "lifted": {
                      "description": "Cover these anyway: the `component_key` of excluded parts (a row with `excluded`), up to 200.",
                      "items": {
                        "type": "string"
                      },
                      "type": "array"
                    },
                    "plan_id": {
                      "description": "A plan to sell on the line: an `id` from this preview’s `plans` (or a `plan_key` of `GET /orders/{id}/warranty`). Null: none.",
                      "nullable": true,
                      "type": "string"
                    },
                    "product_months": {
                      "description": "The product’s own term on this line, in months (0–1200); null: not covered on this line.",
                      "nullable": true,
                      "type": "integer"
                    }
                  },
                  "type": "object"
                }
              },
              "type": "object"
            },
            "type": "array"
          }
        },
        "required": ["lines"],
        "type": "object"
      },
      "WarrantyProductTermSet": {
        "properties": {
          "months": {
            "description": "The product’s own term. Months, 0–1200: `0` is no warranty, null is not set (follows the step above).",
            "nullable": true,
            "type": "integer"
          },
          "product_title": {
            "description": "The title the list shows (up to 255 characters). Left out: the one saved before, or none.",
            "type": "string"
          },
          "serial_required": {
            "description": "Its units need a serial number. Left out: as saved before, or false.",
            "type": "boolean"
          },
          "shopify_product_id": {
            "description": "The Shopify product, its `id` from `GET /products` (`gid://shopify/Product/…`, or the number alone).",
            "type": "string"
          }
        },
        "required": ["shopify_product_id", "months"],
        "type": "object"
      },
      "WarrantyProductTerms": {
        "properties": {
          "catalog": {
            "description": "Shopify catalog products with a term of their own.",
            "items": {
              "properties": {
                "id": {
                  "type": "string"
                },
                "months": {
                  "description": "The product’s own term. Months, 0–1200: `0` is no warranty, null is not set (follows the step above).",
                  "nullable": true,
                  "type": "integer"
                },
                "product_title": {
                  "type": "string"
                },
                "serial_required": {
                  "type": "boolean"
                },
                "shopify_product_id": {
                  "type": "string"
                },
                "updated_at": {
                  "format": "date-time",
                  "type": "string"
                }
              },
              "required": [
                "id",
                "shopify_product_id",
                "product_title",
                "months",
                "serial_required",
                "updated_at"
              ],
              "type": "object"
            },
            "type": "array"
          },
          "templates": {
            "description": "Product templates with a term of their own, an option term or a serial rule (changed in the template editor).",
            "items": {
              "properties": {
                "active": {
                  "type": "boolean"
                },
                "id": {
                  "type": "string"
                },
                "months": {
                  "description": "The template’s own term. Months, 0–1200: `0` is no warranty, null is not set (follows the step above).",
                  "nullable": true,
                  "type": "integer"
                },
                "part_terms": {
                  "description": "Options with a term of their own on it.",
                  "type": "integer"
                },
                "serial_required": {
                  "type": "boolean"
                },
                "title": {
                  "type": "string"
                }
              },
              "required": [
                "id",
                "title",
                "active",
                "months",
                "part_terms",
                "serial_required"
              ],
              "type": "object"
            },
            "type": "array"
          }
        },
        "required": ["templates", "catalog"],
        "type": "object"
      },
      "WarrantyReport": {
        "properties": {
          "by_vendor": {
            "description": "The 12 costliest vendors of the period’s claims; empty without View costs.",
            "items": {
              "properties": {
                "asked": {
                  "nullable": true,
                  "type": "number"
                },
                "claims": {
                  "type": "integer"
                },
                "cost": {
                  "type": "number"
                },
                "credited": {
                  "nullable": true,
                  "type": "number"
                },
                "vendor": {
                  "type": "string"
                }
              },
              "type": "object"
            },
            "type": "array"
          },
          "claims": {
            "properties": {
              "median_days_to_resolve": {
                "nullable": true,
                "type": "integer"
              },
              "open": {
                "description": "Open now, whatever the period.",
                "type": "integer"
              },
              "open_longer_than_14_days": {
                "type": "integer"
              },
              "reported": {
                "description": "Claims reported in the period.",
                "type": "integer"
              },
              "resolved": {
                "description": "Claims resolved in the period.",
                "type": "integer"
              }
            },
            "type": "object"
          },
          "cost": {
            "description": "What claims reported in the period cost (`total` includes `refunded`: refunds and store credit), what vendor claims asked for and what vendors credited. Null without View costs.",
            "nullable": true,
            "properties": {
              "asked": {
                "nullable": true,
                "type": "number"
              },
              "credited": {
                "type": "number"
              },
              "recovered_percent": {
                "nullable": true,
                "type": "number"
              },
              "refunded": {
                "type": "number"
              },
              "total": {
                "type": "number"
              }
            },
            "type": "object"
          },
          "costs_hidden": {
            "description": "Present, with a `reason`, when money was left out.",
            "nullable": true,
            "properties": {
              "reason": {
                "type": "string"
              }
            },
            "required": ["reason"],
            "type": "object"
          },
          "ending_soon": {
            "description": "Whole-product cover ending in the next 90 days, whatever the period. Null without View quotes and orders.",
            "nullable": true,
            "properties": {
              "capped": {
                "description": "More units end than one read takes: these are the soonest.",
                "type": "boolean"
              },
              "customers": {
                "type": "integer"
              },
              "rows": {
                "items": {
                  "properties": {
                    "customer": {
                      "description": "The customer’s name; “No name” for one with none, unless the caller may read customers (then their email, as the page shows it).",
                      "type": "string"
                    },
                    "ends_at": {
                      "format": "date-time",
                      "type": "string"
                    },
                    "order_id": {
                      "type": "string"
                    },
                    "order_number": {
                      "type": "string"
                    },
                    "product": {
                      "type": "string"
                    }
                  },
                  "type": "object"
                },
                "type": "array"
              },
              "units": {
                "type": "integer"
              }
            },
            "type": "object"
          },
          "open_by_status": {
            "items": {
              "properties": {
                "over_two": {
                  "type": "integer"
                },
                "status": {
                  "enum": [
                    "new",
                    "in_review",
                    "approved",
                    "in_progress",
                    "resolved",
                    "declined"
                  ],
                  "type": "string"
                },
                "under_week": {
                  "type": "integer"
                },
                "week_to_two": {
                  "type": "integer"
                }
              },
              "type": "object"
            },
            "type": "array"
          },
          "period": {
            "properties": {
              "days": {
                "type": "integer"
              },
              "from": {
                "format": "date-time",
                "type": "string"
              },
              "location": {
                "nullable": true,
                "type": "string"
              },
              "to": {
                "description": "Exclusive.",
                "format": "date-time",
                "type": "string"
              }
            },
            "type": "object"
          },
          "plans": {
            "description": "Plans sold on lines with warranty, on orders placed in the period (what customers paid: sales, not a cost). Null without View quotes and orders.",
            "nullable": true,
            "properties": {
              "eligible_lines": {
                "type": "integer"
              },
              "lines_with_plan": {
                "type": "integer"
              },
              "revenue": {
                "type": "number"
              }
            },
            "type": "object"
          },
          "top_products": {
            "items": {
              "properties": {
                "claims": {
                  "type": "integer"
                },
                "title": {
                  "type": "string"
                }
              },
              "type": "object"
            },
            "type": "array"
          },
          "truncated": {
            "description": "A figure read only the newest rows of a very large period.",
            "type": "boolean"
          }
        },
        "required": [
          "period",
          "claims",
          "cost",
          "costs_hidden",
          "plans",
          "open_by_status"
        ],
        "type": "object"
      },
      "WarrantyStoreDefault": {
        "properties": {
          "months": {
            "description": "The store default. Months, 0–1200: `0` is no warranty, null is not set (follows the step above).",
            "nullable": true,
            "type": "integer"
          }
        },
        "required": ["months"],
        "type": "object"
      },
      "WarrantyTermEdit": {
        "properties": {
          "months": {
            "description": "The term. Months, 0–1200: `0` is no warranty, null is not set (follows the step above).",
            "nullable": true,
            "type": "integer"
          }
        },
        "required": ["months"],
        "type": "object"
      },
      "WarrantyTierRef": {
        "description": "The step: the store default, a vendor, or a category rule (with or without a vendor).",
        "properties": {
          "category_id": {
            "nullable": true,
            "type": "string"
          },
          "kind": {
            "enum": ["store", "vendor", "category"],
            "type": "string"
          },
          "vendor_id": {
            "nullable": true,
            "type": "string"
          }
        },
        "required": ["kind", "vendor_id", "category_id"],
        "type": "object"
      },
      "WarrantyUnitsChanged": {
        "properties": {
          "changed": {
            "description": "Units whose cover changed.",
            "type": "integer"
          },
          "message": {
            "description": "Why some were skipped, when it says.",
            "nullable": true,
            "type": "string"
          },
          "order_id": {
            "type": "string"
          },
          "skipped": {
            "description": "Units left as they were (not delivered, already stopped, or nothing to undo).",
            "type": "integer"
          }
        },
        "required": ["order_id", "changed", "skipped", "message"],
        "type": "object"
      },
      "WarrantyUnitsGoodwill": {
        "properties": {
          "ends_on": {
            "description": "The last day of goodwill cover, YYYY-MM-DD (a real day), after today and at most 1,200 months away; null removes it.",
            "format": "date",
            "nullable": true,
            "type": "string"
          },
          "note": {
            "description": "Why, up to 500 characters (the order’s activity says it). With `ends_on`.",
            "type": "string"
          },
          "order_id": {
            "description": "The order’s `id` (from `GET /warranty/coverage`, `GET /orders` or `search`). Only an order the caller may change.",
            "type": "string"
          },
          "units": {
            "description": "1–250 units, each by its order line and its place on the line, as `GET /warranty/coverage` lists them (`lines[].order_line_item_id`, `lines[].units[].unit_index`).",
            "items": {
              "properties": {
                "order_line_item_id": {
                  "description": "The line’s `order_line_item_id` from `GET /warranty/coverage`.",
                  "type": "string"
                },
                "unit_index": {
                  "description": "Which unit of the line, from 0 (`lines[].units[].unit_index`).",
                  "type": "integer"
                }
              },
              "required": ["order_line_item_id", "unit_index"],
              "type": "object"
            },
            "type": "array"
          }
        },
        "required": ["order_id", "units", "ends_on"],
        "type": "object"
      },
      "WarrantyUnitsReturned": {
        "properties": {
          "order_id": {
            "description": "The order’s `id` (from `GET /warranty/coverage`, `GET /orders` or `search`). Only an order the caller may change.",
            "type": "string"
          },
          "returned": {
            "description": "`true` (the default) marks them returned; `false` undoes a return.",
            "type": "boolean"
          },
          "returned_on": {
            "description": "The day they came back, YYYY-MM-DD (default today). Only with `returned: true`.",
            "format": "date",
            "type": "string"
          },
          "units": {
            "description": "1–250 units, each by its order line and its place on the line, as `GET /warranty/coverage` lists them (`lines[].order_line_item_id`, `lines[].units[].unit_index`).",
            "items": {
              "properties": {
                "order_line_item_id": {
                  "description": "The line’s `order_line_item_id` from `GET /warranty/coverage`.",
                  "type": "string"
                },
                "unit_index": {
                  "description": "Which unit of the line, from 0 (`lines[].units[].unit_index`).",
                  "type": "integer"
                }
              },
              "required": ["order_line_item_id", "unit_index"],
              "type": "object"
            },
            "type": "array"
          }
        },
        "required": ["order_id", "units"],
        "type": "object"
      },
      "WarrantyVendorTerm": {
        "properties": {
          "months": {
            "description": "The vendor’s term. Months, 0–1200: `0` is no warranty, null is not set (follows the step above).",
            "nullable": true,
            "type": "integer"
          },
          "vendor_id": {
            "description": "The vendor, an `id` in `vendors` of `GET /settings/warranty/ladder`.",
            "type": "string"
          }
        },
        "required": ["vendor_id", "months"],
        "type": "object"
      },
      "Webhook": {
        "properties": {
          "active": {
            "type": "boolean"
          },
          "consecutive_failures": {
            "type": "integer"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "disabled_at": {
            "nullable": true,
            "type": "string"
          },
          "events": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "id": {
            "type": "string"
          },
          "url": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "url",
          "events",
          "active",
          "disabled_at",
          "consecutive_failures",
          "created_at"
        ],
        "type": "object"
      },
      "WebhookCreate": {
        "properties": {
          "events": {
            "description": "What to be told about (each is described under `WebhookEvent`). Each needs a scope that reads its record: `quote.*` Read quotes; `order.*` and `payment.received` Read orders; `customer.*` Read customers; `conversation.message_received` Read the Inbox or Work the Inbox (a vendor’s conversation is told only to a key that also reads purchase orders); `purchase_order.*` Read purchase orders or Manage purchase orders; `warranty_claim.*` Read warranty claims or Work warranty claims.",
            "items": {
              "enum": [
                "quote.created",
                "quote.updated",
                "order.created",
                "order.updated",
                "customer.created",
                "customer.updated",
                "payment.received",
                "conversation.message_received",
                "purchase_order.created",
                "purchase_order.updated",
                "purchase_order.received",
                "warranty_claim.created",
                "warranty_claim.status_changed"
              ],
              "type": "string"
            },
            "type": "array"
          },
          "url": {
            "description": "An https address that answers 2xx. Public addresses only.",
            "type": "string"
          }
        },
        "required": ["url", "events"],
        "type": "object"
      },
      "WebhookCreated": {
        "properties": {
          "active": {
            "type": "boolean"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "events": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "id": {
            "type": "string"
          },
          "secret": {
            "description": "Verifies the `OrderPilot-Signature` header. Shown once: a retry of the same request (same Idempotency-Key) returns the webhook without it. Keep it private; rotate it if it leaks.",
            "type": "string"
          },
          "secret_redacted": {
            "description": "True on a replayed answer, which leaves `secret` out.",
            "type": "boolean"
          },
          "url": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "WebhookEvent": {
        "description": "What a webhook is sent: `POST`ed as JSON, signed in the `OrderPilot-Signature` header. Thin: it says what changed, and the receiver fetches the record with the API (so it never carries more than the key could read). De-duplicate on `id`. `quote.created`: A quote was made. `data.id`: the quote (`GET /quotes/{id}`). `quote.updated`: A quote changed, its status included. `order.created`: An order was made, or a quote became one. `data.id`: the order (`GET /orders/{id}`). `order.updated`: An order changed, its status included. `customer.created`: A customer was added. `data.id`: the customer (`GET /customers/{id}`). `customer.updated`: A customer changed. `payment.received`: A payment was recorded or part paid. `data.id`: the order. `conversation.message_received`: A customer’s message (portal or email) or a vendor’s email reached the Inbox. `data.id`: the conversation’s key (`order:<id>` or `po:<id>`, `GET /conversations/{key}`); a vendor’s needs Read purchase orders too. `purchase_order.created`: A purchase order was made. `data.id`: the purchase order (`GET /purchase-orders/{id}`). `purchase_order.updated`: A purchase order changed (an edit, a status move, a send, a receipt, a correction). `purchase_order.received`: Goods were received on a purchase order (one event per receipt posted). `warranty_claim.created`: A warranty claim was opened. `data.id`: the claim (`GET /warranty/claims/{id}`). `warranty_claim.status_changed`: A warranty claim moved to another status.",
        "properties": {
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "data": {
            "properties": {
              "id": {
                "description": "The record: a quote’s, order’s, customer’s, purchase order’s or warranty claim’s id; for `conversation.message_received` the conversation’s key (`order:<id>` or `po:<id>`); for `ping` the webhook’s.",
                "type": "string"
              },
              "kind": {
                "enum": [
                  "quote",
                  "order",
                  "customer",
                  "conversation",
                  "purchase_order",
                  "warranty_claim",
                  "ping"
                ],
                "type": "string"
              }
            },
            "required": ["id", "kind"],
            "type": "object"
          },
          "id": {
            "description": "`evt_…`, the same on every retry of this event.",
            "type": "string"
          },
          "type": {
            "enum": [
              "quote.created",
              "quote.updated",
              "order.created",
              "order.updated",
              "customer.created",
              "customer.updated",
              "payment.received",
              "conversation.message_received",
              "purchase_order.created",
              "purchase_order.updated",
              "purchase_order.received",
              "warranty_claim.created",
              "warranty_claim.status_changed",
              "ping"
            ],
            "type": "string"
          }
        },
        "required": ["id", "type", "created_at", "data"],
        "type": "object"
      },
      "WebhookList": {
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/Webhook"
            },
            "type": "array"
          }
        },
        "type": "object"
      },
      "ZipFile": {
        "description": "A ZIP part of a signature export.",
        "format": "binary",
        "type": "string"
      }
    },
    "securitySchemes": {
      "bearer": {
        "description": "An API key (opk_…), an AI agent’s OAuth access token (opo_…, see `oauth`) or an access token (opa_…).",
        "scheme": "bearer",
        "type": "http"
      },
      "oauth": {
        "description": "An AI agent connects with OAuth 2.1 (PKCE S256 required; discovery at /.well-known/oauth-authorization-server). A Store administrator approves it in OrderPilot, narrowing what it asked for; the access token then acts as that connection, with its scopes, locations and limits. Headless agents use the device flow (/connect/oauth/device_authorization).",
        "flows": {
          "authorizationCode": {
            "authorizationUrl": "https://api.meetorderpilot.com/connect/oauth/authorize",
            "refreshUrl": "https://api.meetorderpilot.com/connect/oauth/token",
            "scopes": {
              "CATALOG_READ": "Read the catalog",
              "CATALOG_WRITE": "Change the catalog",
              "COMMISSION_READ": "See commission",
              "COMMISSION_WRITE": "Change sales credit",
              "CONTRACTS_EXPORT": "Export signed contracts",
              "COSTS_READ": "See costs",
              "COSTS_WRITE": "Enter and correct costs",
              "CUSTOMERS_READ": "Read customers",
              "CUSTOMERS_WRITE": "Create and change customers",
              "CUSTOMER_DATA_EXPORT": "Export customer data",
              "DELETE": "Delete records",
              "EMAILS_SEND": "Send emails",
              "INBOX_READ": "Read the Inbox",
              "INBOX_WRITE": "Work the Inbox",
              "ORDERS_READ": "Read orders",
              "ORDERS_WRITE": "Change orders",
              "PAYMENTS_WRITE": "Record and request payments",
              "PRICING_WRITE": "Prices and exceptions",
              "PURCHASING_READ": "Read purchase orders",
              "PURCHASING_WRITE": "Manage purchase orders",
              "QUOTES_READ": "Read quotes",
              "QUOTES_WRITE": "Create and change quotes",
              "REFUNDS_WRITE": "Refunds and returns",
              "REPORTS_READ": "Read reports",
              "SETTINGS_READ": "Read settings",
              "SETTINGS_WRITE": "Change settings",
              "STAFF_MANAGE": "Manage staff",
              "WARRANTY_READ": "Read warranty claims",
              "WARRANTY_WRITE": "Work warranty claims",
              "WEBHOOKS_MANAGE": "Manage webhooks"
            },
            "tokenUrl": "https://api.meetorderpilot.com/connect/oauth/token"
          }
        },
        "type": "oauth2"
      }
    }
  },
  "info": {
    "description": "Quotes, orders, customers, product templates, payments, refunds, purchase orders, replies, warranty, brands and webhooks of a store, for AI agents (through the MCP server at /connect/mcp) and integrations signed in with an API key, and for linked phones. Inside v1 only additions are made; a breaking change ships as /connect/v2. Endpoints marked `x-stability: preview` aren’t frozen yet, nor are fields marked so (an email template’s `document`, the editor’s own format). Anything retired first answers with Deprecation and Sunset headers, at least six months ahead. Clients must ignore unknown fields, treat ids as opaque and enums as open, and match errors on `error.code`.",
    "title": "OrderPilot API",
    "version": "1.27.0"
  },
  "openapi": "3.0.3",
  "paths": {
    "/activity": {
      "get": {
        "description": "A purchase order’s, product template’s, option’s, category’s, vendor’s, brand’s or location’s Activity card: who changed what and when, each change with its before and after, and the comments, newest first (the 200 newest, as the card shows them). An entry with a `version` can be restored to (`restorable`). Without See costs the cost changes are left out (`costs_hidden` says so). Reading needs what reading the record needs: a purchase order or vendor Read purchase orders, a template, option or category Read the catalog, a brand or location Read settings. API keys need **Read purchase orders** or **Manage purchase orders** or **Read the catalog** or **Change the catalog** or **Read settings** or **Change settings**.",
        "operationId": "record_activity",
        "parameters": [
          {
            "description": "Which kind of record: `purchase_order`, `product_template`, `option`, `category`, `vendor`, `brand` or `location`.",
            "in": "query",
            "name": "record_type",
            "required": true,
            "schema": {
              "enum": [
                "purchase_order",
                "product_template",
                "option",
                "category",
                "vendor",
                "brand",
                "location"
              ],
              "type": "string"
            }
          },
          {
            "description": "The record’s id, from its own list (the purchase orders, product templates, options, categories, vendors or brands); a location’s is its Shopify location id, as the locations list gives it (`gid://shopify/Location/123`, or `123`).",
            "in": "query",
            "name": "record_id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Entries per page, 1–50 (default 25). A larger value is clamped to 50.",
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 25,
              "maximum": 50,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "description": "The `next_cursor` of the previous page.",
            "in": "query",
            "name": "cursor",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RecordActivityList"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "See a record’s activity",
        "x-rate-weight": 1,
        "x-required-scopes": [
          "PURCHASING_READ",
          "PURCHASING_WRITE",
          "CATALOG_READ",
          "CATALOG_WRITE",
          "SETTINGS_READ",
          "SETTINGS_WRITE"
        ],
        "x-stability": "stable"
      }
    },
    "/activity/comments": {
      "post": {
        "description": "Add a comment to the record’s Activity card, as this caller. Needs what changing the record needs: a purchase order or vendor Manage purchase orders, a template, option or category Change the catalog, a brand or location Change settings. API keys need **Manage purchase orders** or **Change the catalog** or **Change settings**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice.",
        "operationId": "record_comment_create",
        "parameters": [
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RecordCommentCreate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RecordActivityEntry"
                }
              }
            },
            "description": "Created"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Comment on a record",
        "x-rate-weight": 5,
        "x-required-scopes": [
          "PURCHASING_WRITE",
          "CATALOG_WRITE",
          "SETTINGS_WRITE"
        ],
        "x-stability": "stable"
      }
    },
    "/activity/restore": {
      "get": {
        "description": "What restoring the record to version `revision` would change, as the Activity card’s Restore dialog shows it: each field now and after, warnings (changes made outside the activity, which the restore undoes too), and `blocked_reason` when it can’t be restored, or not by this caller. Send its `version` with `POST /activity/restore`. Needs what changing the record needs (Manage purchase orders for a purchase order or vendor, Change the catalog for a template, option or category, Change settings for a brand or location), and what the version changes back: a selling price Change the catalog, a cost Enter and correct costs, a vendor’s minimum order value See costs. The preview’s `blocked_reason` says what is missing. API keys need **Read purchase orders** or **Manage purchase orders** or **Read the catalog** or **Change the catalog** or **Read settings** or **Change settings**.",
        "operationId": "record_restore_preview",
        "parameters": [
          {
            "description": "Which kind of record: `purchase_order`, `product_template`, `option`, `category`, `vendor`, `brand` or `location`.",
            "in": "query",
            "name": "record_type",
            "required": true,
            "schema": {
              "enum": [
                "purchase_order",
                "product_template",
                "option",
                "category",
                "vendor",
                "brand",
                "location"
              ],
              "type": "string"
            }
          },
          {
            "description": "The record’s id, from its own list (the purchase orders, product templates, options, categories, vendors or brands); a location’s is its Shopify location id, as the locations list gives it (`gid://shopify/Location/123`, or `123`).",
            "in": "query",
            "name": "record_id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "The version to go back to: an entry’s `version` from the record’s activity feed (one whose `restorable` is true).",
            "in": "query",
            "name": "revision",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ActivityRestorePreview"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Preview a record restore",
        "x-rate-weight": 1,
        "x-required-scopes": [
          "PURCHASING_READ",
          "PURCHASING_WRITE",
          "CATALOG_READ",
          "CATALOG_WRITE",
          "SETTINGS_READ",
          "SETTINGS_WRITE"
        ],
        "x-stability": "stable"
      },
      "post": {
        "description": "Restore the record to an earlier version, as the Activity card’s Restore does: written through the record’s own edit and recorded in its activity as restored, by this caller. Send the `version` (or `revision` and `token`) of `GET /activity/restore`: a record changed since is `409 CONFLICT` with the preview’s `version` now. `422 RULE_REFUSED` when the version can’t be rebuilt or the record refuses it (a deleted brand image, a vendor minimum). Needs what changing the record needs (Manage purchase orders, Change the catalog or Change settings, by kind), and the right for a price, cost or minimum it changes back: the preview’s `blocked_reason` says which. API keys need **Manage purchase orders** or **Change the catalog** or **Change settings**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice.",
        "operationId": "record_restore",
        "parameters": [
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RecordRestoreInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ActivityRestored"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Restore a record version",
        "x-rate-weight": 5,
        "x-required-scopes": [
          "PURCHASING_WRITE",
          "CATALOG_WRITE",
          "SETTINGS_WRITE"
        ],
        "x-stability": "stable"
      }
    },
    "/brands": {
      "get": {
        "description": "The store’s brands in the order set in Settings, each with its locations, and the locations that have no brand. API keys need **Read quotes** or **Read orders** or **Create and change quotes** or **Change orders** or **Read settings** or **Change settings**.",
        "operationId": "brands",
        "parameters": [],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BrandList"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "List brands",
        "x-rate-weight": 1,
        "x-required-scopes": [
          "QUOTES_READ",
          "ORDERS_READ",
          "QUOTES_WRITE",
          "ORDERS_WRITE",
          "SETTINGS_READ",
          "SETTINGS_WRITE"
        ],
        "x-stability": "stable"
      },
      "post": {
        "description": "Add a brand (placed last). Needs the store-settings right and “Group locations by brand” turned on. API keys need **Change settings**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "brand_create",
        "parameters": [
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BrandCreate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Brand"
                }
              }
            },
            "description": "Created"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Create a brand",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "SETTINGS_SHOP",
          "label": "Manage shop settings"
        },
        "x-required-scopes": ["SETTINGS_WRITE"],
        "x-stability": "stable"
      }
    },
    "/brands/images": {
      "post": {
        "description": "Upload a brand image to Shopify Files. Send multipart/form-data with the image in a `file` part (an image, up to 5 MB). Nothing is saved on a brand: set it with `POST /brands/{id}/image`, or remove it with `POST /brands/images/cleanup`. `url` is null while `pending` (Shopify is still processing the file). Needs the store-settings right. API keys need **Change settings**. Phones see only what their staff member’s role reaches.",
        "operationId": "brand_image_upload",
        "parameters": [],
        "requestBody": {
          "content": {
            "multipart/form-data": {
              "schema": {
                "$ref": "#/components/schemas/Object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BrandImageUploaded"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Upload a brand image",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "SETTINGS_SHOP",
          "label": "Manage shop settings"
        },
        "x-required-scopes": ["SETTINGS_WRITE"],
        "x-stability": "stable"
      }
    },
    "/brands/images/cleanup": {
      "post": {
        "description": "Delete an uploaded image file from Shopify when no brand holds it, for an upload that wasn’t used (409 when a brand holds it). Needs the store-settings right. API keys need **Change settings**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "brand_image_cleanup",
        "parameters": [
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BrandImageCleanup"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BrandImageCleaned"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Clean up unused images",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "SETTINGS_SHOP",
          "label": "Manage shop settings"
        },
        "x-required-scopes": ["SETTINGS_WRITE"],
        "x-stability": "stable"
      }
    },
    "/brands/images/from-url": {
      "post": {
        "description": "Upload a brand image to Shopify Files from its address, as the upload does (for a caller that can’t send multipart form data, such as an agent on MCP): a JPEG, PNG, WebP or GIF of up to 5 MB (the bytes decide; SVG is refused), fetched from a public https address (a private or local address is refused, and so is one that redirects there). Nothing is saved on a brand: set it with `POST /brands/{id}/image` (its `upload_token` too), or remove it with `POST /brands/images/cleanup`. `url` is null while `pending`. Needs the store-settings right. API keys need **Change settings**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "brand_image_from_url",
        "parameters": [
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BrandImageFromUrl"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BrandImageUploaded"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Upload a brand image from a URL",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "SETTINGS_SHOP",
          "label": "Manage shop settings"
        },
        "x-required-scopes": ["SETTINGS_WRITE"],
        "x-stability": "stable"
      }
    },
    "/brands/locations/reorder": {
      "post": {
        "description": "Put one brand’s locations (or the unassigned ones, brand_id null) in this order; a location from another group named here moves in. Moving one in needs that location in the caller’s reach, as `PATCH /settings/locations/{id}` does (`403 ACCESS_DENIED` naming it); putting the group’s own locations in order doesn’t. API keys need **Change settings**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "brand_locations_reorder",
        "parameters": [
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BrandLocationsReorder"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BrandList"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Reorder a brand’s locations",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "SETTINGS_SHOP",
          "label": "Manage shop settings"
        },
        "x-required-scopes": ["SETTINGS_WRITE"],
        "x-stability": "stable"
      }
    },
    "/brands/reorder": {
      "post": {
        "description": "Put the brands in this order. `ordered_ids` must name every brand, or the list is out of date (409). API keys need **Change settings**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "brands_reorder",
        "parameters": [
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BrandsReorder"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BrandList"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Reorder brands",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "SETTINGS_SHOP",
          "label": "Manage shop settings"
        },
        "x-required-scopes": ["SETTINGS_WRITE"],
        "x-stability": "stable"
      }
    },
    "/brands/{id}": {
      "delete": {
        "description": "Delete a brand: its locations become unassigned, and templates tied to it become available everywhere. API keys need **Change settings**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "brand_delete",
        "parameters": [
          {
            "description": "The brand’s `id` from `GET /brands`.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BrandDeleted"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Delete a brand",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "SETTINGS_SHOP",
          "label": "Manage shop settings"
        },
        "x-required-scopes": ["SETTINGS_WRITE"],
        "x-stability": "stable"
      },
      "patch": {
        "description": "Rename a brand or set its colour. The image is changed in Settings, not here. API keys need **Change settings**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "brand_update",
        "parameters": [
          {
            "description": "The brand’s `id` from `GET /brands`.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BrandUpdate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Brand"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Change a brand",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "SETTINGS_SHOP",
          "label": "Manage shop settings"
        },
        "x-required-scopes": ["SETTINGS_WRITE"],
        "x-stability": "stable"
      }
    },
    "/brands/{id}/image": {
      "post": {
        "description": "Set a brand’s image from an upload (`image_url` and `image_file_id`, together), or clear it (both null). The image URL must be a Shopify Files URL (https://cdn.shopify.com/s/files/…, as the upload answers); any other host is refused. Only the fields sent change. A replaced image’s file stays in Shopify. Needs the store-settings right. API keys need **Change settings**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "brand_image_set",
        "parameters": [
          {
            "description": "The brand’s `id` from `GET /brands`.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BrandImageSet"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Brand"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Set a brand’s image",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "SETTINGS_SHOP",
          "label": "Manage shop settings"
        },
        "x-required-scopes": ["SETTINGS_WRITE"],
        "x-stability": "stable"
      }
    },
    "/bundles": {
      "get": {
        "description": "The store’s option bundles (Settings › Options › Bundles), oldest first: named sets of options that templates follow, with how many templates follow each and how many changed something it set. API keys need **Read the catalog**.",
        "operationId": "bundles",
        "parameters": [
          {
            "description": "Items per page, 1–50 (default 25). A larger value is clamped to 50.",
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 25,
              "maximum": 50,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "description": "The `next_cursor` of the previous page of this list. A cursor from another list is `400 INVALID_CURSOR`.",
            "in": "query",
            "name": "cursor",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BundleList"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "List bundles",
        "x-rate-weight": 1,
        "x-required-scopes": ["CATALOG_READ"],
        "x-stability": "stable"
      },
      "post": {
        "description": "Create a bundle, as Settings › Options › Bundles does, with its options in order. A name the store already has is `409 CONFLICT`. Nothing follows it until it is attached to a template (`POST /product-templates/{id}/options` with `bundle_id`). `201` with the bundle. API keys need **Change the catalog**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "bundle_create",
        "parameters": [
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BundleCreate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Bundle"
                }
              }
            },
            "description": "Created"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Create a bundle",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "CATALOG_MANAGE",
          "label": "Manage the catalog"
        },
        "x-required-scopes": ["CATALOG_WRITE"],
        "x-stability": "stable"
      }
    },
    "/bundles/{id}": {
      "delete": {
        "description": "Delete a bundle, as Settings › Options › Bundles does: every template following it keeps the options it changed as its own and loses the ones it never changed, and syncs to Shopify. It can’t be undone. Needs Delete records as well, and counts against the key’s deletes a day. API keys need **Change the catalog**, and **Delete records**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "bundle_delete",
        "parameters": [
          {
            "description": "The bundle’s `id` from `GET /bundles`.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BundleDeleted"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Delete a bundle",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "CATALOG_MANAGE",
          "label": "Manage the catalog"
        },
        "x-required-scopes": ["CATALOG_WRITE"],
        "x-required-scopes-all": ["DELETE"],
        "x-stability": "stable"
      },
      "get": {
        "description": "One bundle with its options in order (required, the values it offers, its rules) and the templates following it (whether each changed something the bundle set). API keys need **Read the catalog**.",
        "operationId": "bundle",
        "parameters": [
          {
            "description": "The bundle’s `id` from `GET /bundles`.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Bundle"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get a bundle",
        "x-rate-weight": 1,
        "x-required-scopes": ["CATALOG_READ"],
        "x-stability": "stable"
      },
      "patch": {
        "description": "Rename a bundle, change its description or the order of its options. Send its `version` (or its `updated_at` as `expected_updated_at`): a rename or a new description made since is `409 STALE_VERSION` with the current `version`. A new order reaches every template following it. Answers the bundle. API keys need **Change the catalog**. An `Idempotency-Key` header makes a retry safe: the same key and body returns the first answer. Phones see only what their staff member’s role reaches.",
        "operationId": "bundle_edit",
        "parameters": [
          {
            "description": "The bundle’s `id` from `GET /bundles`.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BundleEdit"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Bundle"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Change a bundle",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "CATALOG_MANAGE",
          "label": "Manage the catalog"
        },
        "x-required-scopes": ["CATALOG_WRITE"],
        "x-stability": "stable"
      }
    },
    "/bundles/{id}/options": {
      "post": {
        "description": "Add an option of the library to a bundle, last, with what the bundle sets for it: every template following the bundle gets it (but a locked one). Already in the bundle is `409 CONFLICT`. Answers the bundle; the templates sync in the background. API keys need **Change the catalog**. An `Idempotency-Key` header makes a retry safe: the same key and body returns the first answer. Phones see only what their staff member’s role reaches.",
        "operationId": "bundle_option_add",
        "parameters": [
          {
            "description": "The bundle’s `id` from `GET /bundles`.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BundleOptionAdd"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Bundle"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Add an option to a bundle",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "CATALOG_MANAGE",
          "label": "Manage the catalog"
        },
        "x-required-scopes": ["CATALOG_WRITE"],
        "x-stability": "stable"
      }
    },
    "/bundles/{id}/options/{fieldId}": {
      "delete": {
        "description": "Take an option out of a bundle: templates following it lose the option where they never changed it and keep it as their own where they did. Answers what was removed and the bundle. API keys need **Change the catalog**. An `Idempotency-Key` header makes a retry safe: the same key and body returns the first answer. Phones see only what their staff member’s role reaches.",
        "operationId": "bundle_option_remove",
        "parameters": [
          {
            "description": "The bundle’s `id` from `GET /bundles`.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "An option in the bundle: an `options[].field_id` of `GET /bundles/{id}`.",
            "in": "path",
            "name": "fieldId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BundleOptionRemoved"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Remove an option from a bundle",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "CATALOG_MANAGE",
          "label": "Manage the catalog"
        },
        "x-required-scopes": ["CATALOG_WRITE"],
        "x-stability": "stable"
      },
      "patch": {
        "description": "Change what a bundle sets for one of its options: required, the values it offers, its rules. Templates following the bundle read it at once, except where a template set its own. Only what is sent changes. Answers the bundle. API keys need **Change the catalog**. An `Idempotency-Key` header makes a retry safe: the same key and body returns the first answer. Phones see only what their staff member’s role reaches.",
        "operationId": "bundle_option_edit",
        "parameters": [
          {
            "description": "The bundle’s `id` from `GET /bundles`.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "An option in the bundle: an `options[].field_id` of `GET /bundles/{id}`.",
            "in": "path",
            "name": "fieldId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BundleOptionEdit"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Bundle"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Change a bundle’s option",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "CATALOG_MANAGE",
          "label": "Manage the catalog"
        },
        "x-required-scopes": ["CATALOG_WRITE"],
        "x-stability": "stable"
      }
    },
    "/categories": {
      "get": {
        "description": "The store’s product categories (Settings › Products › Categories), A to Z by name, every level in one list: each with its parent, its level and its full `label` (“Game Room › Pool Tables”), and the rules its products follow (additional terms, the signature and deposit before an order is placed). Open to any signed-in staff, as in the admin, and to a key that reads or changes the catalog. API keys need **Read the catalog** or **Change the catalog**.",
        "operationId": "categories",
        "parameters": [
          {
            "description": "Items per page, 1–50 (default 25).",
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 25,
              "maximum": 50,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "description": "The `next_cursor` of the previous page.",
            "in": "query",
            "name": "cursor",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Search, as the Categories page does: every word must be found in the name or the description (up to 100 characters).",
            "in": "query",
            "name": "q",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Only the categories directly under this one.",
            "in": "query",
            "name": "parent_id",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CategoryList"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "List categories",
        "x-rate-weight": 1,
        "x-required-scopes": ["CATALOG_READ", "CATALOG_WRITE"],
        "x-stability": "stable"
      },
      "post": {
        "description": "Add a category, at the top or under `parent_id`, with the checks Settings › Products › Categories runs. A name is unique among the categories under the same parent (`409 CONFLICT`, with the one that has it as `existing_id`), and categories nest at most three levels deep. A store has at most 500 categories, subcategories included (`422 CAP_REACHED`). Needs Manage the catalog (a key: Change the catalog). API keys need **Change the catalog**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Use a `categories` import draft (`POST /imports`) for existing records, even one, unless asked otherwise. Outside an import, create from requests or email signatures directly. Phones see only what their staff member’s role reaches.",
        "operationId": "category_create",
        "parameters": [
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CategoryCreate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Category"
                }
              }
            },
            "description": "Created"
          },
          "202": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReadBackPending"
                }
              }
            },
            "description": "Accepted: the write is done, but its record couldn’t be read back. Don’t send it again: read it with `read`."
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Create a category",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "CATALOG_MANAGE",
          "label": "Manage the catalog"
        },
        "x-required-scopes": ["CATALOG_WRITE"],
        "x-stability": "stable"
      }
    },
    "/categories/{id}": {
      "delete": {
        "description": "Delete a category, as Settings › Products › Categories’ Delete does: its subcategories move to the top level, its templates are left without it (their Shopify product type follows a few seconds later), and its warranty rules and activity go with it. Needs Manage the catalog (a key: Change the catalog and Delete records). It can’t be undone, and counts against the key’s Deletes per day cap. API keys need **Change the catalog**, and **Delete records**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "category_delete",
        "parameters": [
          {
            "description": "The id from a list.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CategoryDeleted"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Delete a category",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "CATALOG_MANAGE",
          "label": "Manage the catalog"
        },
        "x-required-scopes": ["CATALOG_WRITE"],
        "x-required-scopes-all": ["DELETE"],
        "x-stability": "stable"
      },
      "get": {
        "description": "One category. API keys need **Read the catalog** or **Change the catalog**.",
        "operationId": "category",
        "parameters": [
          {
            "description": "The id from a list.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Category"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get a category",
        "x-rate-weight": 1,
        "x-required-scopes": ["CATALOG_READ", "CATALOG_WRITE"],
        "x-stability": "stable"
      },
      "patch": {
        "description": "Change a category; only the fields sent change. `parent_id` moves it (with its subcategories), `null` to the top. A name is unique among the categories under the same parent (`409 CONFLICT`, with the one that has it as `existing_id`), and categories nest at most three levels deep. A new name or parent changes the Shopify product type of the templates in it, which follows a few seconds later. Recorded in the category’s activity. Needs Manage the catalog (a key: Change the catalog). API keys need **Change the catalog**. An `Idempotency-Key` header makes a retry safe: the same key and body returns the first answer. Phones see only what their staff member’s role reaches.",
        "operationId": "category_edit",
        "parameters": [
          {
            "description": "The id from a list.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CategoryEdit"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Category"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Change a category",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "CATALOG_MANAGE",
          "label": "Manage the catalog"
        },
        "x-required-scopes": ["CATALOG_WRITE"],
        "x-stability": "stable"
      }
    },
    "/companies": {
      "get": {
        "description": "The store’s Shopify B2B companies whose name starts with the words of `q` (up to 25), for `company_id` on `PATCH /customers/{id}`, as the profile’s company picker finds them. A store without Shopify B2B has none. API keys need **Create and change customers**. Phones see only what their staff member’s role reaches.",
        "operationId": "companies",
        "parameters": [
          {
            "description": "The start of each word of the name (up to 100 characters). Left out: the first 25.",
            "in": "query",
            "name": "q",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CompanyList"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "List B2B companies",
        "x-rate-weight": 1,
        "x-required-permission": {
          "id": "ORDERS_EDIT",
          "label": "Create and edit quotes and orders"
        },
        "x-required-scopes": ["CUSTOMERS_WRITE"],
        "x-stability": "stable"
      }
    },
    "/conversations": {
      "get": {
        "description": "The Inbox: conversations with customers (orders and quotes) and vendors (purchase orders), in a tab and its filters, newest first, with the ones that need a reply first on Open. An API key sees the customer half, and the vendor half too with Read purchase orders; it is no one, so `tab=mine` and `unread` are refused (`STAFF_ONLY`) and each row’s `unread` is 0: use `needs_reply`. API keys need **Read the Inbox** or **Work the Inbox**.",
        "operationId": "conversations",
        "parameters": [
          {
            "description": "Items per page, 1–50 (default 25). A larger value is clamped to 50.",
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 25,
              "maximum": 50,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "description": "The `next_cursor` of the previous page of this list. A cursor from another list is `400 INVALID_CURSOR`.",
            "in": "query",
            "name": "cursor",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "open (default), mine, needs_reply, waiting, unassigned, closed or all (any case). `mine` is a staff member’s own. Any other value is `400 INVALID_PARAMETER`.",
            "in": "query",
            "name": "tab",
            "required": false,
            "schema": {
              "type": "string",
              "x-values": [
                "open",
                "mine",
                "needs_reply",
                "waiting",
                "unassigned",
                "closed",
                "all"
              ]
            }
          },
          {
            "description": "all (default), customers or vendors. Any other value is a 400.",
            "in": "query",
            "name": "segment",
            "required": false,
            "schema": {
              "type": "string",
              "x-values": ["all", "customers", "vendors"]
            }
          },
          {
            "description": "order, quote or po. Any other value is a 400.",
            "in": "query",
            "name": "type",
            "required": false,
            "schema": {
              "type": "string",
              "x-values": ["order", "quote", "po"]
            }
          },
          {
            "description": "true: only conversations with replies this person hasn’t seen (a staff member’s own).",
            "in": "query",
            "name": "unread",
            "required": false,
            "schema": {
              "type": "string",
              "x-values": ["true", "1"]
            }
          },
          {
            "description": "true: only those whose last reply from someone on file is unanswered.",
            "in": "query",
            "name": "awaiting",
            "required": false,
            "schema": {
              "type": "string",
              "x-values": ["true", "1"]
            }
          },
          {
            "description": "true: only those past the store’s reply time goal.",
            "in": "query",
            "name": "overdue",
            "required": false,
            "schema": {
              "type": "string",
              "x-values": ["true", "1"]
            }
          },
          {
            "description": "A staff id from `GET /conversations/assignees`.",
            "in": "query",
            "name": "assignee",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Search (up to 100 characters).",
            "in": "query",
            "name": "q",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "true: also each tab’s count.",
            "in": "query",
            "name": "counts",
            "required": false,
            "schema": {
              "type": "string",
              "x-values": ["true", "1"]
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConversationList"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "List conversations",
        "x-rate-weight": 1,
        "x-required-scopes": ["INBOX_READ", "INBOX_WRITE"],
        "x-stability": "stable"
      }
    },
    "/conversations/assignees": {
      "get": {
        "description": "Who a conversation can be assigned to: staff who can answer customers or vendors. API keys need **Read the Inbox** or **Work the Inbox**.",
        "operationId": "conversation_assignees",
        "parameters": [],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConversationAssignees"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "List assignees",
        "x-rate-weight": 1,
        "x-required-scopes": ["INBOX_READ", "INBOX_WRITE"],
        "x-stability": "stable"
      }
    },
    "/conversations/unread": {
      "get": {
        "description": "How many conversations have replies new to this person (the badge). Signed-in staff only: an API key is refused (unread is per person). Signed-in staff only: an API key is refused with `STAFF_ONLY`.",
        "operationId": "conversations_unread",
        "parameters": [],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConversationUnread"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Count unread conversations",
        "x-rate-weight": 1,
        "x-stability": "stable",
        "x-staff-only": true
      }
    },
    "/conversations/{id}/assign": {
      "post": {
        "description": "Assign a conversation to a staff member (or no one). The assignee must be able to answer it and reach its record; the caller needs what `POST /conversations/{id}/status` needs. API keys need **Work the Inbox**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice.",
        "operationId": "conversation_assign",
        "parameters": [
          {
            "description": "The conversation’s `conversation_id` or its `key` (`order:<id>`, `po:<id>`) from the list.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ConversationAssign"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConversationAssigned"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Assign a conversation",
        "x-rate-weight": 5,
        "x-required-scopes": ["INBOX_WRITE"],
        "x-stability": "stable"
      }
    },
    "/conversations/{id}/status": {
      "post": {
        "description": "Set a conversation `open`, `waiting` or `closed`. Needs the permission that answers it, on a record the caller can change: an API key answers customers on the portal with Work the Inbox, by email (the portal off) with Send emails, and vendors with Manage purchase orders. API keys need **Work the Inbox**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice.",
        "operationId": "conversation_status",
        "parameters": [
          {
            "description": "The conversation’s `conversation_id` or its `key` (`order:<id>`, `po:<id>`) from the list.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ConversationStatus"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConversationStatusChanged"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Change a conversation’s status",
        "x-rate-weight": 5,
        "x-required-scopes": ["INBOX_WRITE"],
        "x-stability": "stable"
      }
    },
    "/conversations/{key}": {
      "get": {
        "description": "One conversation: its record (the order, quote or purchase order, its lines and money, the customer or vendor) and its messages. `key` is `order:<id>` or `po:<id>`, as the list gives it. An API key reads a vendor’s with Read purchase orders. API keys need **Read the Inbox** or **Work the Inbox**. Preview: this endpoint’s shape may still change inside v1.",
        "operationId": "conversation",
        "parameters": [
          {
            "description": "`order:<id>` or `po:<id>`, from the list.",
            "in": "path",
            "name": "key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConversationDetail"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get a conversation",
        "x-rate-weight": 1,
        "x-required-scopes": ["INBOX_READ", "INBOX_WRITE"],
        "x-stability": "preview"
      }
    },
    "/conversations/{key}/attachments": {
      "post": {
        "description": "Upload one photo (JPEG, PNG or WebP) or PDF, up to 10 MB, for a customer portal reply. Send multipart/form-data with the file in a `file` field (not JSON, so no Idempotency-Key: an upload that is never named in a reply expires in a day). Answers 201 with the `id` to put in the reply's `attachment_ids`. Up to 5 files a reply and 10 waiting. Needs Handle customer messages on an order the person can change, with the customer portal on; vendor replies carry no files. API keys need **Work the Inbox**.",
        "operationId": "conversation_attachment_upload",
        "parameters": [
          {
            "description": "`order:<id>` or `po:<id>`, from the conversation list.",
            "in": "path",
            "name": "key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "multipart/form-data": {
              "schema": {
                "$ref": "#/components/schemas/Object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConversationAttachment"
                }
              }
            },
            "description": "Created"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Upload a file",
        "x-rate-weight": 5,
        "x-required-scopes": ["INBOX_WRITE"],
        "x-stability": "stable"
      }
    },
    "/conversations/{key}/attachments/from-url": {
      "post": {
        "description": "Upload one photo (JPEG, PNG or WebP) or PDF, up to 10 MB, for a customer portal reply from its address, as the upload does (for a caller that can’t send multipart form data, such as an agent on MCP), fetched from a public https address (a private or local address is refused, and so is one that redirects there). Answers 201 with the `id` to put in the reply's `attachment_ids`; an upload that is never named in a reply expires in a day. Up to 5 files a reply and 10 waiting. Needs Handle customer messages on an order the person can change, with the customer portal on; vendor replies carry no files. API keys need **Work the Inbox**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice.",
        "operationId": "conversation_attachment_from_url",
        "parameters": [
          {
            "description": "`order:<id>` or `po:<id>`, from the conversation list.",
            "in": "path",
            "name": "key",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/FileFromUrl"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConversationAttachment"
                }
              }
            },
            "description": "Created"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Upload a reply file from a URL",
        "x-rate-weight": 5,
        "x-required-scopes": ["INBOX_WRITE"],
        "x-stability": "stable"
      }
    },
    "/conversations/{key}/attachments/{uploadId}/discard": {
      "post": {
        "description": "Take an uploaded file out before it is sent, so it stops counting against the files that may wait. The same answer whether or not there was such a file of this person's. API keys need **Work the Inbox**. An `Idempotency-Key` header makes a retry safe: the same key and body returns the first answer.",
        "operationId": "conversation_attachment_discard",
        "parameters": [
          {
            "description": "`order:<id>` or `po:<id>`, from the conversation list.",
            "in": "path",
            "name": "key",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "The `id` the upload answered.",
            "in": "path",
            "name": "uploadId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConversationAttachmentDiscarded"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Discard an upload",
        "x-rate-weight": 5,
        "x-required-scopes": ["INBOX_WRITE"],
        "x-stability": "stable"
      }
    },
    "/conversations/{key}/messages/{messageId}/attachments/{attachmentId}": {
      "get": {
        "description": "A short-lived link to one file on a message of the thread (the ids come from the conversation's `thread`). Needs View quotes and orders (or View purchase orders) on a record the person can see. API keys need **Read the Inbox** or **Work the Inbox**.",
        "operationId": "conversation_attachment_url",
        "parameters": [
          {
            "description": "`order:<id>` or `po:<id>`, from the conversation list.",
            "in": "path",
            "name": "key",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "The message `id` in the thread.",
            "in": "path",
            "name": "messageId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "The attachment `id` on that message.",
            "in": "path",
            "name": "attachmentId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConversationAttachmentUrl"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get an attachment link",
        "x-rate-weight": 1,
        "x-required-scopes": ["INBOX_READ", "INBOX_WRITE"],
        "x-stability": "stable"
      }
    },
    "/conversations/{key}/messages/{messageId}/original": {
      "get": {
        "description": "A message’s original email as it arrived (or went out), as the thread’s Show original: its HTML, rebuilt from an allow-list first (no scripts, frames, forms, event handlers or remote styles), the same rule the app’s own viewer applies. A message with no HTML is `404`; one too large or complex to show safely is `422 ORIGINAL_TOO_LARGE` (its text is in the conversation). Needs View quotes and orders (or View purchase orders) on a record the person can see; an API key reads a vendor’s with Read purchase orders as well. API keys need **Read the Inbox** or **Work the Inbox**.",
        "operationId": "conversation_message_original",
        "parameters": [
          {
            "description": "`order:<id>` or `po:<id>`, from the conversation list.",
            "in": "path",
            "name": "key",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "The message `id` in the conversation’s thread (`GET /conversations/{key}`).",
            "in": "path",
            "name": "messageId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmailOriginal"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get an email’s original",
        "x-rate-weight": 1,
        "x-required-scopes": ["INBOX_READ", "INBOX_WRITE"],
        "x-stability": "stable"
      }
    },
    "/conversations/{key}/notes": {
      "post": {
        "description": "Add an internal note (only staff see it). The record needs a first email in its thread. A key’s note is signed with the key’s name. API keys need **Work the Inbox**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice.",
        "operationId": "conversation_note",
        "parameters": [
          {
            "description": "`order:<id>` or `po:<id>`, from the list.",
            "in": "path",
            "name": "key",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ConversationNoteCreate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConversationNote"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Add a note to a conversation",
        "x-rate-weight": 5,
        "x-required-scopes": ["INBOX_WRITE"],
        "x-stability": "stable"
      }
    },
    "/conversations/{key}/reply": {
      "post": {
        "description": "Answer a conversation. A customer (an order or quote) is answered on the customer portal while it is on (with files uploaded by POST /conversations/{key}/attachments), else by email to the message answered; `channel` picks one. A vendor (a purchase order) is answered by email, no files. Needs Handle customer messages (portal), Email customers (email to a customer) or Send and cancel purchase orders (vendor), on a record the person can change. A key needs Work the Inbox (a vendor thread: Manage purchase orders) and Send emails. Refused when the store cannot send email or there is nothing to answer yet. A retry with the same Idempotency-Key never sends twice. From an API key the customer sees the store as the sender, the key is named in the activity, and each reply counts against the key’s Emails per day cap. API keys need **Work the Inbox** or **Manage purchase orders**, and **Send emails**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice.",
        "operationId": "conversation_reply",
        "parameters": [
          {
            "description": "`order:<id>` or `po:<id>`, from the conversation list.",
            "in": "path",
            "name": "key",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ConversationReply"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConversationReplied"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Reply to a conversation",
        "x-rate-weight": 5,
        "x-required-scopes": ["INBOX_WRITE", "PURCHASING_WRITE"],
        "x-required-scopes-all": ["EMAILS_SEND"],
        "x-stability": "stable"
      }
    },
    "/conversations/{key}/seen": {
      "post": {
        "description": "Mark the conversation as read by the signed-in person, so its replies so far stop counting in `GET /conversations/unread` and the `unread` filter. Opening a conversation (`GET`) never does this. Send `shown_message_ids` to mark only the messages the screen showed (a reply stored after them stays unread). Needs View quotes and orders (or View purchase orders) on a record the person can see. Repeating it is harmless. Signed-in staff only: an API key is refused (read is per person). Signed-in staff only: an API key is refused with `STAFF_ONLY`. An `Idempotency-Key` header makes a retry safe: the same key and body returns the first answer.",
        "operationId": "conversation_seen",
        "parameters": [
          {
            "description": "`order:<id>` or `po:<id>`, from the conversation list.",
            "in": "path",
            "name": "key",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ConversationSeenBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConversationSeen"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Mark a conversation as read",
        "x-rate-weight": 5,
        "x-stability": "stable",
        "x-staff-only": true
      }
    },
    "/countries": {
      "get": {
        "description": "Every country Shopify takes on an address, A to Z, as the address forms’ Country picker lists them: its code (what an address’s `country` takes) and name, and for Canada and the United States the provinces and states to pick from (their codes are what `province` takes; another country’s is typed). `502 SHOPIFY_UNAVAILABLE` when Shopify’s list can’t be read. Needs View quotes and orders, as the forms do (a key: any scope that holds it, such as Read quotes, Read orders or Create and change customers). API keys need **Read quotes** or **Create and change quotes** or **Read orders** or **Change orders** or **Create and change customers** or **Read the Inbox** or **Work the Inbox** or **Read warranty claims** or **Work warranty claims** or **Record and request payments** or **Refunds and returns** or **Send emails** or **Delete records** or **Prices and exceptions** or **Change sales credit**. Phones see only what their staff member’s role reaches.",
        "operationId": "countries",
        "parameters": [],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CountryList"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "List countries",
        "x-rate-weight": 1,
        "x-required-permission": {
          "id": "ORDERS_VIEW",
          "label": "View quotes and orders"
        },
        "x-required-scopes": [
          "QUOTES_READ",
          "QUOTES_WRITE",
          "ORDERS_READ",
          "ORDERS_WRITE",
          "CUSTOMERS_WRITE",
          "INBOX_READ",
          "INBOX_WRITE",
          "WARRANTY_READ",
          "WARRANTY_WRITE",
          "PAYMENTS_WRITE",
          "REFUNDS_WRITE",
          "EMAILS_SEND",
          "DELETE",
          "PRICING_WRITE",
          "COMMISSION_WRITE"
        ],
        "x-stability": "stable"
      }
    },
    "/custom-fields": {
      "get": {
        "description": "The shop’s order-level custom fields (Settings › Custom fields) that a quote or order can carry. API keys need **Read quotes** or **Read orders**. Phones see only what their staff member’s role reaches.",
        "operationId": "custom_fields",
        "parameters": [],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CustomFieldList"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "List custom fields",
        "x-rate-weight": 1,
        "x-required-permission": {
          "id": "ORDERS_VIEW",
          "label": "View quotes and orders"
        },
        "x-required-scopes": ["QUOTES_READ", "ORDERS_READ"],
        "x-stability": "stable"
      }
    },
    "/customer-data-requests": {
      "get": {
        "description": "The customer data requests Shopify sent for this store (a customer asking for their data), newest first, up to 100, as Settings › Account and data › Customer data lists them: who asked, how many orders, when, when the file was last downloaded, and the file’s state (`none`, `preparing`, `ready`, `failed`). `id` reads one request: poll it while its file is `preparing`. Needs Privacy requests (a key: Export customer data, a sensitive scope ticked on its own). API keys need **Export customer data**. Phones see only what their staff member’s role reaches.",
        "operationId": "customer_data_requests",
        "parameters": [
          {
            "description": "One request only, by its `id`.",
            "in": "query",
            "name": "id",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CustomerDataRequestList"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "List customer data requests",
        "x-rate-weight": 1,
        "x-required-permission": {
          "id": "PRIVACY_REQUESTS",
          "label": "Download customer data requests"
        },
        "x-required-scopes": ["CUSTOMER_DATA_EXPORT"],
        "x-stability": "stable"
      }
    },
    "/customer-data-requests/{id}/export": {
      "get": {
        "description": "A ready file’s name and size and a link to download it through the API (`GET /customer-data-requests/{id}/export/file`), bound to this key: it opens once, within a minute (it stops when the key is revoked; each opening is counted in the key’s usage). Downloading marks the request downloaded, as the admin’s Download does. `409 CONFLICT` while there is no ready file (prepare it first). Needs Privacy requests (a key: Export customer data, a sensitive scope ticked on its own). API keys need **Export customer data**. Phones see only what their staff member’s role reaches.",
        "operationId": "customer_data_export",
        "parameters": [
          {
            "description": "The request’s `id` from `GET /customer-data-requests`.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CustomerDataExportLink"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Open a customer’s data file",
        "x-rate-weight": 1,
        "x-required-permission": {
          "id": "PRIVACY_REQUESTS",
          "label": "Download customer data requests"
        },
        "x-required-scopes": ["CUSTOMER_DATA_EXPORT"],
        "x-stability": "stable"
      },
      "post": {
        "description": "Prepare a request’s file, as Settings › Account and data › Customer data’ Prepare file does: everything OrderPilot holds about the customer, as JSON, built in the background and kept for 7 days. A file already being prepared or ready is left as it is. Answers 202 with the request (`export_state`); poll `GET /customer-data-requests?id=` until it is `ready`, then `GET /customer-data-requests/{id}/export`. `503 FILE_UNAVAILABLE` when it can’t be started now. Needs Privacy requests (a key: Export customer data, a sensitive scope ticked on its own). API keys need **Export customer data**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "customer_data_export_create",
        "parameters": [
          {
            "description": "The request’s `id` from `GET /customer-data-requests`.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Empty"
              }
            }
          },
          "required": false
        },
        "responses": {
          "202": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CustomerDataRequest"
                }
              }
            },
            "description": "Accepted"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Prepare a customer’s data file",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "PRIVACY_REQUESTS",
          "label": "Download customer data requests"
        },
        "x-required-scopes": ["CUSTOMER_DATA_EXPORT"],
        "x-stability": "stable"
      }
    },
    "/customer-data-requests/{id}/export/file": {
      "get": {
        "description": "A request’s file, from the `url` `GET /customer-data-requests/{id}/export` answered: no Authorization header, the link’s `t` is the credential. It is bound to the key that asked for it and opens once, within a minute; a revoked or ended key, a store whose API is off, or a key without Export customer data any more is refused (`401 UNAUTHORIZED` for the link itself). Answers `302` to a storage address that works for one minute and marks the request downloaded, as the admin’s Download does. Each opening is counted in the key’s usage.",
        "operationId": "customer_data_export_file",
        "parameters": [
          {
            "description": "The request’s `id` from `GET /customer-data-requests`.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "The link’s token, as the `url` carries it.",
            "in": "query",
            "name": "t",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CustomerDataFile"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [],
        "summary": "Download a customer’s data file",
        "x-rate-weight": 1,
        "x-stability": "stable"
      }
    },
    "/customers": {
      "get": {
        "description": "Customers, newest change first. API keys need **Read customers**. Phones see only what their staff member’s role reaches.",
        "operationId": "customers",
        "parameters": [
          {
            "description": "Items per page, 1–50 (default 25). A larger value is clamped to 50.",
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 25,
              "maximum": 50,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "description": "The `next_cursor` of the previous page of this list. A cursor from another list is `400 INVALID_CURSOR`.",
            "in": "query",
            "name": "cursor",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Only items changed at or after this time (ISO 8601).",
            "in": "query",
            "name": "updated_since",
            "required": false,
            "schema": {
              "format": "date-time",
              "type": "string"
            }
          },
          {
            "description": "Name, email or phone contains this (2–100 characters).",
            "in": "query",
            "name": "q",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CustomerList"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "List customers",
        "x-rate-weight": 1,
        "x-required-permission": {
          "id": "ORDERS_VIEW",
          "label": "View quotes and orders"
        },
        "x-required-scopes": ["CUSTOMERS_READ"],
        "x-stability": "stable"
      },
      "post": {
        "description": "Create a customer. API keys need **Create and change customers**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Use a `customers` import draft (`POST /imports`) for existing records, even one, unless asked otherwise. Outside an import, create from requests or email signatures directly. Phones see only what their staff member’s role reaches.",
        "operationId": "customer_create",
        "parameters": [
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CustomerCreate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Customer"
                }
              }
            },
            "description": "Created"
          },
          "202": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReadBackPending"
                }
              }
            },
            "description": "Accepted: the write is done, but its record couldn’t be read back. Don’t send it again: read it with `read`."
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Create a customer",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "ORDERS_EDIT",
          "label": "Create and edit quotes and orders"
        },
        "x-required-scopes": ["CUSTOMERS_WRITE"],
        "x-stability": "stable"
      }
    },
    "/customers/{id}": {
      "get": {
        "description": "One customer. API keys need **Read customers**. Phones see only what their staff member’s role reaches.",
        "operationId": "customer",
        "parameters": [
          {
            "description": "The id from a list.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Customer"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get a customer",
        "x-rate-weight": 1,
        "x-required-permission": {
          "id": "ORDERS_VIEW",
          "label": "View quotes and orders"
        },
        "x-required-scopes": ["CUSTOMERS_READ"],
        "x-stability": "stable"
      },
      "patch": {
        "description": "Change a customer, as the admin’s customer edit page saves them in Shopify: name, email, phone, note, tax exemption, a resale certificate’s expiry or removal, the B2B company, and the store’s customer fields (`GET /customers/{id}/profile` lists them with their keys). Only what the body names changes. Answers the customer; read the rest with `GET /customers/{id}/profile`. API keys need **Create and change customers**. An `Idempotency-Key` header makes a retry safe: the same key and body returns the first answer. Phones see only what their staff member’s role reaches.",
        "operationId": "customer_edit",
        "parameters": [
          {
            "description": "The id from a list.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CustomerEdit"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Customer"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Change a customer",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "ORDERS_EDIT",
          "label": "Create and edit quotes and orders"
        },
        "x-required-scopes": ["CUSTOMERS_WRITE"],
        "x-stability": "stable"
      }
    },
    "/customers/{id}/addresses": {
      "get": {
        "description": "A customer’s saved addresses (up to 50), for a record’s ship-to. API keys need **Read customers**. Phones see only what their staff member’s role reaches.",
        "operationId": "customer_addresses",
        "parameters": [
          {
            "description": "The id from a list.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AddressList"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "List a customer’s addresses",
        "x-rate-weight": 1,
        "x-required-permission": {
          "id": "ORDERS_VIEW",
          "label": "View quotes and orders"
        },
        "x-required-scopes": ["CUSTOMERS_READ"],
        "x-stability": "stable"
      },
      "patch": {
        "description": "Change one of a customer’s saved addresses (named by `id` in the body). API keys need **Create and change customers**. An `Idempotency-Key` header makes a retry safe: the same key and body returns the first answer. Phones see only what their staff member’s role reaches.",
        "operationId": "customer_address_edit",
        "parameters": [
          {
            "description": "The id from a list.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AddressInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AddressList"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Change an address",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "ORDERS_EDIT",
          "label": "Create and edit quotes and orders"
        },
        "x-required-scopes": ["CUSTOMERS_WRITE"],
        "x-stability": "stable"
      },
      "post": {
        "description": "Save a new address on a customer. API keys need **Create and change customers**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "customer_address_create",
        "parameters": [
          {
            "description": "The id from a list.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AddressInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AddressList"
                }
              }
            },
            "description": "Created"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Add an address",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "ORDERS_EDIT",
          "label": "Create and edit quotes and orders"
        },
        "x-required-scopes": ["CUSTOMERS_WRITE"],
        "x-stability": "stable"
      }
    },
    "/customers/{id}/addresses/{addressId}": {
      "delete": {
        "description": "Remove one of the customer’s saved addresses from their Shopify address book, as the profile’s address book does. The Main address can’t be removed (`422 ADDRESS_REFUSED`: make another one the default first); a Shipping or Billing address goes back to the Main one. Quotes and orders keep their own copy of an address. Answers the addresses left. API keys need **Create and change customers**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "customer_address_delete",
        "parameters": [
          {
            "description": "The customer’s `id` from `GET /customers`.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "An address `id` from `GET /customers/{id}/addresses` (URL-encoded), or the number at its end.",
            "in": "path",
            "name": "addressId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AddressList"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Remove an address",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "ORDERS_EDIT",
          "label": "Create and edit quotes and orders"
        },
        "x-required-scopes": ["CUSTOMERS_WRITE"],
        "x-stability": "stable"
      }
    },
    "/customers/{id}/documents": {
      "get": {
        "description": "The customer’s documents, newest first, 25 a page, as the profile’s Documents section lists them: OrderPilot quotes, sales orders and drafts the caller can see, or the customer’s Shopify orders (also those placed outside OrderPilot). The first page also has the counts and the summary strip (open quotes, sales orders this year, balance due). An API key needs Read customers and the read scope of the kind: Read quotes for `quotes`, Read orders for `sales_orders` and `shopify_orders`, both for `all` and `drafts`. API keys need **Read quotes** or **Read orders**, and **Read customers**. Phones see only what their staff member’s role reaches.",
        "operationId": "customer_documents",
        "parameters": [
          {
            "description": "The customer’s `id` from `GET /customers`.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "`all` (default: quotes, sales orders and drafts), `quotes`, `sales_orders`, `drafts` or `shopify_orders`.",
            "in": "query",
            "name": "kind",
            "required": false,
            "schema": {
              "enum": [
                "all",
                "quotes",
                "sales_orders",
                "drafts",
                "shopify_orders"
              ],
              "type": "string"
            }
          },
          {
            "description": "The `next_cursor` of the previous page, with the same `kind`.",
            "in": "query",
            "name": "cursor",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CustomerDocumentList"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "List a customer’s documents",
        "x-rate-weight": 1,
        "x-required-permission": {
          "id": "ORDERS_VIEW",
          "label": "View quotes and orders"
        },
        "x-required-scopes": ["QUOTES_READ", "ORDERS_READ"],
        "x-required-scopes-all": ["CUSTOMERS_READ"],
        "x-stability": "stable"
      }
    },
    "/customers/{id}/notes": {
      "post": {
        "description": "Add a note to the customer, as Lookup’s Add note does: a dated line signed with the caller’s name (an API key as “API key: <name>”) on top of the customer’s Shopify note, which staff also see in Shopify admin. Answers the customer’s notes, newest first. `422 NOTES_FULL` (Shopify keeps 5,000 characters: tidy the note first, `PATCH /customers/{id}` with `note`), `422 CUSTOMER_INCOMPLETE`, `502 SHOPIFY_UNAVAILABLE`. Needs Create and edit quotes and orders (a key: Create and change customers). API keys need **Create and change customers**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "customer_note_create",
        "parameters": [
          {
            "description": "The customer’s `id` from `GET /customers`.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/NoteCreate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CustomerNotes"
                }
              }
            },
            "description": "Created"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Add a note to a customer",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "ORDERS_EDIT",
          "label": "Create and edit quotes and orders"
        },
        "x-required-scopes": ["CUSTOMERS_WRITE"],
        "x-stability": "stable"
      }
    },
    "/customers/{id}/profile": {
      "get": {
        "description": "The customer as the admin’s profile shows them, read from Shopify: note, tags, tax exemption and resale certificates, the B2B company, every customer field the store has (with this customer’s value), and the address book with which entry is Main, Shipping and Billing. `orders_count` and `amount_spent` (Shopify’s) need Read orders. A customer not in Shopify yet is `422 CUSTOMER_INCOMPLETE`; Shopify not answering is `502 SHOPIFY_UNAVAILABLE`. API keys need **Read customers**. Phones see only what their staff member’s role reaches.",
        "operationId": "customer_profile",
        "parameters": [
          {
            "description": "The customer’s `id` from `GET /customers`.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CustomerProfile"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get a customer’s profile",
        "x-rate-weight": 1,
        "x-required-permission": {
          "id": "ORDERS_VIEW",
          "label": "View quotes and orders"
        },
        "x-required-scopes": ["CUSTOMERS_READ"],
        "x-stability": "stable"
      }
    },
    "/customers/{id}/resale-certificates": {
      "post": {
        "description": "Put a customer’s resale certificate on file for one US state, as Customers › Tax & resale does: send multipart/form-data with the certificate in a `file` field (a PDF or a photo: JPEG, PNG, WebP or GIF by its bytes, up to 10 MB), the state as `?state=CA` and its expiry as `?expires_on=2027-06-30` (empty for none). Not JSON, but an `Idempotency-Key` header is required all the same: the same key with the same file and query answers the first upload again (`Idempotent-Replayed: true`). The file goes to the store’s Shopify Files (its link opens for anyone who has it, as in the admin) and the state’s resale exemption is set on the Shopify customer. A state that has one gets this one instead (the old file is deleted), keeping its expiry unless `expires_on` is sent. Answers 201 with the profile. `422 CUSTOMER_REFUSED` (Shopify’s refusal), `422 CUSTOMER_INCOMPLETE`, `502 SHOPIFY_UNAVAILABLE`. Needs Create and edit quotes and orders (a key: Create and change customers). API keys need **Create and change customers**. Phones see only what their staff member’s role reaches.",
        "operationId": "customer_resale_certificate_upload",
        "parameters": [
          {
            "description": "The customer’s `id` from `GET /customers`.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "The US state the certificate is for: its two-letter code, such as `CA`.",
            "in": "query",
            "name": "state",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "The certificate’s last day, `YYYY-MM-DD`; empty for one that doesn’t expire. Left out: a replaced certificate’s expiry stays, a new one has none.",
            "in": "query",
            "name": "expires_on",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "multipart/form-data": {
              "schema": {
                "$ref": "#/components/schemas/Object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CustomerProfile"
                }
              }
            },
            "description": "Created"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Upload a resale certificate",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "ORDERS_EDIT",
          "label": "Create and edit quotes and orders"
        },
        "x-required-scopes": ["CUSTOMERS_WRITE"],
        "x-stability": "stable"
      }
    },
    "/customers/{id}/resale-certificates/from-url": {
      "post": {
        "description": "Put a customer’s resale certificate on file for one US state, as Customers › Tax & resale does: fetched from a public https address (not a private or local one, nor one that redirects there), a PDF or a photo (JPEG, PNG, WebP or GIF by its bytes) of up to 10 MB, with `state` and `expires_on`. The file goes to the store’s Shopify Files (its link opens for anyone who has it, as in the admin) and the state’s resale exemption is set on the Shopify customer. A state that has one gets this one instead (the old file is deleted), keeping its expiry unless `expires_on` is sent. Answers 201 with the profile. `422 CUSTOMER_REFUSED` (Shopify’s refusal), `422 CUSTOMER_INCOMPLETE`, `502 SHOPIFY_UNAVAILABLE`. Needs Create and edit quotes and orders (a key: Create and change customers). API keys need **Create and change customers**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "customer_resale_certificate_from_url",
        "parameters": [
          {
            "description": "The customer’s `id` from `GET /customers`.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ResaleCertificateFromUrl"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CustomerProfile"
                }
              }
            },
            "description": "Created"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Add a resale certificate from a URL",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "ORDERS_EDIT",
          "label": "Create and edit quotes and orders"
        },
        "x-required-scopes": ["CUSTOMERS_WRITE"],
        "x-stability": "stable"
      }
    },
    "/email-look": {
      "get": {
        "description": "Every template’s body font and button corners as its draft shows them, with the fonts and corners there are to choose from (Settings › Branding’s look). API keys need **Read settings** or **Change settings**.",
        "operationId": "email_look",
        "parameters": [],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmailLook"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "See the emails’ look",
        "x-rate-weight": 1,
        "x-required-scopes": ["SETTINGS_READ", "SETTINGS_WRITE"],
        "x-stability": "stable"
      }
    },
    "/email-look/apply": {
      "post": {
        "description": "Write a body font, button corners or both into every template’s draft (Apply this look). Drafts only: customers receive it once each template is published. A part left out is left as each template has it. API keys need **Change settings**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "email_look_apply",
        "parameters": [
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EmailLookApply"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmailLookApplied"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Apply a look to the emails",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "SETTINGS_SHOP",
          "label": "Manage shop settings"
        },
        "x-required-scopes": ["SETTINGS_WRITE"],
        "x-stability": "stable"
      }
    },
    "/email-template-groups": {
      "get": {
        "description": "The email groups as the Templates tab lists them: each with the status that sends it and its templates (key, name, subject, theme, default, brands, whether live), plus every status a group can take and the store’s default theme. API keys need **Read settings** or **Change settings**.",
        "operationId": "email_template_groups",
        "parameters": [],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmailTemplateGroupList"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "List email groups",
        "x-rate-weight": 1,
        "x-required-scopes": ["SETTINGS_READ", "SETTINGS_WRITE"],
        "x-stability": "stable"
      },
      "post": {
        "description": "Make an email group, optionally with the status that sends it. A status another group sends now moves only when named in `confirmed_moves`. Answers 201 with the group. API keys need **Change settings**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "email_template_group_create",
        "parameters": [
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EmailTemplateGroupCreate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmailTemplateGroup"
                }
              }
            },
            "description": "Created"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Create an email group",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "SETTINGS_SHOP",
          "label": "Manage shop settings"
        },
        "x-required-scopes": ["SETTINGS_WRITE"],
        "x-stability": "stable"
      }
    },
    "/email-template-groups/reorder": {
      "post": {
        "description": "Put the email groups in this order: every group’s `id` from `GET /email-template-groups` (one left out keeps its old place number). Answers the groups. API keys need **Change settings**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "email_template_groups_reorder",
        "parameters": [
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EmailTemplateGroupsReorder"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmailTemplateGroupList"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Reorder email groups",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "SETTINGS_SHOP",
          "label": "Manage shop settings"
        },
        "x-required-scopes": ["SETTINGS_WRITE"],
        "x-stability": "stable"
      }
    },
    "/email-template-groups/{id}": {
      "delete": {
        "description": "Delete an email group the store made, once it has no templates and no status (a built-in group is refused). API keys need **Change settings**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "email_template_group_delete",
        "parameters": [
          {
            "description": "The email group’s `id`, from `GET /email-template-groups`.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmailTemplateGroupDeleted"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Delete an email group",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "SETTINGS_SHOP",
          "label": "Manage shop settings"
        },
        "x-required-scopes": ["SETTINGS_WRITE"],
        "x-stability": "stable"
      },
      "patch": {
        "description": "Rename an email group or change the status that sends it (an empty `status_ids` clears it). A status another group sends now moves only when named in `confirmed_moves`. API keys need **Change settings**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "email_template_group_update",
        "parameters": [
          {
            "description": "The email group’s `id`, from `GET /email-template-groups`.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EmailTemplateGroupUpdate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmailTemplateGroup"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Change an email group",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "SETTINGS_SHOP",
          "label": "Manage shop settings"
        },
        "x-required-scopes": ["SETTINGS_WRITE"],
        "x-stability": "stable"
      }
    },
    "/email-template-groups/{id}/templates": {
      "post": {
        "description": "Make a template in an email group (New template): from a theme’s design (the store’s default theme when none is named) or a copy of another template’s draft (`from_key`). It is the group’s default only when the group has none; otherwise a brand version. Unpublished. Answers 201 with its key. API keys need **Change settings**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "email_template_create",
        "parameters": [
          {
            "description": "The email group’s `id`, from `GET /email-template-groups`.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EmailTemplateCreate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmailTemplateCreated"
                }
              }
            },
            "description": "Created"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Create an email template",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "SETTINGS_SHOP",
          "label": "Manage shop settings"
        },
        "x-required-scopes": ["SETTINGS_WRITE"],
        "x-stability": "stable"
      }
    },
    "/email-template-groups/{id}/templates/reorder": {
      "post": {
        "description": "Put an email group’s templates in this order: every template’s `key` (one left out keeps its old place number). Answers the groups. API keys need **Change settings**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "email_templates_reorder",
        "parameters": [
          {
            "description": "The email group’s `id`, from `GET /email-template-groups`.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EmailTemplatesReorder"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmailTemplateGroupList"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Reorder a group’s email templates",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "SETTINGS_SHOP",
          "label": "Manage shop settings"
        },
        "x-required-scopes": ["SETTINGS_WRITE"],
        "x-stability": "stable"
      }
    },
    "/email-templates": {
      "get": {
        "description": "The store’s email templates a send can name as `template_key`: the customer templates a quote or order is sent with (the default), or with `audience=vendor` the vendor templates a purchase order is sent with. `preset` says which kind each is (`request-payment` for Request payment, `request-signature` for Request signature, `vendor-purchase-order` for a purchase order). API keys need **Send emails**. Phones see only what their staff member’s role reaches.",
        "operationId": "email_templates",
        "parameters": [
          {
            "description": "`customer` (the default): templates for quotes and orders. `vendor`: templates for purchase orders (`POST /purchase-orders/{id}/send`).",
            "in": "query",
            "name": "audience",
            "required": false,
            "schema": {
              "enum": ["customer", "vendor"],
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmailTemplateList"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "List email templates",
        "x-rate-weight": 1,
        "x-required-permission": {
          "id": "CUSTOMERS_EMAIL",
          "label": "Email customers"
        },
        "x-required-scopes": ["EMAILS_SEND"],
        "x-stability": "stable"
      }
    },
    "/email-templates/{key}": {
      "delete": {
        "description": "Delete a template the store made (a shipped one is refused: duplicate it instead). If it was its group’s default, the next template takes over. It can’t be brought back. API keys need **Change settings**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "email_template_delete",
        "parameters": [
          {
            "description": "The template’s `key`, from `templates[].key` in `GET /email-template-groups`.",
            "in": "path",
            "name": "key",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmailTemplateDeleted"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Delete an email template",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "SETTINGS_SHOP",
          "label": "Manage shop settings"
        },
        "x-required-scopes": ["SETTINGS_WRITE"],
        "x-stability": "stable"
      },
      "get": {
        "description": "One email template as the editor opens it: name, subject, group, brands, whether it is live, its draft `document` (the blocks), each block type’s default props, and the merge fields with sample values. API keys need **Read settings** or **Change settings**.",
        "operationId": "email_template",
        "parameters": [
          {
            "description": "The template’s `key`, from `templates[].key` in `GET /email-template-groups`.",
            "in": "path",
            "name": "key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmailTemplateDetail"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get an email template",
        "x-rate-weight": 1,
        "x-required-scopes": ["SETTINGS_READ", "SETTINGS_WRITE"],
        "x-stability": "stable"
      },
      "patch": {
        "description": "Change a template’s name, group, whether it is its group’s default, its brands, or plain text, as the Templates tab does. Applied in that order: a refused change leaves the ones before it made, and the error’s `field` names it. API keys need **Change settings**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "email_template_update",
        "parameters": [
          {
            "description": "The template’s `key`, from `templates[].key` in `GET /email-template-groups`.",
            "in": "path",
            "name": "key",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EmailTemplateUpdate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmailTemplateSummary"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Change an email template",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "SETTINGS_SHOP",
          "label": "Manage shop settings"
        },
        "x-required-scopes": ["SETTINGS_WRITE"],
        "x-stability": "stable"
      }
    },
    "/email-templates/{key}/check": {
      "post": {
        "description": "Check a design as the editor does while it is edited: whether the `document` (else the draft) is valid, and what email clients may show differently or what may look like spam. Changes nothing. API keys need **Change settings**. An `Idempotency-Key` header makes a retry safe: the same key and body returns the first answer. Phones see only what their staff member’s role reaches.",
        "operationId": "email_template_check",
        "parameters": [
          {
            "description": "The template’s `key`, from `templates[].key` in `GET /email-template-groups`.",
            "in": "path",
            "name": "key",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EmailTemplateCheckBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmailTemplateCheck"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Check an email design",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "SETTINGS_SHOP",
          "label": "Manage shop settings"
        },
        "x-required-scopes": ["SETTINGS_WRITE"],
        "x-stability": "stable"
      }
    },
    "/email-templates/{key}/discard-draft": {
      "post": {
        "description": "Drop the draft’s unpublished changes: the live version goes back into the draft (Discard changes). Refused before the first publish. API keys need **Change settings**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "email_template_discard_draft",
        "parameters": [
          {
            "description": "The template’s `key`, from `templates[].key` in `GET /email-template-groups`.",
            "in": "path",
            "name": "key",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Empty"
              }
            }
          },
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmailTemplateDraftReset"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Discard an email template’s draft",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "SETTINGS_SHOP",
          "label": "Manage shop settings"
        },
        "x-required-scopes": ["SETTINGS_WRITE"],
        "x-stability": "stable"
      }
    },
    "/email-templates/{key}/draft": {
      "patch": {
        "description": "Save the template’s draft (Save draft): its `document`, and the name or subject when sent. Customers receive nothing new until it is published. API keys need **Change settings**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "email_template_draft_save",
        "parameters": [
          {
            "description": "The template’s `key`, from `templates[].key` in `GET /email-template-groups`.",
            "in": "path",
            "name": "key",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EmailTemplateDraftSave"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmailTemplateDraftSaved"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Save an email template’s draft",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "SETTINGS_SHOP",
          "label": "Manage shop settings"
        },
        "x-required-scopes": ["SETTINGS_WRITE"],
        "x-stability": "stable"
      }
    },
    "/email-templates/{key}/duplicate": {
      "post": {
        "description": "Copy the template’s draft into a new template in the same group (Duplicate), unpublished and not the default. Answers 201 with the copy’s key. API keys need **Change settings**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "email_template_duplicate",
        "parameters": [
          {
            "description": "The template’s `key`, from `templates[].key` in `GET /email-template-groups`.",
            "in": "path",
            "name": "key",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EmailTemplateDuplicate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmailTemplateCreated"
                }
              }
            },
            "description": "Created"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Duplicate an email template",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "SETTINGS_SHOP",
          "label": "Manage shop settings"
        },
        "x-required-scopes": ["SETTINGS_WRITE"],
        "x-stability": "stable"
      }
    },
    "/email-templates/{key}/preview": {
      "post": {
        "description": "The template rendered as an email, as the editor’s preview: a `document` sent, a stored version (`version_id`), what customers receive (`published`), or else the draft; with sample data, or one of the store’s quotes or orders (`order_id`: a quote needs Read quotes, an order Read orders; its customer links open nothing unless this caller may hand them out itself). Changes nothing. API keys need **Change settings**. An `Idempotency-Key` header makes a retry safe: the same key and body returns the first answer. Phones see only what their staff member’s role reaches.",
        "operationId": "email_template_preview",
        "parameters": [
          {
            "description": "The template’s `key`, from `templates[].key` in `GET /email-template-groups`.",
            "in": "path",
            "name": "key",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EmailTemplatePreviewBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmailTemplatePreview"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Preview an email template",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "SETTINGS_SHOP",
          "label": "Manage shop settings"
        },
        "x-required-scopes": ["SETTINGS_WRITE"],
        "x-stability": "stable"
      }
    },
    "/email-templates/{key}/publish": {
      "post": {
        "description": "Publish the template (Publish): its draft, or the `document`, name and subject sent, become a new version that customers receive from now on. A merge field the editor doesn’t allow is refused. API keys need **Change settings**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "email_template_publish",
        "parameters": [
          {
            "description": "The template’s `key`, from `templates[].key` in `GET /email-template-groups`.",
            "in": "path",
            "name": "key",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EmailTemplatePublish"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmailTemplatePublished"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Publish an email template",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "SETTINGS_SHOP",
          "label": "Manage shop settings"
        },
        "x-required-scopes": ["SETTINGS_WRITE"],
        "x-stability": "stable"
      }
    },
    "/email-templates/{key}/restore": {
      "post": {
        "description": "Copy a published version (and its subject) back into the draft (Restore as draft). Nothing is published: publish it to send it. The live version is refused: discard the draft to go back to it. API keys need **Change settings**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "email_template_restore",
        "parameters": [
          {
            "description": "The template’s `key`, from `templates[].key` in `GET /email-template-groups`.",
            "in": "path",
            "name": "key",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EmailTemplateRestore"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmailTemplateDraftReset"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Restore an email template version",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "SETTINGS_SHOP",
          "label": "Manage shop settings"
        },
        "x-required-scopes": ["SETTINGS_WRITE"],
        "x-stability": "stable"
      }
    },
    "/email-templates/{key}/test": {
      "post": {
        "description": "Email a test of the template to one address (Send test), with sample data and “[TEST]” in the subject: what customers receive, the draft (`source: draft`), or a `document` sent. Refused with the store’s reason when it can’t send (email not set up, the test allowance used). Counts against the key’s Emails per day cap. API keys need **Change settings**, and **Send emails**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "email_template_test",
        "parameters": [
          {
            "description": "The template’s `key`, from `templates[].key` in `GET /email-template-groups`.",
            "in": "path",
            "name": "key",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EmailTemplateTest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmailTemplateTestSent"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Send a test email",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "SETTINGS_SHOP",
          "label": "Manage shop settings"
        },
        "x-required-scopes": ["SETTINGS_WRITE"],
        "x-required-scopes-all": ["EMAILS_SEND"],
        "x-stability": "stable"
      }
    },
    "/email-templates/{key}/theme": {
      "post": {
        "description": "Re-theme the template’s draft (Change theme): its blocks restyled (`keep`) or the theme’s own (`defaults`), from the draft or a `document` sent. Saved as the draft; nothing reaches customers until it is published. API keys need **Change settings**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "email_template_theme",
        "parameters": [
          {
            "description": "The template’s `key`, from `templates[].key` in `GET /email-template-groups`.",
            "in": "path",
            "name": "key",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EmailTemplateThemeApply"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmailTemplateThemed"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Re-theme an email template",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "SETTINGS_SHOP",
          "label": "Manage shop settings"
        },
        "x-required-scopes": ["SETTINGS_WRITE"],
        "x-stability": "stable"
      }
    },
    "/email-templates/{key}/versions": {
      "get": {
        "description": "The template’s published versions, newest first (the last 25): which is live and each one’s size. API keys need **Read settings** or **Change settings**.",
        "operationId": "email_template_versions",
        "parameters": [
          {
            "description": "The template’s `key`, from `templates[].key` in `GET /email-template-groups`.",
            "in": "path",
            "name": "key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmailTemplateVersionList"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "List an email template’s versions",
        "x-rate-weight": 1,
        "x-required-scopes": ["SETTINGS_READ", "SETTINGS_WRITE"],
        "x-stability": "stable"
      }
    },
    "/email-themes": {
      "get": {
        "description": "The email themes a template can take (each with its colours and how many blocks its own design has) and the store’s default theme. API keys need **Read settings** or **Change settings**.",
        "operationId": "email_themes",
        "parameters": [],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmailThemeList"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "List email themes",
        "x-rate-weight": 1,
        "x-required-scopes": ["SETTINGS_READ", "SETTINGS_WRITE"],
        "x-stability": "stable"
      }
    },
    "/email-themes/default": {
      "patch": {
        "description": "Set the store’s default email theme (Settings › Branding › Emails): every template is restyled in it, published ones included (republished at once), so customers receive the new look. A published template that can’t be compiled in it keeps its own and is named in `failed`. Refused when the store has more than 100 templates. API keys need **Change settings**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "email_default_theme_set",
        "parameters": [
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EmailDefaultThemeSet"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmailDefaultThemeSaved"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Set the default email theme",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "SETTINGS_SHOP",
          "label": "Manage shop settings"
        },
        "x-required-scopes": ["SETTINGS_WRITE"],
        "x-stability": "stable"
      }
    },
    "/fee-templates": {
      "get": {
        "description": "The shop’s saved fees (Settings › Custom fees) that can be added to a quote or order. API keys need **Read quotes** or **Read orders**. Phones see only what their staff member’s role reaches.",
        "operationId": "fee_templates",
        "parameters": [],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FeeTemplateList"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "List fee templates",
        "x-rate-weight": 1,
        "x-required-permission": {
          "id": "ORDERS_VIEW",
          "label": "View quotes and orders"
        },
        "x-required-scopes": ["QUOTES_READ", "ORDERS_READ"],
        "x-stability": "stable"
      }
    },
    "/files": {
      "get": {
        "description": "The store’s Shopify Files, newest first, as the app’s file picker browses them: each file’s Shopify id, kind, URL and alt text. A template’s images and an option value’s picture take a file’s `url` (with its `id` as `image_file_id`). `503 BUSY` while Shopify limits the store’s calls; `502 SHOPIFY_UNAVAILABLE` when Shopify can’t be reached. API keys need **Read the catalog** or **Change the catalog** or **Create and change quotes** or **Change orders** or **Create and change customers** or **Change settings**.",
        "operationId": "files",
        "parameters": [
          {
            "description": "Items per page, 1–50 (default 25). A larger value is clamped to 50.",
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 25,
              "maximum": 50,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "description": "The `next_cursor` of the previous page of this list. A cursor from another list is `400 INVALID_CURSOR`.",
            "in": "query",
            "name": "cursor",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Plain words Shopify’s file search finds (up to 80 characters).",
            "in": "query",
            "name": "q",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "`true`: pictures only.",
            "in": "query",
            "name": "images",
            "required": false,
            "schema": {
              "enum": ["true"],
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ShopifyFileList"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "List Shopify Files",
        "x-rate-weight": 1,
        "x-required-scopes": [
          "CATALOG_READ",
          "CATALOG_WRITE",
          "QUOTES_WRITE",
          "ORDERS_WRITE",
          "CUSTOMERS_WRITE",
          "SETTINGS_WRITE"
        ],
        "x-stability": "stable"
      },
      "post": {
        "description": "Fetch a picture from a public https address into the store’s Shopify Files, as the app’s image upload does: a JPEG, PNG, WebP or GIF of at most 10 MB (the bytes decide; no SVG). A private or local address is refused, and so is one that redirects there. `status` is `processing` and `url` null until Shopify is done; read it again with `GET /files/{id}`. A template’s images and a text-and-image option or order field (`image_url`) take the `url`; a customer’s picture field takes the `id`. Needs Manage the catalog, Create and edit quotes and orders, or Change shop settings (a key: any of the matching scopes). API keys need **Change the catalog** or **Create and change quotes** or **Change orders** or **Create and change customers** or **Change settings**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice.",
        "operationId": "file_upload",
        "parameters": [
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/FileUpload"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FileUploaded"
                }
              }
            },
            "description": "Created"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Upload a picture from a URL",
        "x-rate-weight": 5,
        "x-required-scopes": [
          "CATALOG_WRITE",
          "QUOTES_WRITE",
          "ORDERS_WRITE",
          "CUSTOMERS_WRITE",
          "SETTINGS_WRITE"
        ],
        "x-stability": "stable"
      }
    },
    "/files/{id}": {
      "get": {
        "description": "A picture `POST /files` uploaded for this store: whether Shopify has finished processing it, and its Shopify Files URL once `ready`. Only a file this API uploaded is found (`404` otherwise, and once it is deleted in Shopify). `502 SHOPIFY_UNAVAILABLE` when Shopify can’t be reached. API keys need **Read the catalog** or **Change the catalog** or **Create and change quotes** or **Change orders** or **Create and change customers** or **Change settings**.",
        "operationId": "file",
        "parameters": [
          {
            "description": "The `id` the upload answered.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/File"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get an uploaded picture",
        "x-rate-weight": 1,
        "x-required-scopes": [
          "CATALOG_READ",
          "CATALOG_WRITE",
          "QUOTES_WRITE",
          "ORDERS_WRITE",
          "CUSTOMERS_WRITE",
          "SETTINGS_WRITE"
        ],
        "x-stability": "stable"
      }
    },
    "/imports": {
      "get": {
        "description": "The store’s imports, newest first, as Settings › Import data lists them for the person who made this key: the files people uploaded and the drafts assistants sent, of the kinds this key may import (each kind’s scope and access), and this key’s own drafts, sent or not (`mine`). `owner=key`: only this key’s drafts. Narrow by `kind` and `status`; paged by `offset`. Read only: a key changes only its own drafts. Read one with `GET /imports/{id}`. API keys need **Change the catalog** or **Create and change customers** or **Manage purchase orders** or **Create and change quotes** or **Change orders** or **Work warranty claims**. Preview: this endpoint’s shape may still change inside v1.",
        "operationId": "import_list",
        "parameters": [
          {
            "description": "`store` (the default): the store’s imports this key may see, and its own drafts. `key`: only this key’s drafts, sent or not.",
            "in": "query",
            "name": "owner",
            "required": false,
            "schema": {
              "enum": ["store", "key"],
              "type": "string"
            }
          },
          {
            "description": "Only this kind’s imports.",
            "in": "query",
            "name": "kind",
            "required": false,
            "schema": {
              "enum": [
                "products",
                "product_templates",
                "options",
                "categories",
                "customers",
                "vendors",
                "stock",
                "quotes",
                "orders",
                "purchase_orders",
                "warranty_claims"
              ],
              "type": "string"
            }
          },
          {
            "description": "Only imports with this status: `ready` (waiting for the merchant), `imported`, ….",
            "in": "query",
            "name": "status",
            "required": false,
            "schema": {
              "enum": [
                "uploading",
                "drafting",
                "checking",
                "checked",
                "ready",
                "importing",
                "imported",
                "failed",
                "discarded",
                "expired"
              ],
              "type": "string"
            }
          },
          {
            "description": "Imports to skip: the `next_offset` of the last page (default 0).",
            "in": "query",
            "name": "offset",
            "required": false,
            "schema": {
              "default": 0,
              "minimum": 0,
              "type": "integer"
            }
          },
          {
            "description": "Imports per page, 1–100 (default 20). A larger value is clamped to 100.",
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 20,
              "maximum": 100,
              "minimum": 1,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ImportList"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "List imports",
        "x-rate-weight": 1,
        "x-required-scopes": [
          "CATALOG_WRITE",
          "CUSTOMERS_WRITE",
          "PURCHASING_WRITE",
          "QUOTES_WRITE",
          "ORDERS_WRITE",
          "WARRANTY_WRITE"
        ],
        "x-stability": "preview"
      },
      "post": {
        "description": "Start drafts of the merchant’s data: one `kind`, or several at once in `kinds` (one send), each with its rows (`rows`, or the file’s text as `csv`; 500 rows a call in all), `settled` and `open` questions; `check: true` checks them. Counts 1, 2 more with rows and 1 a draft checked. A draft changes nothing in the store: the merchant imports it on its review page once it is sent. It turns import mode on (`POST /imports/mode/start`). More rows: `POST /imports/{id}/rows`. A key reads and changes only its own drafts. A store holds 20 unsent drafts, every connection’s (`422 CAP_REACHED`: discard yours you don’t need, and never send a draft to make room); one expires 3 days after its last change. Read the import guide first (`GET /imports/guide` with your `kinds`): the flow, the cell rules and those kinds’ columns. API keys need **Change the catalog** or **Create and change customers** or **Manage purchase orders** or **Create and change quotes** or **Change orders** or **Work warranty claims**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Preview: this endpoint’s shape may still change inside v1.",
        "operationId": "import_draft_create",
        "parameters": [
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ImportDraftCreate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ImportSend"
                }
              }
            },
            "description": "Created"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Start an import draft",
        "x-rate-weight": 1,
        "x-required-scopes": [
          "CATALOG_WRITE",
          "CUSTOMERS_WRITE",
          "PURCHASING_WRITE",
          "QUOTES_WRITE",
          "ORDERS_WRITE",
          "WARRANTY_WRITE"
        ],
        "x-stability": "preview"
      }
    },
    "/imports/guide": {
      "get": {
        "description": "The import guide for moving a merchant’s data into OrderPilot: what a draft is, the flow from the merchant’s files to the review links, the cell rules, and the columns of the kinds you name (`kinds`). `guide` is the guide as Markdown; `kinds` lists those kinds’ columns as data. Without `kinds`, the guide lists the kinds: call again with the ones you will import. The whole guide is at `/connect/import-guide.md`. API keys need **Change the catalog** or **Create and change customers** or **Manage purchase orders** or **Create and change quotes** or **Change orders** or **Work warranty claims**. Preview: this endpoint’s shape may still change inside v1.",
        "operationId": "import_guide",
        "parameters": [
          {
            "description": "The kinds you will import, comma separated (`customers,vendors`), or `all`. The guide then has the rules and those kinds’ columns; left out, the rules and a list of the kinds (call again with yours).",
            "in": "query",
            "name": "kinds",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ImportGuide"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Read the import guide",
        "x-rate-weight": 1,
        "x-required-scopes": [
          "CATALOG_WRITE",
          "CUSTOMERS_WRITE",
          "PURCHASING_WRITE",
          "QUOTES_WRITE",
          "ORDERS_WRITE",
          "WARRANTY_WRITE"
        ],
        "x-stability": "preview"
      }
    },
    "/imports/mode/end": {
      "post": {
        "description": "Turn import mode off for this connection once the import is done: the merchant has imported or discarded each draft (`GET /imports/{id}` says `imported` or `discarded`). Direct changes then work again. It imports nothing: the merchant imports each draft on its review page. Ending it again changes nothing. API keys need **Change the catalog** or **Create and change customers** or **Manage purchase orders** or **Create and change quotes** or **Change orders** or **Work warranty claims**. An `Idempotency-Key` header makes a retry safe: the same key and body returns the first answer. Preview: this endpoint’s shape may still change inside v1.",
        "operationId": "import_mode_end",
        "parameters": [
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Empty"
              }
            }
          },
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ImportMode"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "End import mode",
        "x-rate-weight": 1,
        "x-required-scopes": [
          "CATALOG_WRITE",
          "CUSTOMERS_WRITE",
          "PURCHASING_WRITE",
          "QUOTES_WRITE",
          "ORDERS_WRITE",
          "WARRANTY_WRITE"
        ],
        "x-stability": "preview"
      }
    },
    "/imports/mode/start": {
      "post": {
        "description": "Turn import mode on for this connection when you start bringing the merchant’s data in. While it is on, every change to the store goes in an import draft, so the merchant reviews it: this connection’s other writes are refused (`409 IMPORT_MODE`); reads and the import calls work. `POST /imports` turns it on too. Other connections and people are unaffected. Starting it again changes nothing. API keys need **Change the catalog** or **Create and change customers** or **Manage purchase orders** or **Create and change quotes** or **Change orders** or **Work warranty claims**. An `Idempotency-Key` header makes a retry safe: the same key and body returns the first answer. Preview: this endpoint’s shape may still change inside v1.",
        "operationId": "import_mode_start",
        "parameters": [
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Empty"
              }
            }
          },
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ImportMode"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Start import mode",
        "x-rate-weight": 1,
        "x-required-scopes": [
          "CATALOG_WRITE",
          "CUSTOMERS_WRITE",
          "PURCHASING_WRITE",
          "QUOTES_WRITE",
          "ORDERS_WRITE",
          "WARRANTY_WRITE"
        ],
        "x-stability": "preview"
      }
    },
    "/imports/preview": {
      "get": {
        "description": "How this key’s drafts will look in OrderPilot, for the merchant to see in the chat before you send them: one send (`batch_id`) or one draft (`id`). Each kind, in the order the merchant reviews them, brings its counts, open questions and records (title, picture, each field now and after, links, problems). With several kinds each brings its first 8 records; name a `kind` for its pages of 60 (`offset`, then `next_offset`). `filter`: `create`, `update`, `needs_fix` or `questions`. `wait` (seconds) answers once the drafts are checked. Nothing changes; cost fields appear only with See costs or Enter and correct costs. API keys need **Change the catalog** or **Create and change customers** or **Manage purchase orders** or **Create and change quotes** or **Change orders** or **Work warranty claims**. Preview: this endpoint’s shape may still change inside v1.",
        "operationId": "import_preview",
        "parameters": [
          {
            "description": "The send to preview: the `batch_id` this key’s drafts share. Send this or `id`, not both.",
            "in": "query",
            "name": "batch_id",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "One draft to preview: its `id`. Send this or `batch_id`, not both.",
            "in": "query",
            "name": "id",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Only this kind, 60 records a page. The kind of data: `products` (Shopify products), `product_templates`, `options`, `categories`, `customers`, `vendors`, `stock`, `quotes`, `orders`, `purchase_orders` or `warranty_claims`.",
            "in": "query",
            "name": "kind",
            "required": false,
            "schema": {
              "enum": [
                "products",
                "product_templates",
                "options",
                "categories",
                "customers",
                "vendors",
                "stock",
                "quotes",
                "orders",
                "purchase_orders",
                "warranty_claims"
              ],
              "type": "string"
            }
          },
          {
            "description": "Which records: `all` (the default), `create` (new), `update`, `needs_fix` or `questions` (the records an open question is about).",
            "in": "query",
            "name": "filter",
            "required": false,
            "schema": {
              "enum": ["all", "create", "update", "needs_fix", "questions"],
              "type": "string"
            }
          },
          {
            "description": "Records to skip in the kind’s list: the `next_offset` of the last page (default 0).",
            "in": "query",
            "name": "offset",
            "required": false,
            "schema": {
              "default": 0,
              "minimum": 0,
              "type": "integer"
            }
          },
          {
            "description": "Seconds to wait, up to 20, for the checks to finish before answering (default 0: answer at once). A big draft may still be `checking` then: call again with `wait`. When the store has several waits open already, the answer comes at once.",
            "in": "query",
            "name": "wait",
            "required": false,
            "schema": {
              "default": 0,
              "maximum": 20,
              "minimum": 0,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ImportPreview"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Preview an import",
        "x-rate-weight": 1,
        "x-required-scopes": [
          "CATALOG_WRITE",
          "CUSTOMERS_WRITE",
          "PURCHASING_WRITE",
          "QUOTES_WRITE",
          "ORDERS_WRITE",
          "WARRANTY_WRITE"
        ],
        "x-stability": "preview"
      }
    },
    "/imports/{id}": {
      "get": {
        "description": "One of this key’s drafts, or an import of the store it may see (as `GET /imports` lists them: a file a person uploaded, an assistant’s sent draft; `mine` false, read only): its status, its counts and, once it is sent, `review_url`, the review page where the merchant imports it. Once the merchant clicked Import, `records` lists the records it made or updated, with their ids (paged by `offset`). Rather than read a draft again while it is `checking`, check it with `wait`. API keys need **Change the catalog** or **Create and change customers** or **Manage purchase orders** or **Create and change quotes** or **Change orders** or **Work warranty claims**. Preview: this endpoint’s shape may still change inside v1.",
        "operationId": "import_draft",
        "parameters": [
          {
            "description": "The draft’s `id`, as `POST /imports` answered it.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Imported records to skip: the `records.next_offset` of the last page (default 0).",
            "in": "query",
            "name": "offset",
            "required": false,
            "schema": {
              "default": 0,
              "minimum": 0,
              "type": "integer"
            }
          },
          {
            "description": "Imported records per page, 1–100 (default 50). A larger value is clamped to 100.",
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 50,
              "maximum": 100,
              "minimum": 1,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ImportDraft"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get an import draft",
        "x-rate-weight": 1,
        "x-required-scopes": [
          "CATALOG_WRITE",
          "CUSTOMERS_WRITE",
          "PURCHASING_WRITE",
          "QUOTES_WRITE",
          "ORDERS_WRITE",
          "WARRANTY_WRITE"
        ],
        "x-stability": "preview"
      }
    },
    "/imports/{id}/check": {
      "post": {
        "description": "Check a draft’s rows against the store (read-only), or a send’s drafts by its `batch_id` (those not checked since they changed; none such: all again). Answers 202 with the draft `checking`; with `wait` (seconds, up to 20) the answer comes once it is `checked`, with its counts. Then read its problems with `GET /imports/{id}/problems`. Counts 1 a draft it checks. By a `batch_id` the answer is the send’s first draft in review order, and `drafts` lists every draft of the send. API keys need **Change the catalog** or **Create and change customers** or **Manage purchase orders** or **Create and change quotes** or **Change orders** or **Work warranty claims**. An `Idempotency-Key` header makes a retry safe: the same key and body returns the first answer. Preview: this endpoint’s shape may still change inside v1.",
        "operationId": "import_draft_check",
        "parameters": [
          {
            "description": "A draft’s `id`, or a send’s `batch_id` for every draft of the send, as `POST /imports` answered them. The MCP tool also takes it as `batch_id`.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Seconds to wait, up to 20, for the checks to finish before answering (default 0: answer at once). A big draft may still be `checking` then: call again with `wait`. When the store has several waits open already, the answer comes at once.",
            "in": "query",
            "name": "wait",
            "required": false,
            "schema": {
              "default": 0,
              "maximum": 20,
              "minimum": 0,
              "type": "integer"
            }
          },
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Empty"
              }
            }
          },
          "required": false
        },
        "responses": {
          "202": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ImportSend"
                }
              }
            },
            "description": "Accepted"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Check an import draft",
        "x-rate-weight": 1,
        "x-required-scopes": [
          "CATALOG_WRITE",
          "CUSTOMERS_WRITE",
          "PURCHASING_WRITE",
          "QUOTES_WRITE",
          "ORDERS_WRITE",
          "WARRANTY_WRITE"
        ],
        "x-stability": "preview"
      }
    },
    "/imports/{id}/discard": {
      "post": {
        "description": "Close a draft that isn’t importing or imported: it becomes `discarded` and is never imported. A sent draft leaves the merchant’s Ready to review list. API keys need **Change the catalog** or **Create and change customers** or **Manage purchase orders** or **Create and change quotes** or **Change orders** or **Work warranty claims**. An `Idempotency-Key` header makes a retry safe: the same key and body returns the first answer. Preview: this endpoint’s shape may still change inside v1.",
        "operationId": "import_draft_discard",
        "parameters": [
          {
            "description": "The draft’s `id`, as `POST /imports` answered it.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Empty"
              }
            }
          },
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ImportDraft"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Discard an import draft",
        "x-rate-weight": 1,
        "x-required-scopes": [
          "CATALOG_WRITE",
          "CUSTOMERS_WRITE",
          "PURCHASING_WRITE",
          "QUOTES_WRITE",
          "ORDERS_WRITE",
          "WARRANTY_WRITE"
        ],
        "x-stability": "preview"
      }
    },
    "/imports/{id}/problems": {
      "get": {
        "description": "What a checked draft’s records need, records with a fix first, in row order: each problem names the rows, the column, what is wrong and the next step. `severity` `fix` holds that record back (the rest imports); `note` imports anyway. Paged by `offset`; `next_offset` is null on the last page. A problem never shows a cost’s value. API keys need **Change the catalog** or **Create and change customers** or **Manage purchase orders** or **Create and change quotes** or **Change orders** or **Work warranty claims**. Preview: this endpoint’s shape may still change inside v1.",
        "operationId": "import_draft_problems",
        "parameters": [
          {
            "description": "The draft’s `id`, as `POST /imports` answered it.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Problems to skip: the `next_offset` of the previous page (default 0).",
            "in": "query",
            "name": "offset",
            "required": false,
            "schema": {
              "default": 0,
              "minimum": 0,
              "type": "integer"
            }
          },
          {
            "description": "Problems per page, 1–100 (default 50). A larger value is clamped to 100.",
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 50,
              "maximum": 100,
              "minimum": 1,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ImportProblemList"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "List a draft’s problems",
        "x-rate-weight": 1,
        "x-required-scopes": [
          "CATALOG_WRITE",
          "CUSTOMERS_WRITE",
          "PURCHASING_WRITE",
          "QUOTES_WRITE",
          "ORDERS_WRITE",
          "WARRANTY_WRITE"
        ],
        "x-stability": "preview"
      }
    },
    "/imports/{id}/questions": {
      "post": {
        "description": "Set what you still ask the merchant about a draft’s data, and record what they answered in the chat. `open` replaces the draft’s open questions, each with the rows it is about (none for a question about the whole file); the preview’s Questions filter shows them. `settled` adds what they answered, each as a short title (`question`: “Currency”) and what was settled (`answer`, one plain sentence); the review page lists them read-only, so the merchant isn’t asked again. By a send’s `batch_id`, `kinds` sets several drafts at once (`{ \"vendors\": { \"open\": [...] } }`). Allowed until the draft is imported. API keys need **Change the catalog** or **Create and change customers** or **Manage purchase orders** or **Create and change quotes** or **Change orders** or **Work warranty claims**. An `Idempotency-Key` header makes a retry safe: the same key and body returns the first answer. Preview: this endpoint’s shape may still change inside v1.",
        "operationId": "import_questions",
        "parameters": [
          {
            "description": "The `id` of one of this key’s drafts, or a send’s `batch_id` to set the questions of several of its drafts by kind (`kinds`).",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ImportQuestionsSet"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ImportSend"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Set a draft’s questions",
        "x-rate-weight": 1,
        "x-required-scopes": [
          "CATALOG_WRITE",
          "CUSTOMERS_WRITE",
          "PURCHASING_WRITE",
          "QUOTES_WRITE",
          "ORDERS_WRITE",
          "WARRANTY_WRITE"
        ],
        "x-stability": "preview"
      }
    },
    "/imports/{id}/rows": {
      "post": {
        "description": "Add up to 500 rows to a draft that is `drafting` or `checked` (a checked draft goes back to `drafting`). `start` is the first row’s number: 2 on the first call (row 1 is the header), then one past the last row sent; sending the same `start` again replaces those rows, so a retry is safe. `last: true` says these are all the rows from `start` on: the rows stored after them go (with no rows, every row from `start`), so a draft resent with fewer rows from `start` 2 shrinks; `check: true` with it checks the draft. `csv` takes the file’s text in place of `rows`, header row first. Counts 2, 3 with `check`. Rows must follow on (`409 ROWS_OUT_OF_ORDER`). A draft holds up to 50,000 rows and 15 MB of cells, column keys and values counted (`422 CAP_REACHED`, nothing of the call kept); the body is at most 256 KB, so send fewer rows when they are long. API keys need **Change the catalog** or **Create and change customers** or **Manage purchase orders** or **Create and change quotes** or **Change orders** or **Work warranty claims**. An `Idempotency-Key` header makes a retry safe: the same key and body returns the first answer. Preview: this endpoint’s shape may still change inside v1.",
        "operationId": "import_draft_rows",
        "parameters": [
          {
            "description": "The draft’s `id`, as `POST /imports` answered it.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ImportRowsAdd"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ImportDraft"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Add rows to a draft",
        "x-rate-weight": 2,
        "x-required-scopes": [
          "CATALOG_WRITE",
          "CUSTOMERS_WRITE",
          "PURCHASING_WRITE",
          "QUOTES_WRITE",
          "ORDERS_WRITE",
          "WARRANTY_WRITE"
        ],
        "x-stability": "preview"
      }
    },
    "/imports/{id}/send": {
      "post": {
        "description": "Send a `checked` draft to the merchant, only after they have seen its preview (`GET /imports/preview`) and said go in the chat: never send a draft the merchant hasn’t seen. A send’s `batch_id` sends all its drafts, or none while one isn’t checked (the refusal names it). It becomes `ready` (Ready to review in Settings › Import data) and the answer has its `review_url` (by `batch_id`, `drafts` has each in review order). Nothing is imported: the merchant clicks Import on that page. A sent draft takes no more rows; to change it, start a new draft and discard this one. It takes one of the store’s 100 open-import places until imported or discarded (`422 CAP_REACHED` when full). API keys need **Change the catalog** or **Create and change customers** or **Manage purchase orders** or **Create and change quotes** or **Change orders** or **Work warranty claims**. An `Idempotency-Key` header makes a retry safe: the same key and body returns the first answer. Preview: this endpoint’s shape may still change inside v1.",
        "operationId": "import_draft_send",
        "parameters": [
          {
            "description": "A draft’s `id`, or a send’s `batch_id` for every draft of the send, as `POST /imports` answered them. The MCP tool also takes it as `batch_id`.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Empty"
              }
            }
          },
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ImportSend"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Send a draft for review",
        "x-rate-weight": 1,
        "x-required-scopes": [
          "CATALOG_WRITE",
          "CUSTOMERS_WRITE",
          "PURCHASING_WRITE",
          "QUOTES_WRITE",
          "ORDERS_WRITE",
          "WARRANTY_WRITE"
        ],
        "x-stability": "preview"
      }
    },
    "/inventory": {
      "get": {
        "description": "Stock by location, read live from Shopify as the app’s stock counts read it: for each inventory item (a variant’s `inventory_item_id` from `GET /products/{id}`), what is available at `location_id` (or every active location together), the total, what is committed to unfulfilled orders there, and the active locations holding it. Batched Shopify reads within 8 seconds; never costs. `503 BUSY` with `Retry-After` when it runs out of time; `502` when Shopify can’t be reached. API keys need **Read the catalog**.",
        "operationId": "inventory",
        "parameters": [
          {
            "description": "Comma-separated inventory item ids (`gid://shopify/InventoryItem/…` or the number alone), 1–50.",
            "in": "query",
            "name": "inventory_item_ids",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "A Shopify location id (`gid://shopify/Location/…` or the number; an `id` from `GET /locations`). Without it, `available` is every active location’s together.",
            "in": "query",
            "name": "location_id",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Inventory"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get stock by location",
        "x-rate-weight": 1,
        "x-required-scopes": ["CATALOG_READ"],
        "x-stability": "stable"
      }
    },
    "/line-attribute-syncs/{jobId}": {
      "get": {
        "description": "Where a line’s Sync Shopify attributes is: `queued`, `running`, `synced` (the values are written), `refused` (a check refused it, with why; nothing changed), `failed` (Shopify couldn’t be read after three tries, or the line is gone, with why; nothing changed) or `unknown` (finished a while ago: the queue keeps a finished job briefly; read the line). For a caller who may see the record. API keys need **Read quotes** or **Read orders** or **Create and change quotes** or **Change orders**. Phones see only what their staff member’s role reaches.",
        "operationId": "line_attribute_sync_status",
        "parameters": [
          {
            "description": "The `job_id` the sync answered with.",
            "in": "path",
            "name": "jobId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LineAttributeSyncStatus"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "See a line sync’s progress",
        "x-rate-weight": 1,
        "x-required-permission": {
          "id": "ORDERS_VIEW",
          "label": "View quotes and orders"
        },
        "x-required-scopes": [
          "QUOTES_READ",
          "ORDERS_READ",
          "QUOTES_WRITE",
          "ORDERS_WRITE"
        ],
        "x-stability": "stable"
      }
    },
    "/locations": {
      "get": {
        "description": "The store’s active, billed locations the caller may use, A to Z, each with its address: what a quote or order’s `location_id`, a purchase order’s `store_location_id` and the other location fields take (each a Shopify location id). Up to 200. Any API key can call it, whatever its scopes.",
        "operationId": "locations",
        "parameters": [],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LocationList"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "List locations",
        "x-rate-weight": 1,
        "x-required-scopes": [
          "QUOTES_READ",
          "QUOTES_WRITE",
          "ORDERS_READ",
          "ORDERS_WRITE",
          "CUSTOMERS_READ",
          "CUSTOMERS_WRITE",
          "CATALOG_READ",
          "PURCHASING_READ",
          "PURCHASING_WRITE",
          "INBOX_READ",
          "INBOX_WRITE",
          "WARRANTY_READ",
          "WARRANTY_WRITE",
          "REPORTS_READ",
          "WEBHOOKS_MANAGE",
          "PAYMENTS_WRITE",
          "REFUNDS_WRITE",
          "EMAILS_SEND",
          "DELETE",
          "PRICING_WRITE",
          "COSTS_READ",
          "COSTS_WRITE",
          "COMMISSION_READ",
          "COMMISSION_WRITE",
          "CATALOG_WRITE",
          "SETTINGS_READ",
          "SETTINGS_WRITE",
          "STAFF_MANAGE",
          "CONTRACTS_EXPORT",
          "CUSTOMER_DATA_EXPORT"
        ],
        "x-stability": "stable"
      }
    },
    "/me": {
      "get": {
        "description": "Who is calling and what they may do.",
        "operationId": "me",
        "parameters": [],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Me"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Who am I",
        "x-rate-weight": 1,
        "x-required-scopes": [],
        "x-stability": "stable"
      }
    },
    "/openapi.json": {
      "get": {
        "description": "This API’s OpenAPI 3.0.3 description. The whole document is large: for one operation, send `operation` (or `path` and `method`), and get a small, valid document with only that operation and the schemas it uses; add `format=md` for a short Markdown page of it instead (its parameters, its body’s fields one line each, its answer’s fields and its errors). `index=true` lists every operation id with its method, path and summary.",
        "operationId": "openapi",
        "parameters": [
          {
            "description": "One operation’s `operationId` (`purchase_order_create`) or its MCP tool’s name (`create_purchase_order`): the answer is a small OpenAPI document with only that operation and every component it references. An id the API doesn’t have is `404 NOT_FOUND`, with close ids.",
            "in": "query",
            "name": "operation",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Instead of `operation`: the operation’s path as the spec writes it (`/purchase-orders/{id}/lines`) or filled in (`/purchase-orders/po_123/lines`). With `method`, that operation; without, every method of the path.",
            "in": "query",
            "name": "path",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "With `path`: the operation’s method, in any case.",
            "in": "query",
            "name": "method",
            "required": false,
            "schema": {
              "enum": ["get", "post", "patch", "delete"],
              "type": "string"
            }
          },
          {
            "description": "`true`: every operation’s id, method, path and summary as `{ items: [{ operation_id, method, path, summary }] }`, instead of the document.",
            "in": "query",
            "name": "index",
            "required": false,
            "schema": {
              "enum": ["true"],
              "type": "string"
            }
          },
          {
            "description": "With `operation` (or `path`) or `index`: `md` answers a short Markdown page (`text/markdown`) instead of JSON: the method and path, who may call it, the parameters, the body’s fields one line each (type, required, allowed values), the answer’s main fields and the error codes. `json` (the default) is the OpenAPI document. Without a lookup, `md` is `400 INVALID_PARAMETER`.",
            "in": "query",
            "name": "format",
            "required": false,
            "schema": {
              "enum": ["json", "md"],
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpenApi"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [],
        "summary": "Get the OpenAPI file",
        "x-rate-weight": 1,
        "x-stability": "stable"
      }
    },
    "/options": {
      "get": {
        "description": "The store’s options library (Settings › Options): the shared options product templates attach, A–Z by name, with how many values each has. Never costs. Order-level custom fields are `GET /custom-fields`. API keys need **Read the catalog**.",
        "operationId": "options",
        "parameters": [
          {
            "description": "Items per page, 1–50 (default 25). A larger value is clamped to 50.",
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 25,
              "maximum": 50,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "description": "The `next_cursor` of the previous page of this list. A cursor from another list is `400 INVALID_CURSOR`.",
            "in": "query",
            "name": "cursor",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Name or label contains this (2–100 characters).",
            "in": "query",
            "name": "q",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OptionList"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "List options",
        "x-rate-weight": 1,
        "x-required-scopes": ["CATALOG_READ"],
        "x-stability": "stable"
      },
      "post": {
        "description": "Create an option in the library, as Settings › Options’ Add option does, with its values: a dropdown (or swatches), a number, a size (its measurements), text, a text area or text with a picture, and where Shopify catalog lines offer it (products, categories, locations). It is attached to no template: attach it to a template with `POST /product-templates/{id}/options` or put it in a bundle. A name the library already has is `409 CONFLICT`. A price on a new value needs Change the catalog or Prices and exceptions; a changed price, Change the catalog; any cost, Enter and correct costs. `201` with the option. API keys need **Change the catalog**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Use a `options` import draft (`POST /imports`) for existing records, even one, unless asked otherwise. Outside an import, create from requests or email signatures directly. Phones see only what their staff member’s role reaches.",
        "operationId": "option_create",
        "parameters": [
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OptionCreate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Option"
                }
              }
            },
            "description": "Created"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Create an option",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "CATALOG_MANAGE",
          "label": "Manage the catalog"
        },
        "x-required-scopes": ["CATALOG_WRITE"],
        "x-stability": "stable"
      }
    },
    "/options/{id}": {
      "get": {
        "description": "One option of the library with its values (up to 500, `values_truncated` past that): each value’s label and base price (a template can set its own). Never costs. API keys need **Read the catalog**.",
        "operationId": "option",
        "parameters": [
          {
            "description": "The option’s `id` from `GET /options`.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Option"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get an option",
        "x-rate-weight": 1,
        "x-required-scopes": ["CATALOG_READ"],
        "x-stability": "stable"
      },
      "patch": {
        "description": "Change an option of the library, as its editor saves it: its settings, its values (edited in place by `option_id`, new ones added, `remove_option_ids` deleted with every template’s prices for them), or turn it off (`disabled: true`: it leaves every template’s new lines; past orders keep it) and on again. Only what is sent changes. Send its `version` (or its `updated_at` as `expected_updated_at`): a change made since is `409 STALE_VERSION` with the current `version`. A price on a new value needs Change the catalog or Prices and exceptions; a changed price, Change the catalog; any cost, Enter and correct costs. Every template using it syncs to Shopify in the background. Recorded on the option’s Activity. API keys need **Change the catalog**. An `Idempotency-Key` header makes a retry safe: the same key and body returns the first answer. Phones see only what their staff member’s role reaches.",
        "operationId": "option_edit",
        "parameters": [
          {
            "description": "The option’s `id` from `GET /options`.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OptionEdit"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Option"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Change an option",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "CATALOG_MANAGE",
          "label": "Manage the catalog"
        },
        "x-required-scopes": ["CATALOG_WRITE"],
        "x-stability": "stable"
      }
    },
    "/options/{id}/usage": {
      "get": {
        "description": "Where an option is used, as its editor’s side panel lists it: the bundles it is in and the templates it is attached to (the first 5 of each by name, as the panel shows them, with how many in all). API keys need **Read the catalog**.",
        "operationId": "option_usage",
        "parameters": [
          {
            "description": "The option’s `id` from `GET /options`.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OptionUsage"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "See where an option is used",
        "x-rate-weight": 1,
        "x-required-scopes": ["CATALOG_READ"],
        "x-stability": "stable"
      }
    },
    "/orders": {
      "get": {
        "description": "Orders, newest change first. API keys need **Read orders**. Phones see only what their staff member’s role reaches.",
        "operationId": "orders",
        "parameters": [
          {
            "description": "Items per page, 1–50 (default 25). A larger value is clamped to 50.",
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 25,
              "maximum": 50,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "description": "The `next_cursor` of the previous page of this list. A cursor from another list is `400 INVALID_CURSOR`.",
            "in": "query",
            "name": "cursor",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Only items changed at or after this time (ISO 8601).",
            "in": "query",
            "name": "updated_since",
            "required": false,
            "schema": {
              "format": "date-time",
              "type": "string"
            }
          },
          {
            "description": "Only this customer’s.",
            "in": "query",
            "name": "customer_id",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Search, as the admin list does: every word must be found in the number (also as `#1042` or `Q-1042`), the customer’s name, email, phone or company, a product’s name or SKU, a purchase order number or a tag. 2–100 characters.",
            "in": "query",
            "name": "q",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Only this status, by the id from `GET /statuses`. Preferred: it survives a rename. An id no status has is `400 UNKNOWN_STATUS`.",
            "in": "query",
            "name": "status_id",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Only this status by name (as shown in OrderPilot, any case). A merchant can rename a status; prefer `status_id`. Ignored when `status_id` is sent. A name no status has is `400 UNKNOWN_STATUS`, never an empty list.",
            "in": "query",
            "name": "status",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Only records in this payment state, as the Orders list’s payment filter reads it (a split order as one): `unpaid` (nothing paid yet), `partially_paid` (something paid, `balance_due` left, nothing refunded), `paid` (in full) or `refunded` (refunded in full or in part). Another value is `400 INVALID_PARAMETER`.",
            "in": "query",
            "name": "payment_status",
            "required": false,
            "schema": {
              "type": "string",
              "x-values": ["unpaid", "partially_paid", "paid", "refunded"]
            }
          },
          {
            "description": "The order of the list: `-updated_at` (newest change first, the default), `-created_at` (newest first) or `created_at` (oldest first). A `next_cursor` pages in the order it was made for: send the same `sort` with it (another is `400 INVALID_CURSOR`). Another value is `400 INVALID_PARAMETER`.",
            "in": "query",
            "name": "sort",
            "required": false,
            "schema": {
              "enum": ["-updated_at", "-created_at", "created_at"],
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrderList"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "List orders",
        "x-rate-weight": 1,
        "x-required-permission": {
          "id": "ORDERS_VIEW",
          "label": "View quotes and orders"
        },
        "x-required-scopes": ["ORDERS_READ"],
        "x-stability": "stable"
      }
    },
    "/orders/incoming-stock": {
      "post": {
        "description": "What open purchase orders still have to deliver of a quote’s or order’s lines, saved or not, as Create order and the order page show it: per line, the rows it could take units from (free units, ETA, where they arrive, the order they are promised to; a template line also other configurations’ rows and what taking one changes), what purchase orders hold for a saved line, other orders that want the item, and a saved template line’s tracked options’ rows. Send the lines you would send `POST /quotes`, each with a `key`: for a saved record its `order_id` and each saved line’s `id` as `key`. Saves and reserves nothing. Needs View quotes and orders (a key: Create and change quotes or Change orders); without View purchase orders (a key: Read purchase orders) `lines` is empty and `hidden_reason` says why. API keys need **Create and change quotes** or **Change orders**. An `Idempotency-Key` header makes a retry safe: the same key and body returns the first answer. Phones see only what their staff member’s role reaches.",
        "operationId": "order_incoming_stock",
        "parameters": [
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/IncomingStockInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IncomingStock"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "See incoming stock for lines",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "ORDERS_VIEW",
          "label": "View quotes and orders"
        },
        "x-required-scopes": ["QUOTES_WRITE", "ORDERS_WRITE"],
        "x-stability": "stable"
      }
    },
    "/orders/{id}": {
      "get": {
        "description": "One order with its lines and totals. API keys need **Read orders**. Phones see only what their staff member’s role reaches.",
        "operationId": "order",
        "parameters": [
          {
            "description": "The id from a list.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Order"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get an order",
        "x-rate-weight": 1,
        "x-required-permission": {
          "id": "ORDERS_VIEW",
          "label": "View quotes and orders"
        },
        "x-required-scopes": ["ORDERS_READ"],
        "x-stability": "stable"
      },
      "patch": {
        "description": "Change an order. On an order already placed in Shopify the change is saved here and sent to Shopify as an order edit on the queue: `sync_status` is `pending` until Shopify has it (`synced`), or `failed` (see `POST /orders/{id}/sync-retry`). API keys need **Change orders**. An `Idempotency-Key` header makes a retry safe: the same key and body returns the first answer. Phones see only what their staff member’s role reaches.",
        "operationId": "order_edit",
        "parameters": [
          {
            "description": "The id from a list.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OrderEdit"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Order"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Change an order",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "ORDERS_EDIT",
          "label": "Create and edit quotes and orders"
        },
        "x-required-scopes": ["ORDERS_WRITE"],
        "x-stability": "stable"
      }
    },
    "/orders/{id}/accept-changes": {
      "get": {
        "description": "What Accept changes shows on an order: the open change requests it would put on their lines, the suggested reply, why it can’t go if so, and the version to send back. API keys need **Read orders**. Phones see only what their staff member’s role reaches. Preview: this endpoint’s shape may still change inside v1.",
        "operationId": "order_accept_changes_preview",
        "parameters": [
          {
            "description": "The id from a list.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AcceptChangesPreview"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Preview an order’s changes",
        "x-rate-weight": 1,
        "x-required-permission": {
          "id": "ORDERS_VIEW",
          "label": "View quotes and orders"
        },
        "x-required-scopes": ["ORDERS_READ"],
        "x-stability": "preview"
      },
      "post": {
        "description": "Accept changes: every open change request’s value on its line in one save of the order (leaving Changes Requested), the requests marked applied, then one reply. All or none. Needs Handle customer messages and Edit quotes and orders, on a record the caller can change; the save then checks its own rules (what the change needs, Prices and exceptions for a price, the status lock), for an API key as for a person, and records the key as the one who made the change. The reply counts against an API key’s Emails per day cap. API keys need **Change orders**, and **Work the Inbox** and **Send emails**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "order_accept_changes",
        "parameters": [
          {
            "description": "The id from a list.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AcceptChanges"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AcceptApplied"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Accept an order’s changes",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "CUSTOMERS_SERVICE",
          "label": "Handle customer messages and change requests"
        },
        "x-required-scopes": ["ORDERS_WRITE"],
        "x-required-scopes-all": ["INBOX_WRITE", "EMAILS_SEND"],
        "x-stability": "stable"
      }
    },
    "/orders/{id}/activity": {
      "get": {
        "description": "The activity feed: who changed what and when, and the comments, newest first (a split order reads as one feed). API keys need **Read orders**. Phones see only what their staff member’s role reaches.",
        "operationId": "order_activity",
        "parameters": [
          {
            "description": "The id from a list.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Items per page, 1–50 (default 25). A larger value is clamped to 50.",
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 25,
              "maximum": 50,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "description": "The `next_cursor` of the previous page of this list. A cursor from another list is `400 INVALID_CURSOR`.",
            "in": "query",
            "name": "cursor",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ActivityList"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "See an order’s activity",
        "x-rate-weight": 1,
        "x-required-permission": {
          "id": "ORDERS_VIEW",
          "label": "View quotes and orders"
        },
        "x-required-scopes": ["ORDERS_READ"],
        "x-stability": "stable"
      }
    },
    "/orders/{id}/activity/restore": {
      "get": {
        "description": "What restoring the order to version `revision` (an entry’s `version` in `GET /orders/{id}/activity`) would change, as the Restore dialog shows it, with `blocked_reason` when it can’t be restored, or not by this caller. A placed order’s discount isn’t restored. Send its `version` with `POST /orders/{id}/activity/restore`. API keys need **Read orders**. Phones see only what their staff member’s role reaches.",
        "operationId": "order_restore_preview",
        "parameters": [
          {
            "description": "The id from a list.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "The version to go back to: an entry’s `version` from the record’s activity feed (one whose `restorable` is true).",
            "in": "query",
            "name": "revision",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ActivityRestorePreview"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Preview an order restore",
        "x-rate-weight": 1,
        "x-required-permission": {
          "id": "ORDERS_VIEW",
          "label": "View quotes and orders"
        },
        "x-required-scopes": ["ORDERS_READ"],
        "x-stability": "stable"
      },
      "post": {
        "description": "Restore the order to an earlier version, as the Restore dialog does: saved as a change to the order with every rule of one (rights, the status lock, signature clearing; a placed order’s change goes to Shopify as an order edit on the queue). Send the `version` (or `revision` and `token`) of `GET /orders/{id}/activity/restore`: an order changed since is `409 CONFLICT` with the preview’s `version` now. `422 RULE_REFUSED` with the reason when it can’t be restored. API keys need **Change orders**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "order_restore",
        "parameters": [
          {
            "description": "The id from a list.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ActivityRestoreInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ActivityRestored"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Restore an order version",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "ORDERS_EDIT",
          "label": "Create and edit quotes and orders"
        },
        "x-required-scopes": ["ORDERS_WRITE"],
        "x-stability": "stable"
      }
    },
    "/orders/{id}/asks": {
      "get": {
        "description": "The order’s open items: the customer’s questions and change requests, each with its status (`open`, `applied`, `resolved` or `declined`), and how many wait on the store (`to_do`) and on the customer (`waiting`). API keys need **Read orders**. Phones see only what their staff member’s role reaches.",
        "operationId": "order_asks",
        "parameters": [
          {
            "description": "The id from a list.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AskList"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "List an order’s open items",
        "x-rate-weight": 1,
        "x-required-permission": {
          "id": "ORDERS_VIEW",
          "label": "View quotes and orders"
        },
        "x-required-scopes": ["ORDERS_READ"],
        "x-stability": "stable"
      }
    },
    "/orders/{id}/asks/{askId}": {
      "get": {
        "description": "One question or change request on an order, as the list gives it. API keys need **Read orders**. Phones see only what their staff member’s role reaches.",
        "operationId": "order_ask",
        "parameters": [
          {
            "description": "The id from a list.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "The `id` of an item from `GET …/asks`.",
            "in": "path",
            "name": "askId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Ask"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get an order’s open item",
        "x-rate-weight": 1,
        "x-required-permission": {
          "id": "ORDERS_VIEW",
          "label": "View quotes and orders"
        },
        "x-required-scopes": ["ORDERS_READ"],
        "x-stability": "stable"
      }
    },
    "/orders/{id}/asks/{askId}/apply": {
      "post": {
        "description": "Confirm change (the customer’s requested value) or Apply change (another value, the request staying open) on an order’s change request, with the reply, through the order’s own save. Send the `version` from the review. Needs Handle customer messages and Edit quotes and orders, on a record the caller can change; the save then checks its own rules (what the change needs, Prices and exceptions for a price, the status lock), for an API key as for a person, and records the key as the one who made the change. A reply goes to the customer: from an API key it also needs Send emails, and counts against the key’s Emails per day cap. API keys need **Change orders**, and **Work the Inbox**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "order_ask_apply",
        "parameters": [
          {
            "description": "The id from a list.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "The `id` of an item from `GET …/asks`.",
            "in": "path",
            "name": "askId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AskApply"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AskApplied"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Apply an order’s open item",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "CUSTOMERS_SERVICE",
          "label": "Handle customer messages and change requests"
        },
        "x-required-scopes": ["ORDERS_WRITE"],
        "x-required-scopes-all": ["INBOX_WRITE"],
        "x-stability": "stable"
      }
    },
    "/orders/{id}/asks/{askId}/decision": {
      "post": {
        "description": "Settle a customer’s question or change request on an order: resolve, decline, apply (mark applied), reopen or accept, as the app does. Needs Handle customer messages, on an order the person can change. Accept and closing the last open change request can move the order’s status. API keys need **Work the Inbox**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "order_ask_decision",
        "parameters": [
          {
            "description": "The id from a list.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "The `id` of an item from `GET …/asks`.",
            "in": "path",
            "name": "askId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AskDecision"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AskDecided"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Decide an order’s open item",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "CUSTOMERS_SERVICE",
          "label": "Handle customer messages and change requests"
        },
        "x-required-scopes": ["INBOX_WRITE"],
        "x-stability": "stable"
      }
    },
    "/orders/{id}/asks/{askId}/review": {
      "get": {
        "description": "What the review drawer shows for one change request on an order: the customer’s message, the line, each value the option offers with its price and why it can’t go on the line, the money, the version to send back and why nothing can be decided now, if so. API keys need **Read orders**. Phones see only what their staff member’s role reaches. Preview: this endpoint’s shape may still change inside v1.",
        "operationId": "order_ask_review",
        "parameters": [
          {
            "description": "The id from a list.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "The `id` of an item from `GET …/asks`.",
            "in": "path",
            "name": "askId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AskReview"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Review an order’s open item",
        "x-rate-weight": 1,
        "x-required-permission": {
          "id": "ORDERS_VIEW",
          "label": "View quotes and orders"
        },
        "x-required-scopes": ["ORDERS_READ"],
        "x-stability": "preview"
      }
    },
    "/orders/{id}/attention": {
      "get": {
        "description": "Whether the order needs attention and who it is waiting on (the store, the customer, a vendor), checked fresh, with the suggested follow-up. API keys need **Read orders**. Phones see only what their staff member’s role reaches.",
        "operationId": "order_attention",
        "parameters": [
          {
            "description": "The id from a list.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Attention"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "See what needs attention on an order",
        "x-rate-weight": 1,
        "x-required-permission": {
          "id": "ORDERS_VIEW",
          "label": "View quotes and orders"
        },
        "x-required-scopes": ["ORDERS_READ"],
        "x-stability": "stable"
      },
      "post": {
        "description": "Act on the order’s Needs attention: ignore it for a few days, mark it followed up, or record that a follow-up went out (the app’s Ignore, Mark as followed up and follow-up sent). A reminder to the customer is sent first with `POST /conversations/{key}/reply`; this records it and restarts the wait. Needs Edit quotes and orders, on an order the person can change. Answers the attention as it stands now. A team reminder from an API key counts against its Emails per day cap. API keys need **Change orders**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "order_attention_action",
        "parameters": [
          {
            "description": "The id from a list.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AttentionAction"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Attention"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Act on an order’s attention",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "ORDERS_EDIT",
          "label": "Create and edit quotes and orders"
        },
        "x-required-scopes": ["ORDERS_WRITE"],
        "x-stability": "stable"
      }
    },
    "/orders/{id}/comments": {
      "post": {
        "description": "Add a comment to the activity feed. API keys need **Change orders**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "order_comment_create",
        "parameters": [
          {
            "description": "The id from a list.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CommentCreate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ActivityEntry"
                }
              }
            },
            "description": "Created"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Add a comment to an order",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "ORDERS_VIEW",
          "label": "View quotes and orders"
        },
        "x-required-scopes": ["ORDERS_WRITE"],
        "x-stability": "stable"
      }
    },
    "/orders/{id}/comments/{commentId}": {
      "delete": {
        "description": "Delete a comment the caller wrote, as the activity feed’s Delete (the same rule as editing it: an API key deletes only its own). Only a person’s comment can be deleted: any other entry is `404`. The comment can’t be brought back. API keys need **Change orders**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "order_comment_delete",
        "parameters": [
          {
            "description": "The id from a list.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "The comment’s `id` in the record’s activity (`GET /orders/{id}/activity`, an entry of type `comment`).",
            "in": "path",
            "name": "commentId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CommentDeleted"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Delete a comment on an order",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "ORDERS_VIEW",
          "label": "View quotes and orders"
        },
        "x-required-scopes": ["ORDERS_WRITE"],
        "x-stability": "stable"
      },
      "patch": {
        "description": "Change the text of a comment the caller wrote, as the activity feed’s Edit: an API key edits only its own comments; a phone’s staff member their own, or any as the store owner (with roles off, anyone who may change the record). Only a person’s comment can be changed: any other entry (a status change, a version) is `404`. Answers the entry. API keys need **Change orders**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "order_comment_edit",
        "parameters": [
          {
            "description": "The id from a list.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "The comment’s `id` in the record’s activity (`GET /orders/{id}/activity`, an entry of type `comment`).",
            "in": "path",
            "name": "commentId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CommentCreate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ActivityEntry"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Change a comment on an order",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "ORDERS_VIEW",
          "label": "View quotes and orders"
        },
        "x-required-scopes": ["ORDERS_WRITE"],
        "x-stability": "stable"
      }
    },
    "/orders/{id}/costs": {
      "get": {
        "description": "The order’s additional costs, as its Additional costs card lists them, oldest first: costs that came up after the sale (`kind` `delivery`, `labour` or `other`), each on the whole order or on one of its lines. Internal: never sent to Shopify, never on a customer document and never in the order’s total; Analytics › Profit and the order’s profit take them off before net. A split order (pickup and delivery parts for tax) holds its costs as one order. Needs View quotes and orders and View costs (a key: See costs or Enter and correct costs, and Read orders). API keys need **See costs** or **Enter and correct costs**. Phones see only what their staff member’s role reaches.",
        "operationId": "order_costs",
        "parameters": [
          {
            "description": "The order’s `id`, from `GET /orders`. A quote has none (`404`).",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrderCostList"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "List an order’s additional costs",
        "x-rate-weight": 1,
        "x-required-permission": {
          "id": "COSTS_VIEW",
          "label": "View costs"
        },
        "x-required-scopes": ["COSTS_READ", "COSTS_WRITE"],
        "x-stability": "stable"
      },
      "post": {
        "description": "Add an additional cost to the order (Additional costs › Add): what it was for, its kind and amount, on the whole order or on one of its lines (`line_id`). An order holds at most 50 (`422 CAP_REACHED`). Answers 201 with the cost. Internal: never sent to Shopify, never on a customer document and never in the order’s total; Analytics › Profit and the order’s profit take them off before net. Needs “Enter costs and charges” (a key: Enter and correct costs), with the order in the caller’s change scope. Each change writes a line in the order’s activity, without the amount. API keys need **Enter and correct costs**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "order_cost_create",
        "parameters": [
          {
            "description": "The order’s `id`, from `GET /orders`. A quote has none (`404`).",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OrderCostCreate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrderCost"
                }
              }
            },
            "description": "Created"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Add an additional cost",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "COSTS_ENTER",
          "label": "Enter costs and charges"
        },
        "x-required-scopes": ["COSTS_WRITE"],
        "x-stability": "stable"
      }
    },
    "/orders/{id}/costs/{costId}": {
      "delete": {
        "description": "Remove an additional cost recorded in error. Needs “Enter costs and charges” (a key: Enter and correct costs), with the order in the caller’s change scope. Each change writes a line in the order’s activity, without the amount. API keys need **Enter and correct costs**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "order_cost_delete",
        "parameters": [
          {
            "description": "The order’s `id`, from `GET /orders`. A quote has none (`404`).",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "The cost’s `id`, from `GET /orders/{id}/costs`.",
            "in": "path",
            "name": "costId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrderCostDeleted"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Remove an additional cost",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "COSTS_ENTER",
          "label": "Enter costs and charges"
        },
        "x-required-scopes": ["COSTS_WRITE"],
        "x-stability": "stable"
      },
      "patch": {
        "description": "Change an additional cost: only the fields sent change (the rest are kept); `line_id: null` moves it to the whole order. Answers the cost. Needs “Enter costs and charges” (a key: Enter and correct costs), with the order in the caller’s change scope. Each change writes a line in the order’s activity, without the amount. API keys need **Enter and correct costs**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "order_cost_edit",
        "parameters": [
          {
            "description": "The order’s `id`, from `GET /orders`. A quote has none (`404`).",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "The cost’s `id`, from `GET /orders/{id}/costs`.",
            "in": "path",
            "name": "costId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OrderCostEdit"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrderCost"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Change an additional cost",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "COSTS_ENTER",
          "label": "Enter costs and charges"
        },
        "x-required-scopes": ["COSTS_WRITE"],
        "x-stability": "stable"
      }
    },
    "/orders/{id}/customer-payment": {
      "get": {
        "description": "Whether the customer may pay the order themselves, as its Customer payment row shows: `enabled` (turned on, when and by whom) and `store_gates_payment` (the store’s setting that customers can pay only once payment is turned on). Payments the store records are never gated. API keys need **Read orders** or **Record and request payments**. Phones see only what their staff member’s role reaches.",
        "operationId": "order_customer_payment",
        "parameters": [
          {
            "description": "The id from a list.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CustomerPayment"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "See an order’s customer payment",
        "x-rate-weight": 1,
        "x-required-permission": {
          "id": "ORDERS_VIEW",
          "label": "View quotes and orders"
        },
        "x-required-scopes": ["ORDERS_READ", "PAYMENTS_WRITE"],
        "x-stability": "stable"
      },
      "post": {
        "description": "Turn customer payment on or off on the order, as its Enable and Disable payment do. While the store gates payment, on shows the customer Pay on the sign page, the payment link and the emails’ checkout links, and off hides them. Turning it off refunds nothing, and a payment request already sent keeps its own link until it is cancelled (`cancellable` in `GET /orders/{id}/payment-requests`, then `POST /payment-requests/{id}/cancel`). Asking for payment or recording one turns it on by itself. API keys need **Record and request payments**. An `Idempotency-Key` header makes a retry safe: the same key and body returns the first answer. Phones see only what their staff member’s role reaches.",
        "operationId": "order_customer_payment_set",
        "parameters": [
          {
            "description": "The id from a list.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CustomerPaymentSet"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CustomerPaymentChange"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Turn an order’s customer payment on or off",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "PAYMENTS_REQUEST",
          "label": "Request payment"
        },
        "x-required-scopes": ["PAYMENTS_WRITE"],
        "x-stability": "stable"
      }
    },
    "/orders/{id}/deposit": {
      "get": {
        "description": "Whether a deposit can be asked for on the order now, as its Request deposit says: `blocked_reason` is why not (the reason the button is greyed out, and what to do), null when it can. Ask for one with `POST /orders/{id}/payment-requests` and `deposit`. API keys need **Record and request payments**. Phones see only what their staff member’s role reaches.",
        "operationId": "order_deposit",
        "parameters": [
          {
            "description": "The id from a list.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DepositState"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "See if an order can take a deposit",
        "x-rate-weight": 1,
        "x-required-permission": {
          "id": "PAYMENTS_REQUEST",
          "label": "Request payment"
        },
        "x-required-scopes": ["PAYMENTS_WRITE"],
        "x-stability": "stable"
      }
    },
    "/orders/{id}/deposits": {
      "post": {
        "description": "Record a deposit the customer already paid outside Shopify (cash, a cheque, a transfer), as Request deposit’s Already paid does. Without Shopify Plus a deposit order is made and completed as paid in Shopify, on the queue, and nothing is sent to the customer; on Plus the order is placed with the deposit recorded on it (placing it needs Change orders, and `override_requirements` places it without a missing signature or deposit). Nothing is charged. Checked against the key’s Largest payment cap and Daily payment and refund limit. API keys need **Record and request payments**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "order_deposit_record",
        "parameters": [
          {
            "description": "The id from a list.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DepositRecord"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DepositRecorded"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Record an order’s deposit paid",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "PAYMENTS_RECORD",
          "label": "Record payment and Mark as paid"
        },
        "x-required-scopes": ["PAYMENTS_WRITE"],
        "x-stability": "stable"
      }
    },
    "/orders/{id}/draft": {
      "delete": {
        "description": "Delete an order’s Shopify draft order, as the admin’s Delete draft order does: only while the order isn’t a Shopify order yet. The order stays in OrderPilot without a draft (its pay link stops working, and stock it held is handed back); a split order’s delivery part loses its draft with it. Refused (`422 DELETE_REFUSED`) when there is no draft to delete. It can’t be undone, and counts against the key’s Deletes per day cap. API keys need **Delete records**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "order_draft_delete",
        "parameters": [
          {
            "description": "The id from a list.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrderDraftDeleted"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Delete an order’s draft",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "ORDERS_DELETE",
          "label": "Delete quotes and draft orders"
        },
        "x-required-scopes": ["DELETE"],
        "x-stability": "stable"
      }
    },
    "/orders/{id}/email-placeholders": {
      "get": {
        "description": "The merge fields the order’s email can use, each with this order’s value, as the composer shows them: `items` (the documented ones, such as `{{customer.name}}` and `{{document.number}}`, with what each means) and `values` (every field by its path, the editor’s names included). Values include the customer’s own link and portal PIN, so it needs what the send needs. API keys need **Change orders**, and **Send emails**. Phones see only what their staff member’s role reaches.",
        "operationId": "order_email_placeholders",
        "parameters": [
          {
            "description": "The id from a list.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmailPlaceholders"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "List an order’s merge fields",
        "x-rate-weight": 1,
        "x-required-permission": {
          "id": "ORDERS_VIEW",
          "label": "View quotes and orders"
        },
        "x-required-scopes": ["ORDERS_WRITE"],
        "x-required-scopes-all": ["EMAILS_SEND"],
        "x-stability": "stable"
      }
    },
    "/orders/{id}/force-convert": {
      "get": {
        "description": "Where a Force Convert to Order is, as the order page polls it: `placed` (it is an order now), `converting` (on the queue), `failed` (with the reason in `message`; nothing was placed) or `idle` (none running). Takes the quote’s id too: once placed, the quote is an order with the same id. API keys need **Read orders** or **Read quotes** or **Change orders** or **Create and change quotes**. Phones see only what their staff member’s role reaches.",
        "operationId": "force_convert_status",
        "parameters": [
          {
            "description": "The order’s or the quote’s `id`.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForceConvertStatus"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "See a force convert’s progress",
        "x-rate-weight": 1,
        "x-required-permission": {
          "id": "ORDERS_VIEW",
          "label": "View quotes and orders"
        },
        "x-required-scopes": [
          "ORDERS_READ",
          "QUOTES_READ",
          "ORDERS_WRITE",
          "QUOTES_WRITE"
        ],
        "x-stability": "stable"
      },
      "post": {
        "description": "Force Convert to Order: place the Draft Order now without the customer’s signature, as the admin’s ⋯ › Force Convert to Order. The signature is waived for good (pay links stop asking for it) and the placement runs on the queue. `202` with `state: converting`: read `GET /orders/{id}/force-convert` until it is `placed` (or `failed`, with why). Placed this way already: `200`, `already_converted: true`. Refused with the admin’s sentence: `422 CONVERSION_REFUSED`, `409 CONVERSION_IN_PROGRESS`, `409 SPLIT_PENDING`, `409 LOCATION_REQUIRED`. Leaving review needs Approve, a locked status Force Edit. Needs Create and edit and Skip requirements (a key: Change orders and Prices and exceptions). API keys need **Change orders**, and **Prices and exceptions**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "order_force_convert",
        "parameters": [
          {
            "description": "The id from a list.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Empty"
              }
            }
          },
          "required": false
        },
        "responses": {
          "202": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForceConvert"
                }
              }
            },
            "description": "Accepted"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Force convert a draft order",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "APPROVALS_REQUIREMENTS",
          "label": "Bypass signature and deposit requirements"
        },
        "x-required-scopes": ["ORDERS_WRITE"],
        "x-required-scopes-all": ["PRICING_WRITE"],
        "x-stability": "stable"
      }
    },
    "/orders/{id}/fulfillments": {
      "get": {
        "description": "Each line’s delivery: how many units were ordered, fulfilled in Shopify and delivered, and when each was handed over. Read only: fulfilling is done in Shopify. API keys need **Read orders**. Phones see only what their staff member’s role reaches.",
        "operationId": "order_fulfillments",
        "parameters": [
          {
            "description": "The id from a list.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FulfillmentList"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "List an order’s fulfillments",
        "x-rate-weight": 1,
        "x-required-permission": {
          "id": "ORDERS_VIEW",
          "label": "View quotes and orders"
        },
        "x-required-scopes": ["ORDERS_READ"],
        "x-stability": "stable"
      }
    },
    "/orders/{id}/handovers": {
      "get": {
        "description": "Where each line’s units are, as the order page’s hand-over view counts them: `waiting` (ready and paid, not collected or delivered yet: what `POST /orders/{id}/handovers` hands over), `held` (would be waiting, but `hold_reason` says why it can’t leave from OrderPilot), `on_order` (on a purchase order not received yet), `not_started` and `taken` (left the store). `marks` lists hand-overs still being sent to Shopify (`applying`) and those Shopify refused (`failed`). API keys need **Read orders**. Phones see only what their staff member’s role reaches.",
        "operationId": "order_handovers",
        "parameters": [
          {
            "description": "The id from a list.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HandoverView"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "See what is waiting for pickup",
        "x-rate-weight": 1,
        "x-required-permission": {
          "id": "ORDERS_VIEW",
          "label": "View quotes and orders"
        },
        "x-required-scopes": ["ORDERS_READ"],
        "x-stability": "stable"
      },
      "post": {
        "description": "Mark units collected or delivered, as the order page’s Mark collected and Mark delivered do: only units `waiting` in `GET /orders/{id}/handovers` leave, and only when the order is paid enough for them (the full price of what leaves plus the deposit of the rest). Without `lines`, every waiting unit leaves; a line without `quantity` hands over all of its waiting units. Shopify’s fulfilment follows on the queue (`marks.applying` until it is done). Refused with the order page’s sentence: `422 RULE_REFUSED` (not paid enough, nothing waiting, cancelled), `422 UNKNOWN_LINE`. Needs Change order status. API keys need **Change orders**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "order_handover_create",
        "parameters": [
          {
            "description": "The id from a list.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/HandoverCreate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HandoverCreated"
                }
              }
            },
            "description": "Created"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Mark items collected or delivered",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "ORDERS_STATUS",
          "label": "Change order status"
        },
        "x-required-scopes": ["ORDERS_WRITE"],
        "x-stability": "stable"
      }
    },
    "/orders/{id}/invoice-number": {
      "post": {
        "description": "Give the order its invoice number, for good, as the order page’s first invoice print does: the next number of the store’s own invoice numbering (Settings › Numbering). An order that has one keeps it (`assigned: false`); a store that doesn’t number its invoices itself gives none (`invoice_number: null`). The number is never given back, so number only an order the person wants invoiced. Then `GET /orders/{id}/invoice-pdf` prints it. Needs Create and edit quotes and orders (a key: Change orders), with the order in the caller’s change scope. API keys need **Change orders**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "order_invoice_number",
        "parameters": [
          {
            "description": "The order’s id, from `GET /orders`.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Empty"
              }
            }
          },
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrderInvoiceNumber"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Give an order its invoice number",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "ORDERS_EDIT",
          "label": "Create and edit quotes and orders"
        },
        "x-required-scopes": ["ORDERS_WRITE"],
        "x-stability": "stable"
      }
    },
    "/orders/{id}/invoice-pdf": {
      "get": {
        "description": "The order’s invoice as it is now, as a PDF, as the order page prints it. A read: it never gives the order an invoice number (`POST /orders/{id}/invoice-number` does), and prints the one the order has. `503 BUSY` with `Retry-After` while the PDF is still being built: try again then. API keys need **Read orders**. Phones see only what their staff member’s role reaches.",
        "operationId": "order_invoice_pdf",
        "parameters": [
          {
            "description": "The order’s id, from `GET /orders`.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/pdf": {
                "schema": {
                  "$ref": "#/components/schemas/Pdf"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Download an order’s invoice",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "ORDERS_VIEW",
          "label": "View quotes and orders"
        },
        "x-required-scopes": ["ORDERS_READ"],
        "x-stability": "stable"
      }
    },
    "/orders/{id}/invoices": {
      "get": {
        "description": "The order’s invoice versions, newest first, as the order page keeps them: a version is frozen when the order is created, revised after it was sent, or paid, and is what the customer saw then. Each with its number in the list (`version`), why it was made (`reason`), its payment state and totals then, and whether it is the current one. Also the order’s `invoice_number` (null until the invoice is first printed). Download one with `GET /orders/{id}/invoices/{snapshotId}`. API keys need **Read orders**. Phones see only what their staff member’s role reaches.",
        "operationId": "order_invoices",
        "parameters": [
          {
            "description": "The order’s id, from `GET /orders`.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Items per page, 1–50 (default 25). A larger value is clamped to 50.",
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 25,
              "maximum": 50,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "description": "The `next_cursor` of the previous page of this list. A cursor from another list is `400 INVALID_CURSOR`.",
            "in": "query",
            "name": "cursor",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrderInvoiceList"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "List an order’s invoice versions",
        "x-rate-weight": 1,
        "x-required-permission": {
          "id": "ORDERS_VIEW",
          "label": "View quotes and orders"
        },
        "x-required-scopes": ["ORDERS_READ"],
        "x-stability": "stable"
      }
    },
    "/orders/{id}/invoices/{snapshotId}": {
      "get": {
        "description": "One frozen invoice version as a PDF (`current`: the version the customer has now), exactly as it was issued. `404 NOT_FOUND` for a version of another order or one not ready yet; `503 BUSY` with `Retry-After` while its PDF is being made again: try again then. API keys need **Read orders**. Phones see only what their staff member’s role reaches.",
        "operationId": "order_invoice",
        "parameters": [
          {
            "description": "The order’s id, from `GET /orders`.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "An invoice version’s `id` from `GET /orders/{id}/invoices`, or `current` for the version the customer has now.",
            "in": "path",
            "name": "snapshotId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/pdf": {
                "schema": {
                  "$ref": "#/components/schemas/Pdf"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Download an invoice version",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "ORDERS_VIEW",
          "label": "View quotes and orders"
        },
        "x-required-scopes": ["ORDERS_READ"],
        "x-stability": "stable"
      }
    },
    "/orders/{id}/legal-hold": {
      "get": {
        "description": "The order’s standing legal hold, or null: while it holds, none of its signature evidence is deleted at the end of the retention period. A person places or lifts a hold on the order page (⋯ › Place legal hold, Lift legal hold); standing holds are listed in Settings › Account and data › Signature records. A key can’t change a hold. Needs View quotes and orders (a key: Read orders). API keys need **Read orders**. Phones see only what their staff member’s role reaches.",
        "operationId": "order_legal_hold",
        "parameters": [
          {
            "description": "The id from a list.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LegalHold"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get an order’s legal hold",
        "x-rate-weight": 1,
        "x-required-permission": {
          "id": "ORDERS_VIEW",
          "label": "View quotes and orders"
        },
        "x-required-scopes": ["ORDERS_READ"],
        "x-stability": "stable"
      }
    },
    "/orders/{id}/lines/{lineId}/sync-attributes": {
      "post": {
        "description": "Sync Shopify attributes on a saved Shopify product line, as the order screen’s line menu does: its option values are refreshed from its product’s own values in Shopify, without repricing the line. Queued: answers `202` with a `job_id`; read `GET /line-attribute-syncs/{jobId}` until it is `synced`, `refused` or `failed` (nothing changes unless it is `synced`). Only a Shopify product’s line (`422 RULE_REFUSED` for a template line); a status that locks editing needs Force Edit (Prices and exceptions). Values that change what the line’s options cost, other than the product’s own, need Override prices (the run is `refused` without it). API keys need **Change orders**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "order_line_attribute_sync",
        "parameters": [
          {
            "description": "The id from a list.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "The line’s `id` (`lines[].id` of `GET /orders/{id}`).",
            "in": "path",
            "name": "lineId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Empty"
              }
            }
          },
          "required": false
        },
        "responses": {
          "202": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LineAttributeSyncQueued"
                }
              }
            },
            "description": "Accepted"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Sync an order line’s attributes",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "ORDERS_EDIT",
          "label": "Create and edit quotes and orders"
        },
        "x-required-scopes": ["ORDERS_WRITE"],
        "x-stability": "stable"
      }
    },
    "/orders/{id}/next-step": {
      "get": {
        "description": "What needs doing next on the order, as the app’s Next action button lists it: the customer’s open questions and change requests first, the follow-up while it needs attention, then the shop’s own steps, each marked when it waits on the customer or a vendor. `primary_key` names the row the black button does; null when the first row waits, or nothing is left. `next_step` is null when the store has no published status map. API keys need **Read orders**. Phones see only what their staff member’s role reaches.",
        "operationId": "order_next_step",
        "parameters": [
          {
            "description": "The id from a list.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NextStep"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "See an order’s next step",
        "x-rate-weight": 1,
        "x-required-permission": {
          "id": "ORDERS_VIEW",
          "label": "View quotes and orders"
        },
        "x-required-scopes": ["ORDERS_READ"],
        "x-stability": "stable"
      }
    },
    "/orders/{id}/pay-link": {
      "post": {
        "description": "The order’s payment link for you to hand the customer yourself, as Copy payment link does: it opens the checkout while the customer may pay (once signed, when a signature is needed), else the order’s page, which says what is needed first; a split order’s link opens its page, where each part is paid. Handing it out is asking for payment, so customer payment turns on and a quote being priced shows its prices. Refused with the reason Copy payment link is greyed out (nothing to pay, not created yet, expired, Shopify catching up). API keys need **Record and request payments**. An `Idempotency-Key` header makes a retry safe: the same key and body returns the first answer. Phones see only what their staff member’s role reaches.",
        "operationId": "order_pay_link",
        "parameters": [
          {
            "description": "The id from a list.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Empty"
              }
            }
          },
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PayLink"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Copy an order’s payment link",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "PAYMENTS_REQUEST",
          "label": "Request payment"
        },
        "x-required-scopes": ["PAYMENTS_WRITE"],
        "x-stability": "stable"
      }
    },
    "/orders/{id}/payment-requests": {
      "get": {
        "description": "The order’s payment requests, newest first, as its Payments and invoices list shows them: a request for the balance (a Request payment email), a deposit, store credit, a POS payment, each with what it asked for and what was paid. A split order lists both parts’ requests. `link` is the request’s own payment link while it waits (Record and request payments only), and `cancellable` says whether `POST /payment-requests/{id}/cancel` can still cancel it. API keys need **Read orders** or **Record and request payments**. Phones see only what their staff member’s role reaches.",
        "operationId": "order_payment_requests",
        "parameters": [
          {
            "description": "The id from a list.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaymentRequestList"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "List an order’s payment requests",
        "x-rate-weight": 1,
        "x-required-permission": {
          "id": "ORDERS_VIEW",
          "label": "View quotes and orders"
        },
        "x-required-scopes": ["ORDERS_READ", "PAYMENTS_WRITE"],
        "x-stability": "stable"
      },
      "post": {
        "description": "Ask the customer to pay, as the order’s Request payment and Request deposit do. Without `deposit`: the Request payment email for the balance due, which records the request and turns customer payment on (it needs Send emails too, and counts against the key’s Emails per day cap). With `deposit`: without Shopify Plus, a deposit order whose link Shopify emails the customer (Settings › Deposit orders on); on Shopify Plus, Shopify’s own deposit on the draft’s terms, emailed by asking again without `deposit` once `sync_status` is `synced` (see `next`). Nothing is charged: the customer pays in Shopify’s checkout. Refused with the store’s reason when the order can’t be asked for payment now. `send_at` schedules the balance’s email for later, as the composer’s Schedule does. API keys need **Record and request payments**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "order_payment_request_create",
        "parameters": [
          {
            "description": "The id from a list.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PaymentRequestCreate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaymentRequestOutcome"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Request payment on an order",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "PAYMENTS_REQUEST",
          "label": "Request payment"
        },
        "x-required-scopes": ["PAYMENTS_WRITE"],
        "x-stability": "stable"
      }
    },
    "/orders/{id}/payment-requests/scheduled": {
      "get": {
        "description": "The order’s scheduled Request payment emails, newest first, as the composer’s Scheduled list shows them (the last 50 scheduled emails, Request payment templates only): who it goes to, when, and its state. `can_cancel` says whether it can still be stopped with `DELETE /orders/{id}/payment-requests/scheduled/{scheduleId}`. Schedule one with `send_at` on `POST /orders/{id}/payment-requests`. API keys need **Read orders** or **Record and request payments**. Phones see only what their staff member’s role reaches.",
        "operationId": "order_scheduled_payment_requests",
        "parameters": [
          {
            "description": "The id from a list.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ScheduledPaymentRequestList"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "List an order’s scheduled payment requests",
        "x-rate-weight": 1,
        "x-required-permission": {
          "id": "ORDERS_VIEW",
          "label": "View quotes and orders"
        },
        "x-required-scopes": ["ORDERS_READ", "PAYMENTS_WRITE"],
        "x-stability": "stable"
      }
    },
    "/orders/{id}/payment-requests/scheduled/{scheduleId}": {
      "delete": {
        "description": "Cancel a scheduled Request payment email on the order before it goes, as the composer’s Cancel. Refused once it is due to send. The email the key scheduled stays counted against its Emails per day cap. API keys need **Record and request payments**, and **Send emails**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "order_scheduled_payment_request_cancel",
        "parameters": [
          {
            "description": "The id from a list.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "A scheduled Request payment’s `id`, or the `schedule_id` the request answered.",
            "in": "path",
            "name": "scheduleId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ScheduledPaymentRequestCancelled"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Cancel an order’s scheduled payment request",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "CUSTOMERS_EMAIL",
          "label": "Email customers"
        },
        "x-required-scopes": ["PAYMENTS_WRITE"],
        "x-required-scopes-all": ["EMAILS_SEND"],
        "x-stability": "stable"
      }
    },
    "/orders/{id}/payments": {
      "post": {
        "description": "Record a payment taken outside Shopify (cash, a cheque, a bank transfer) on a Shopify order, as Record payment and Mark as paid do: paid in full, or a part on Shopify Plus, with `note` saying how it was paid and, for a part, `paid_at` when it was received. It is recorded in Shopify; nothing is charged anywhere else. Checked against the key’s Largest payment cap and its Daily payment and refund limit. API keys need **Record and request payments**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "order_payment",
        "parameters": [
          {
            "description": "The id from a list.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PaymentRecord"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Order"
                }
              }
            },
            "description": "OK"
          },
          "202": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReadBackPending"
                }
              }
            },
            "description": "Accepted: the write is done, but its record couldn’t be read back. Don’t send it again: read it with `read`."
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Take a payment",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "PAYMENTS_RECORD",
          "label": "Record payment and Mark as paid"
        },
        "x-required-scopes": ["PAYMENTS_WRITE"],
        "x-stability": "stable"
      }
    },
    "/orders/{id}/pdf": {
      "get": {
        "description": "The order as a PDF, as the app prints it (a signed order gives its signed copy). API keys need **Read orders**. Phones see only what their staff member’s role reaches.",
        "operationId": "order_pdf",
        "parameters": [
          {
            "description": "The id from a list.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/pdf": {
                "schema": {
                  "$ref": "#/components/schemas/Pdf"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Download an order’s PDF",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "ORDERS_VIEW",
          "label": "View quotes and orders"
        },
        "x-required-scopes": ["ORDERS_READ"],
        "x-stability": "stable"
      }
    },
    "/orders/{id}/profit": {
      "get": {
        "description": "The order’s profit, as its Profit window shows it: the figures Analytics › Profit adds up for this order whatever its period (what its lines sold for without tax, their landed cost, freight, commission, additional costs, net, what warranty claims cost less what vendors credited, the warranty still expected on units under cover, and net after warranty), with its lines, its additional costs and the warranty claims that cost something (the first 50; `more_warranty_claims` counts the rest). A split order (pickup and delivery parts for tax) reads as one order. Profit is for orders: a quote is `404`. Shows costs and everyone’s commission: needs View all commission and profit (a key: See commission). API keys need **See commission**. Phones see only what their staff member’s role reaches.",
        "operationId": "order_profit",
        "parameters": [
          {
            "description": "The order’s `id`, from `GET /sales-credit/orders` or the orders list. A quote has none (`404`).",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrderProfit"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "See an order’s profit",
        "x-rate-weight": 1,
        "x-required-permission": {
          "id": "COMMISSION_VIEW_ALL",
          "label": "View all commission and profit"
        },
        "x-required-scopes": ["COMMISSION_READ"],
        "x-stability": "stable"
      }
    },
    "/orders/{id}/purchase-needs": {
      "get": {
        "description": "What an order still needs bought, as the purchase-order workbench shows it: each line with its vendor and its parts (the product, and each stock-tracked option as its own part), each with the `component_key` a purchase order line takes, whether it is excluded from purchase orders, and how many units are still to buy (what open purchase orders and handed-over units don’t cover). `POST /purchase-orders` takes a line as `{ source_line_item_id, component_key, quantity }`, one vendor per purchase order. Needs View purchase orders, on an order the caller can see. API keys need **Read purchase orders** or **Manage purchase orders**. Phones see only what their staff member’s role reaches.",
        "operationId": "order_purchase_needs",
        "parameters": [
          {
            "description": "The id from a list.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrderPurchaseNeeds"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "List what an order needs bought",
        "x-rate-weight": 1,
        "x-required-permission": {
          "id": "PURCHASING_VIEW",
          "label": "View purchase orders"
        },
        "x-required-scopes": ["PURCHASING_READ", "PURCHASING_WRITE"],
        "x-stability": "stable"
      },
      "patch": {
        "description": "Leave a part of an order line off purchase orders, or put it back, as the purchase-order workbench does: the product itself (`line:` key) or one stock-tracked option (`cfv:` key), from `GET /orders/{id}/purchase-needs`. An excluded part shows `excluded: true` there and isn’t offered for a purchase order. Needs Prepare purchase orders, on an order the caller may change. API keys need **Manage purchase orders**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "order_purchase_need_exclude",
        "parameters": [
          {
            "description": "The id from a list.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PurchaseNeedExclude"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PurchaseNeedExcluded"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Leave a part off purchase orders",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "PURCHASING_PREPARE",
          "label": "Prepare purchase orders"
        },
        "x-required-scopes": ["PURCHASING_WRITE"],
        "x-stability": "stable"
      }
    },
    "/orders/{id}/quickbooks": {
      "get": {
        "description": "The order in QuickBooks, as the order page’s QuickBooks card shows it: whether customer orders post there at all (`posts`), the order’s sync `status` and its `message` (why it waits, isn’t posted or failed), the invoice and the payments, refunds and credits posted, and whether this caller may send it again (`can_retry`, with `POST /orders/{id}/quickbooks-sync`). The cost of goods posted and the gross profit only for a caller who may see costs (a key: See costs); `costs_hidden.reason` says so otherwise. API keys need **Read orders**. Phones see only what their staff member’s role reaches.",
        "operationId": "order_quickbooks",
        "parameters": [
          {
            "description": "The order’s id, from `GET /orders`.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrderQuickBooks"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "See an order in QuickBooks",
        "x-rate-weight": 1,
        "x-required-permission": {
          "id": "ORDERS_VIEW",
          "label": "View quotes and orders"
        },
        "x-required-scopes": ["ORDERS_READ"],
        "x-stability": "stable"
      }
    },
    "/orders/{id}/quickbooks-sync": {
      "post": {
        "description": "Send the order to QuickBooks again now, as the QuickBooks card’s Retry: it is marked `pending` and queued for the worker, which posts its invoice and payments to the merchant’s accounting. Read `GET /orders/{id}/quickbooks` for where it stands. `409 NOT_APPLICABLE` while customer orders don’t post to QuickBooks (Settings › Purchasing and accounting › QuickBooks); `503 QUEUE_FAILED` when it couldn’t be queued. Needs Create and edit quotes and orders (a key: Change orders), with the order in the caller’s change scope. API keys need **Change orders**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "order_quickbooks_sync",
        "parameters": [
          {
            "description": "The order’s id, from `GET /orders`.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Empty"
              }
            }
          },
          "required": false
        },
        "responses": {
          "202": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrderQuickBooksSync"
                }
              }
            },
            "description": "Accepted"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Send an order to QuickBooks",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "ORDERS_EDIT",
          "label": "Create and edit quotes and orders"
        },
        "x-required-scopes": ["ORDERS_WRITE"],
        "x-stability": "stable"
      }
    },
    "/orders/{id}/refund-options": {
      "get": {
        "description": "The order’s payment methods and the most each can still refund, read from Shopify, and the Store credit row (refund to the customer’s Shopify store credit): the rows a refund’s `legs` name. API keys need **Refunds and returns**. Phones see only what their staff member’s role reaches.",
        "operationId": "order_refund_options",
        "parameters": [
          {
            "description": "The id from a list.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RefundOptions"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "See refund options",
        "x-rate-weight": 1,
        "x-required-permission": {
          "id": "PAYMENTS_REFUND",
          "label": "Refund payments"
        },
        "x-required-scopes": ["REFUNDS_WRITE"],
        "x-stability": "stable"
      }
    },
    "/orders/{id}/refunds": {
      "post": {
        "description": "Refund part or all of what was paid on an order, as the app’s Refund, in Shopify: one amount per payment method (`legs`, rows from `GET /orders/{id}/refund-options`), or `amount` for an order with one refundable method. The Store credit row gives the amount to the customer’s Shopify store credit instead. Checked against the key’s Largest refund cap and its Daily payment and refund limit. API keys need **Refunds and returns**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "order_refund",
        "parameters": [
          {
            "description": "The id from a list.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RefundCreate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Order"
                }
              }
            },
            "description": "OK"
          },
          "202": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReadBackPending"
                }
              }
            },
            "description": "Accepted: the write is done, but its record couldn’t be read back. Don’t send it again: read it with `read`."
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Refund an order",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "PAYMENTS_REFUND",
          "label": "Refund payments"
        },
        "x-required-scopes": ["REFUNDS_WRITE"],
        "x-stability": "stable"
      }
    },
    "/orders/{id}/return-options": {
      "get": {
        "description": "What can come back on a placed order, read from Shopify as the Refund or return dialog’s Return items tab reads it: each line’s returnable units, its prices (what returning 1, 2, … units takes off, tax included), Shopify’s return reasons and whether it can be restocked; the returns opened in Shopify that wait to be processed; and `blocked_reason` when items can’t be returned here now. API keys need **Refunds and returns**. Phones see only what their staff member’s role reaches.",
        "operationId": "order_return_options",
        "parameters": [
          {
            "description": "The id from a list.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReturnOptions"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "See return options",
        "x-rate-weight": 1,
        "x-required-permission": {
          "id": "PAYMENTS_REFUND",
          "label": "Refund payments"
        },
        "x-required-scopes": ["REFUNDS_WRITE"],
        "x-stability": "stable"
      }
    },
    "/orders/{id}/returns": {
      "post": {
        "description": "Return items on a placed order and process the return in Shopify, as the Return items tab does: a Shopify return is made for the units (or `shopify_return_id`, a return opened in Shopify, is processed), each unit goes back into stock where it shipped from unless `restock` is false, and a restocking fee may be kept. Then the refund: `refund.legs` (rows from `GET /orders/{id}/refund-options`) or `refund.amount`, or `refund.later` to refund afterwards with `POST /orders/{id}/refunds`. The refund is checked against the key’s Largest refund cap and Daily payment and refund limit before anything is done. Answers what Shopify did: the return and each refund made. API keys need **Refunds and returns**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "order_return",
        "parameters": [
          {
            "description": "The id from a list.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReturnCreate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReturnMade"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Return items",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "PAYMENTS_REFUND",
          "label": "Refund payments"
        },
        "x-required-scopes": ["REFUNDS_WRITE"],
        "x-stability": "stable"
      }
    },
    "/orders/{id}/returns/preview": {
      "post": {
        "description": "Work out a return before making it, as the Return items tab does, from Shopify: what it takes off for the units (`items_total`, tax included), the restocking fee the store keeps (`fees_total`) and what the customer is owed back (`owed`). Nothing is made or changed. Lines and reasons come from `GET /orders/{id}/return-options`. API keys need **Refunds and returns**. An `Idempotency-Key` header makes a retry safe: the same key and body returns the first answer. Phones see only what their staff member’s role reaches.",
        "operationId": "order_return_preview",
        "parameters": [
          {
            "description": "The id from a list.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReturnPreview"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReturnAmounts"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Preview a return",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "PAYMENTS_REFUND",
          "label": "Refund payments"
        },
        "x-required-scopes": ["REFUNDS_WRITE"],
        "x-stability": "stable"
      }
    },
    "/orders/{id}/review": {
      "post": {
        "description": "A reviewer’s decision on the order, as the review queue’s Approve, Reject and Request changes: `approve` keeps it a order; `reject` and `request_changes` move it to its Rejected or Changes Requested status, `note` kept as the feedback and in the activity. The status map then moves it, as in the admin. Send the record’s `version` from its read, a list row or your last change (or its `updated_at` as `expected_updated_at`); changed since: `409 STALE_VERSION` with the current `version`. The answer carries the next `version`. Refused with the queue’s sentence: `422 RULE_REFUSED`, `409 STATUS_CONFLICT`. Needs Approve and reject (a key: Prices and exceptions). API keys need **Change orders**, and **Prices and exceptions**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "order_review",
        "parameters": [
          {
            "description": "The id from a list.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReviewDecision"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReviewDecided"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Decide an order’s review",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "APPROVALS_REVIEW",
          "label": "Approve, reject or request changes"
        },
        "x-required-scopes": ["ORDERS_WRITE"],
        "x-required-scopes-all": ["PRICING_WRITE"],
        "x-stability": "stable"
      }
    },
    "/orders/{id}/sales-split": {
      "get": {
        "description": "An order’s or quote’s sales credit as the order page’s Sales credit card reads it: the split mode, who is credited with what share, each line’s own split and code. `with` (staff ids, comma separated, up to 10) adds people about to be added. Needs View orders, on a record the role reaches. Rates show only to who may see them. API keys need **Read orders** or **Change sales credit**. Phones see only what their staff member’s role reaches.",
        "operationId": "sales_split",
        "parameters": [
          {
            "description": "The order’s `id`.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Staff ids to include as `others`, comma separated (up to 10).",
            "in": "query",
            "name": "with",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SalesSplit"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "See the sales split",
        "x-rate-weight": 1,
        "x-required-permission": {
          "id": "ORDERS_VIEW",
          "label": "View quotes and orders"
        },
        "x-required-scopes": ["ORDERS_READ", "COMMISSION_WRITE"],
        "x-stability": "stable"
      },
      "post": {
        "description": "Change an order’s sales credit, as the Sales credit card’s Save: one split for the order or a split per item (switching between them), and the commission code on items. Who is credited is changed with `salesperson_ids` on the order’s edit. Needs Change sales credit, on a record the role may change; taking someone with a set rate off an item or putting a code on an item also needs Assign roles and locations, as in the app. An API key holds Assign roles and locations with Manage staff. API keys need **Change sales credit**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "sales_split_save",
        "parameters": [
          {
            "description": "The order’s `id`.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SalesSplitSave"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SalesSplitSaved"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Save the sales split",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "ORDERS_SALES_CREDIT",
          "label": "Change sales credit"
        },
        "x-required-scopes": ["COMMISSION_WRITE"],
        "x-stability": "stable"
      }
    },
    "/orders/{id}/scheduled-emails": {
      "get": {
        "description": "The order’s scheduled emails and texts, newest first (the last 50), as the composer’s Scheduled list: what goes, to whom, when, and its state. `can_cancel` says whether `DELETE /orders/{id}/scheduled-emails/{scheduleId}` can still stop it. Schedule one with `send_at` on `POST /orders/{id}/send`. API keys need **Read orders**. Phones see only what their staff member’s role reaches.",
        "operationId": "order_scheduled_emails",
        "parameters": [
          {
            "description": "The id from a list.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ScheduledEmailList"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "List an order’s scheduled emails",
        "x-rate-weight": 1,
        "x-required-permission": {
          "id": "ORDERS_VIEW",
          "label": "View quotes and orders"
        },
        "x-required-scopes": ["ORDERS_READ"],
        "x-stability": "stable"
      }
    },
    "/orders/{id}/scheduled-emails/{scheduleId}": {
      "delete": {
        "description": "Cancel a scheduled email (or text) on the order before it goes, as the composer’s Cancel. Refused once it is due to send. The email the key scheduled stays counted against its Emails per day cap. API keys need **Change orders**, and **Send emails**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "order_scheduled_email_cancel",
        "parameters": [
          {
            "description": "The id from a list.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "The scheduled email’s `id`, from `GET /orders/{id}/scheduled-emails`, or the `schedule_id` the send answered.",
            "in": "path",
            "name": "scheduleId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ScheduledEmailCancelled"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Cancel an order’s scheduled email",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "CUSTOMERS_EMAIL",
          "label": "Email customers"
        },
        "x-required-scopes": ["ORDERS_WRITE"],
        "x-required-scopes-all": ["EMAILS_SEND"],
        "x-stability": "stable"
      }
    },
    "/orders/{id}/send": {
      "post": {
        "description": "Email the order to the customer with one of the store’s customer email templates, in its own words or yours (`subject`, `message`; with no template, your own email as typed), now or at `send_at`. Check it first with `POST /orders/{id}/send/preview`. Counts against the key’s Emails per day cap (a scheduled one when it is scheduled). API keys need **Change orders**, and **Send emails**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "order_send",
        "parameters": [
          {
            "description": "The id from a list.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SendEmail"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmailQueued"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Send an order to the customer",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "CUSTOMERS_EMAIL",
          "label": "Email customers"
        },
        "x-required-scopes": ["ORDERS_WRITE"],
        "x-required-scopes-all": ["EMAILS_SEND"],
        "x-stability": "stable"
      }
    },
    "/orders/{id}/send/preview": {
      "post": {
        "description": "The email as the order’s composer previews it, sending nothing: a template (`template_key`, from `GET /email-templates`) with its own words or yours (`subject`, `message`, with merge fields from `GET /orders/{id}/email-placeholders`), or with no template your own email as typed. The recipients decide the “what changed” lines a quote’s email lists. Answers the subject, the text, the HTML and the button’s link (the customer’s sign or portal link). Changes nothing. Needs what the send needs (the customer’s own links are in it). The payment request template is refused: it is sent and checked with `POST /orders/{id}/payment-requests`. API keys need **Change orders**, and **Send emails**. An `Idempotency-Key` header makes a retry safe: the same key and body returns the first answer. Phones see only what their staff member’s role reaches.",
        "operationId": "order_send_preview",
        "parameters": [
          {
            "description": "The id from a list.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EmailCompose"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmailPreview"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Preview an order’s email",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "ORDERS_VIEW",
          "label": "View quotes and orders"
        },
        "x-required-scopes": ["ORDERS_WRITE"],
        "x-required-scopes-all": ["EMAILS_SEND"],
        "x-stability": "stable"
      }
    },
    "/orders/{id}/send/test": {
      "post": {
        "description": "Send a test of the order’s email to one address (`test_to`), as the composer’s Send test: the same body as the preview, marked a test, to nobody else. With the PDF it is queued (`queued: true`, its result is in the store’s email activity); otherwise it is sent now. Refused when the store can’t send it, the test allowance is used, or the order’s location isn’t on the store’s plan. Counts against the key’s Emails per day cap. API keys need **Change orders**, and **Send emails**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "order_send_test",
        "parameters": [
          {
            "description": "The id from a list.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EmailTest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmailTestSent"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Send a test of an order’s email",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "CUSTOMERS_EMAIL",
          "label": "Email customers"
        },
        "x-required-scopes": ["ORDERS_WRITE"],
        "x-required-scopes-all": ["EMAILS_SEND"],
        "x-stability": "stable"
      }
    },
    "/orders/{id}/serials": {
      "get": {
        "description": "The order’s serial numbers, as the order page’s serial numbers dialog lists them: per line, how many units are fulfilled, whether its product asks for a serial on each, and each unit with its serial or none yet. Only a fulfilled unit takes a serial. API keys need **Read orders**. Phones see only what their staff member’s role reaches.",
        "operationId": "order_serials",
        "parameters": [
          {
            "description": "The id from a list.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrderSerials"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "List an order’s serial numbers",
        "x-rate-weight": 1,
        "x-required-permission": {
          "id": "ORDERS_VIEW",
          "label": "View quotes and orders"
        },
        "x-required-scopes": ["ORDERS_READ"],
        "x-stability": "stable"
      },
      "post": {
        "description": "Add, correct or clear serial numbers on fulfilled units, as the serial numbers dialog saves them: all or nothing, with the serials’ `version` from the last answer (or each unit’s `previous_serial`), so a change someone made since is refused instead of overwritten. A serial is on one unit of a product at a time across every order. A correction keeps what it replaced in the order’s activity. Refused fields come back in `field_errors` (`409 CONFLICT`). Needs Add and edit serial numbers. Answers the order’s serials. API keys need **Change orders**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "order_serials_save",
        "parameters": [
          {
            "description": "The id from a list.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SerialsSave"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrderSerials"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Save serial numbers",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "RECEIVING_SERIALS",
          "label": "Add and edit serial numbers"
        },
        "x-required-scopes": ["ORDERS_WRITE"],
        "x-stability": "stable"
      }
    },
    "/orders/{id}/sign-link": {
      "post": {
        "description": "The order’s sign link for you to hand the customer yourself, as Copy sign link does (for a store that doesn’t email through OrderPilot): the page where they view, sign and pay. Handing it out asks them to sign, so it takes the same rights as Request signature; a quote being priced shows its prices. Refused with the reason Copy sign link is greyed out (not created yet, expired, the customer’s open items). Sends nothing. API keys need **Change orders**, and **Send emails**. An `Idempotency-Key` header makes a retry safe: the same key and body returns the first answer. Phones see only what their staff member’s role reaches.",
        "operationId": "order_sign_link",
        "parameters": [
          {
            "description": "The id from a list.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Empty"
              }
            }
          },
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SignLink"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Copy an order’s sign link",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "CUSTOMERS_EMAIL",
          "label": "Email customers"
        },
        "x-required-scopes": ["ORDERS_WRITE"],
        "x-required-scopes-all": ["EMAILS_SEND"],
        "x-stability": "stable"
      }
    },
    "/orders/{id}/signature-request": {
      "post": {
        "description": "Email the customer the Request signature email (or the store’s own version of it), as the order’s Request signature does: it carries the sign link, and once it went out the customer has to sign before they pay. Waits on the customer’s open questions and change requests, as the app does. Counts against the key’s Emails per day cap. API keys need **Change orders**, and **Send emails**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "order_signature_request",
        "parameters": [
          {
            "description": "The id from a list.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SignatureRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmailQueued"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Request an order’s signature",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "CUSTOMERS_EMAIL",
          "label": "Email customers"
        },
        "x-required-scopes": ["ORDERS_WRITE"],
        "x-required-scopes-all": ["EMAILS_SEND"],
        "x-stability": "stable"
      }
    },
    "/orders/{id}/signatures": {
      "get": {
        "description": "The order’s signature records, newest first, as its Signature history lists them: each signature given on it (online through the sign link, on the store’s iPad, or on paper and recorded by staff), whether it still stands (`current`) or was replaced by an edit or a later signature (`superseded`), who signed and when, the consent they gave, the request’s address and device, what happened before (the link sent and opened), whether the signed PDF is stored, and a paper signature’s scan. A record whose files were deleted at the end of the store’s retention period says so in `purged`. Up to 100. An order turned from a signed quote lists the quote’s signature. API keys need **Read orders**. Phones see only what their staff member’s role reaches.",
        "operationId": "order_signatures",
        "parameters": [
          {
            "description": "The id from a list.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SignatureList"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "List an order’s signatures",
        "x-rate-weight": 1,
        "x-required-permission": {
          "id": "ORDERS_VIEW",
          "label": "View quotes and orders"
        },
        "x-required-scopes": ["ORDERS_READ"],
        "x-stability": "stable"
      }
    },
    "/orders/{id}/signed-copy/send": {
      "post": {
        "description": "Email the customer their signed PDF again, as the order menu’s Email signed copy (the one sent at signing failed, or the customer lost it). Refused when the order isn’t signed, when the signature was recorded from an external copy (no signed PDF), or when the store doesn’t send signed copies, with what to do. A retry with the same Idempotency-Key never sends twice. Counts against the key’s Emails per day cap. API keys need **Change orders**, and **Send emails**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "order_signed_copy_send",
        "parameters": [
          {
            "description": "The id from a list.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Empty"
              }
            }
          },
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SignedCopySent"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Email an order’s signed copy",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "CUSTOMERS_EMAIL",
          "label": "Email customers"
        },
        "x-required-scopes": ["ORDERS_WRITE"],
        "x-required-scopes-all": ["EMAILS_SEND"],
        "x-stability": "stable"
      }
    },
    "/orders/{id}/status": {
      "post": {
        "description": "Move an order to another status, named or by id. A status the store hasn’t, or one it can’t move to, is refused naming the statuses it can move to. API keys need **Change orders**. An `Idempotency-Key` header makes a retry safe: the same key and body returns the first answer. Phones see only what their staff member’s role reaches.",
        "operationId": "order_status",
        "parameters": [
          {
            "description": "The id from a list.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/StatusChange"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StatusChanged"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Change an order’s status",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "ORDERS_STATUS",
          "label": "Change order status"
        },
        "x-required-scopes": ["ORDERS_WRITE"],
        "x-stability": "stable"
      }
    },
    "/orders/{id}/store-credit": {
      "get": {
        "description": "The customer’s Shopify store credit for the order, as Payments’ Store credit reads it: what they have in the order’s currency, the balance due, the amount to offer and `blocked_reason` (why credit can’t pay it now). A placed order is paid now (without Shopify Plus only the whole balance); before placing, without Plus the credit pays a deposit (a cent at least stays due), and on Plus it places the order. API keys need **Record and request payments**. Phones see only what their staff member’s role reaches.",
        "operationId": "order_store_credit",
        "parameters": [
          {
            "description": "The id from a list.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StoreCredit"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "See an order’s store credit",
        "x-rate-weight": 1,
        "x-required-permission": {
          "id": "PAYMENTS_RECORD",
          "label": "Record payment and Mark as paid"
        },
        "x-required-scopes": ["PAYMENTS_WRITE"],
        "x-stability": "stable"
      },
      "post": {
        "description": "Pay the order from the customer’s Shopify store credit, as Payments’ Store credit does: a debit of their Shopify balance, recorded as a payment in Shopify. A placed order is paid now (without Shopify Plus only the whole balance); before placing, without Plus a deposit is paid from the credit on the queue (`queued`), and on Plus the order is placed with the credit paid on it (placing it needs Change orders; `override_requirements` places it without a missing signature or deposit). Read `GET /orders/{id}/store-credit` first. Checked against the key’s Largest payment cap and Daily payment and refund limit. API keys need **Record and request payments**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "order_store_credit_pay",
        "parameters": [
          {
            "description": "The id from a list.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/StoreCreditPay"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StoreCreditPaid"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Pay an order with store credit",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "PAYMENTS_RECORD",
          "label": "Record payment and Mark as paid"
        },
        "x-required-scopes": ["PAYMENTS_WRITE"],
        "x-stability": "stable"
      }
    },
    "/orders/{id}/supply": {
      "get": {
        "description": "Where each line of the order is coming from, as the order page’s supply view shows it: `state` (`received`, `on_the_way`, `from_stock` or `unknown`), the purchase orders it is on with what each ordered and received (their `id` opens with `GET /purchase-orders/{id}`), units held at another location, units lost while the order was cancelled, the stock hold of a line sold from stock, and its cost. Costs (`unit_cost`, `total_cost`) only when the store shows cost on the order page and the caller may see costs (a key: See costs); otherwise they are null and `costs_hidden.reason` says why. A split order (pickup and delivery parts for tax) reads as one, with both parts’ lines. A quote has nothing bought yet: it has no supply. API keys need **Read orders**. Phones see only what their staff member’s role reaches.",
        "operationId": "order_supply",
        "parameters": [
          {
            "description": "The order’s id, from `GET /orders`.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrderSupply"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "See where an order’s items come from",
        "x-rate-weight": 1,
        "x-required-permission": {
          "id": "ORDERS_VIEW",
          "label": "View quotes and orders"
        },
        "x-required-scopes": ["ORDERS_READ"],
        "x-stability": "stable"
      }
    },
    "/orders/{id}/sync-retry": {
      "post": {
        "description": "Send the record to Shopify again after its sync failed (`sync_status` `failed`), as the order page’s Retry sync does: its Shopify draft is made, or updated, again on the queue. Answers at once with `sync_status: pending`; read the record again until it is `synced`. `409 SYNC_IN_PROGRESS` while a sync is running, `422 NOT_APPLICABLE` when there is nothing to retry (it is `synced`, or has no lines), `422 RULE_REFUSED` when its status cancels it in Shopify. API keys need **Change orders**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "order_sync_retry",
        "parameters": [
          {
            "description": "The id from a list.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Empty"
              }
            }
          },
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SyncRetry"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Retry an order’s Shopify sync",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "ORDERS_EDIT",
          "label": "Create and edit quotes and orders"
        },
        "x-required-scopes": ["ORDERS_WRITE"],
        "x-stability": "stable"
      }
    },
    "/orders/{id}/warranty": {
      "get": {
        "description": "The warranty cover of an order or a quote, line by line (terms, exclusions, plans, who set them), and the store’s term presets: what the record’s Warranty card reads. An API key reads an order’s with Read orders and a quote’s with Read quotes. API keys need **Read orders** or **Read quotes**. Phones see only what their staff member’s role reaches.",
        "operationId": "order_warranty",
        "parameters": [
          {
            "description": "The order’s or the quote’s `id`.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrderWarranty"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "See an order’s warranty",
        "x-rate-weight": 1,
        "x-required-permission": {
          "id": "ORDERS_VIEW",
          "label": "View quotes and orders"
        },
        "x-required-scopes": ["ORDERS_READ", "QUOTES_READ"],
        "x-stability": "stable"
      },
      "post": {
        "description": "Change one line’s warranty on an order or a quote, as its Warranty card: `add_plan` (a plan at its set price: a priced fee), `remove_plan`, `override_term`, `clear_override`, `lift_exclusion` (cover an excluded part, or exclude it again), `add_exception`, `reset`. Ids from `GET /orders/{id}/warranty`. Giving cover the line wouldn’t have needs Override warranty coverage (a key: Refunds and returns). Money that moves resyncs the Shopify draft on the queue; a signed quote’s signature is cleared, as an edit does. A completed Shopify order’s warranty can’t change (`409 CONFLICT`). Answers the record’s warranty, as `GET /orders/{id}/warranty`. A key changes an order’s with Change orders and a quote’s with Create and change quotes. API keys need **Change orders** or **Create and change quotes**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "order_warranty_edit",
        "parameters": [
          {
            "description": "The order’s or the quote’s `id`.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WarrantyLineChange"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrderWarranty"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Change a line’s warranty",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "ORDERS_EDIT",
          "label": "Create and edit quotes and orders"
        },
        "x-required-scopes": ["ORDERS_WRITE", "QUOTES_WRITE"],
        "x-stability": "stable"
      }
    },
    "/payment-requests/{id}/cancel": {
      "post": {
        "description": "Cancel a payment request that is still waiting (`cancellable` on the list), as Cancel request does: its link stops working, and its Shopify invoice or deposit order is removed. Refused when the customer may have paid it already, or when store credit was taken for it. Nothing is refunded: a payment made stays, and is refunded in Shopify. API keys need **Record and request payments**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "payment_request_cancel",
        "parameters": [
          {
            "description": "The payment request’s `id`, from `GET /orders/{id}/payment-requests` or `GET /quotes/{id}/payment-requests`.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Empty"
              }
            }
          },
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaymentRequest"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Cancel a payment request",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "PAYMENTS_REQUEST",
          "label": "Request payment"
        },
        "x-required-scopes": ["PAYMENTS_WRITE"],
        "x-stability": "stable"
      }
    },
    "/payment-requests/{id}/mark-paid": {
      "post": {
        "description": "Mark a pending deposit paid outside Shopify (cash after its link went out), as the deposit’s Mark as paid does: its deposit order is completed as paid in Shopify, on the queue. Only a deposit still `pending`, and not one paid from store credit. Nothing is charged. Checked against the key’s Largest payment cap and Daily payment and refund limit. API keys need **Record and request payments**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "payment_request_mark_paid",
        "parameters": [
          {
            "description": "The deposit’s payment request `id` (`kind` `deposit`), from `GET /orders/{id}/payment-requests` or `GET /quotes/{id}/payment-requests`.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DepositMarkPaid"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DepositRecorded"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Mark a deposit paid",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "PAYMENTS_RECORD",
          "label": "Record payment and Mark as paid"
        },
        "x-required-scopes": ["PAYMENTS_WRITE"],
        "x-stability": "stable"
      }
    },
    "/payment-terms": {
      "get": {
        "description": "The payment terms a quote or order can be set to (Shopify’s templates). API keys need **Read quotes** or **Read orders**. Phones see only what their staff member’s role reaches.",
        "operationId": "payment_terms",
        "parameters": [],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaymentTermsList"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "List payment terms",
        "x-rate-weight": 1,
        "x-required-permission": {
          "id": "ORDERS_VIEW",
          "label": "View quotes and orders"
        },
        "x-required-scopes": ["QUOTES_READ", "ORDERS_READ"],
        "x-stability": "stable"
      }
    },
    "/permissions": {
      "get": {
        "description": "Every permission a role can be given, as the role editor lists them, in its groups and order: each with its `id` (what `permissions` on `POST /roles` and `PATCH /roles/{id}` takes), its label and help, whether it is sensitive or can’t be undone, and the permissions it brings with it (`needs`). The same for every store. An API key needs Manage staff. API keys need **Manage staff**.",
        "operationId": "permissions",
        "parameters": [],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PermissionList"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "List permissions",
        "x-rate-weight": 1,
        "x-required-scopes": ["STAFF_MANAGE"],
        "x-stability": "stable"
      }
    },
    "/product-categories": {
      "get": {
        "description": "Shopify’s standard product categories whose name matches `q`, best match first, as the template editor’s Tax category picker finds them: what a product import’s `category_id` and a template’s tax category take. Read live from Shopify’s product taxonomy, the same for every store; archived categories are left out, so a page can hold fewer than 25 while `next_cursor` is set. `503 BUSY` with `Retry-After` while Shopify limits the store’s calls; `502` when Shopify can’t be reached. API keys need **Read the catalog** or **Change the catalog**.",
        "operationId": "product_categories",
        "parameters": [
          {
            "description": "What the category is called, or part of it (`sofa`, `lamps`): 2–100 characters.",
            "in": "query",
            "name": "q",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "The `next_cursor` of the previous page of this list. A cursor from another list is `400 INVALID_CURSOR`.",
            "in": "query",
            "name": "cursor",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProductCategoryList"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Search product categories",
        "x-rate-weight": 1,
        "x-required-scopes": ["CATALOG_READ", "CATALOG_WRITE"],
        "x-stability": "stable"
      }
    },
    "/product-spec-entries": {
      "get": {
        "description": "The store’s product spec designers or finishes (Shopify metaobject entries), every one A–Z, as the spec pickers list them: what a product’s spec sheet names. `503 BUSY` while Shopify limits the store’s calls; `502 SHOPIFY_UNAVAILABLE` when Shopify can’t be reached. API keys need **Read the catalog**.",
        "operationId": "product_spec_entries",
        "parameters": [
          {
            "description": "`designer` or `finish`.",
            "in": "query",
            "name": "type",
            "required": true,
            "schema": {
              "enum": ["designer", "finish"],
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProductSpecEntries"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "List spec designers or finishes",
        "x-rate-weight": 1,
        "x-required-scopes": ["CATALOG_READ"],
        "x-stability": "stable"
      }
    },
    "/product-template-exports": {
      "post": {
        "description": "Start an export of the store’s product templates as the import CSV, as the Products page’s Export does for a large catalog: it is written in the background. Read it with `GET /product-template-exports/{id}` until `status` is `completed`, then download `download_url`. A second start while one runs for the same scope answers that one. `201` with the export. Never carries costs for a caller who can’t see them. API keys need **Change the catalog**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "product_template_export_create",
        "parameters": [
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TemplateExportInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TemplateExport"
                }
              }
            },
            "description": "Created"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Start a template export",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "CATALOG_MANAGE",
          "label": "Manage the catalog"
        },
        "x-required-scopes": ["CATALOG_WRITE"],
        "x-stability": "stable"
      }
    },
    "/product-template-exports/{id}": {
      "get": {
        "description": "One template export: `queued`, `running`, `completed` (with `download_url`, a link to the CSV that works for 15 minutes without sign-in; read again for a fresh one), `failed` (`failure_message`) or `expired` (files are kept a day). API keys need **Change the catalog**. Phones see only what their staff member’s role reaches.",
        "operationId": "product_template_export",
        "parameters": [
          {
            "description": "The export’s `id` from `POST /product-template-exports`.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TemplateExport"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get a template export",
        "x-rate-weight": 1,
        "x-required-permission": {
          "id": "CATALOG_MANAGE",
          "label": "Manage the catalog"
        },
        "x-required-scopes": ["CATALOG_WRITE"],
        "x-stability": "stable"
      }
    },
    "/product-templates": {
      "get": {
        "description": "Active product templates (OrderPilot’s own made-to-order products; drafts too with `status`), newest change first unless `sort` says otherwise. Each item says `kind: product_template`, its `status` and its Shopify `sync_status`. The store’s Shopify products are `GET /products`: the two lists never repeat a product. API keys need **Read the catalog**.",
        "operationId": "product_templates",
        "parameters": [
          {
            "description": "Items per page, 1–50 (default 25). A larger value is clamped to 50.",
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 25,
              "maximum": 50,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "description": "The `next_cursor` of the previous page of this list. A cursor from another list is `400 INVALID_CURSOR`.",
            "in": "query",
            "name": "cursor",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Only items changed at or after this time (ISO 8601).",
            "in": "query",
            "name": "updated_since",
            "required": false,
            "schema": {
              "format": "date-time",
              "type": "string"
            }
          },
          {
            "description": "Search, as the order pickers do: every word must be found in the title, the SKU prefix, a category or a vendor the template offers. 2–100 characters.",
            "in": "query",
            "name": "q",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "The order of the list: `-updated_at` (newest change first, the default), `-created_at` (newest first), `created_at` (oldest first) or `title` (A–Z). The store’s newest products of both kinds are this list and `GET /products` with `sort=-created_at`, merged by `created_at`. A `next_cursor` pages in the order it was made for: send the same `sort` with it (another is `400 INVALID_CURSOR`). Another value is `400 INVALID_PARAMETER`.",
            "in": "query",
            "name": "sort",
            "required": false,
            "schema": {
              "enum": ["-updated_at", "-created_at", "created_at", "title"],
              "type": "string"
            }
          },
          {
            "description": "`active` (the default: what can be sold), `draft` or `all`. Another value is `400 INVALID_PARAMETER`.",
            "in": "query",
            "name": "status",
            "required": false,
            "schema": {
              "enum": ["active", "draft", "all"],
              "type": "string"
            }
          },
          {
            "description": "Only the template with exactly this handle (unique in the store), active or draft as `status` says: a migration finds what it already made with `?handle=…&status=all`.",
            "in": "query",
            "name": "handle",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Only templates in this category (an `id` from `GET /categories`), as the pickers’ Category filter. Several, comma-separated: any of them.",
            "in": "query",
            "name": "category_id",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Only templates that offer this vendor (an `id` from `GET /vendors`; a template set to offer all vendors offers every active one), as the pickers’ Vendor filter. Several, comma-separated: any of them.",
            "in": "query",
            "name": "vendor_id",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TemplateList"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "List product templates",
        "x-rate-weight": 1,
        "x-required-scopes": ["CATALOG_READ"],
        "x-stability": "stable"
      }
    },
    "/product-templates/imports": {
      "get": {
        "description": "The store’s product template imports, newest first, as Products › Import lists them: the files people uploaded in OrderPilot and those API keys started (`started_by_api_key`). Each as `GET /product-templates/imports/{id}` answers it, without its `issues` (read one for them). Narrow by `status`; paged by `offset`. API keys need **Read the catalog** or **Change the catalog**. Phones see only what their staff member’s role reaches.",
        "operationId": "product_template_imports",
        "parameters": [
          {
            "description": "Only imports with this status: `validated` (checked, ready to apply), `completed`, ….",
            "in": "query",
            "name": "status",
            "required": false,
            "schema": {
              "enum": [
                "uploading",
                "validating",
                "validated",
                "failed_validation",
                "applying",
                "completed",
                "failed",
                "expired"
              ],
              "type": "string"
            }
          },
          {
            "description": "Imports to skip: the `next_offset` of the last page (default 0).",
            "in": "query",
            "name": "offset",
            "required": false,
            "schema": {
              "default": 0,
              "minimum": 0,
              "type": "integer"
            }
          },
          {
            "description": "Imports per page, 1–50 (default 20), as on Products › Import. A larger value is clamped to 50.",
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 20,
              "maximum": 50,
              "minimum": 1,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TemplateImportList"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "List template imports",
        "x-rate-weight": 1,
        "x-required-permission": {
          "id": "CATALOG_MANAGE",
          "label": "Manage the catalog"
        },
        "x-required-scopes": ["CATALOG_READ", "CATALOG_WRITE"],
        "x-stability": "stable"
      },
      "post": {
        "description": "Start a product template import: the CSV OrderPilot’s Products › Import takes, matched on Handle, never deleting. Send `file_name` (.csv) and `bytes`; the answer is the import (`uploading`) and `upload_url`. PUT the file there within 30 minutes, exactly `bytes` bytes with `Content-Type: text/csv; charset=utf-8`, then call `POST /product-templates/imports/{id}/confirm`. Up to 250 MB and 10,000 templates a file. `apply`: `manual` (default) or `after_check` (it applies itself once checked with no errors: only OrderPilot’s data-migration connection, any other key is `403 IMPORT_NEEDS_REVIEW`). A new import replaces this key’s own import not yet applied, never one started in OrderPilot. Templates stay drafts unless the file sets `Status` to active. API keys need **Change the catalog**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "product_template_import_create",
        "parameters": [
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TemplateImportCreate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TemplateImportStarted"
                }
              }
            },
            "description": "Created"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Start a template import",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "CATALOG_MANAGE",
          "label": "Manage the catalog"
        },
        "x-required-scopes": ["CATALOG_WRITE"],
        "x-stability": "stable"
      }
    },
    "/product-templates/imports/{id}": {
      "get": {
        "description": "One product template import: its status, counts, progress, the check’s issues (at most 500, errors first), the rows the apply couldn’t save, and once it ended the templates it wrote. `?issues=0` leaves the issues out: use it while polling. API keys need **Read the catalog** or **Change the catalog**. Phones see only what their staff member’s role reaches.",
        "operationId": "product_template_import",
        "parameters": [
          {
            "description": "The import’s `id`, from `POST /product-templates/imports`.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "`0` leaves the check’s issues out (`issues: null`), for polling; `1` (the default) includes them while the report is kept (a day after the import ended).",
            "in": "query",
            "name": "issues",
            "required": false,
            "schema": {
              "default": 1,
              "maximum": 1,
              "minimum": 0,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TemplateImport"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get a template import",
        "x-rate-weight": 1,
        "x-required-permission": {
          "id": "CATALOG_MANAGE",
          "label": "Manage the catalog"
        },
        "x-required-scopes": ["CATALOG_READ", "CATALOG_WRITE"],
        "x-stability": "stable"
      }
    },
    "/product-templates/imports/{id}/apply": {
      "post": {
        "description": "Apply a checked import (`validated`): it writes in batches, then publishes the templates once. Answers 202, `applying`; read it until `completed` (or `failed`: what it saved stays). Only OrderPilot’s data-migration connection applies: any other key is `403 IMPORT_NEEDS_REVIEW` and sends a draft (`POST /imports`) for the merchant to import. Applying needs Change the catalog, plus Manage purchase orders when the file creates vendors (`needs.new_vendors`). Only OrderPilot’s data-migration connection sets and clears vendor costs; any other key’s file that does fails its check. One import applies at a time per store: `409 IMPORT_IN_PROGRESS` while another does. API keys need **Change the catalog**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "product_template_import_apply",
        "parameters": [
          {
            "description": "The import’s `id`, from `POST /product-templates/imports`.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Empty"
              }
            }
          },
          "required": false
        },
        "responses": {
          "202": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TemplateImport"
                }
              }
            },
            "description": "Accepted"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Apply a template import",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "CATALOG_MANAGE",
          "label": "Manage the catalog"
        },
        "x-required-scopes": ["CATALOG_WRITE"],
        "x-stability": "stable"
      }
    },
    "/product-templates/imports/{id}/confirm": {
      "post": {
        "description": "The file is uploaded: check it. Answers 202 with the import, `validating`. An import started with `after_check` is confirmed only by OrderPilot’s data-migration connection (`403 IMPORT_NEEDS_REVIEW`). Read it with `GET /product-templates/imports/{id}` (`issues=0` while polling) until it is `validated` (ready to apply) or `failed_validation` (read its `issues`, fix the file, start a new import). `409 UPLOAD_NOT_FOUND`: the file hasn’t arrived; PUT it, then confirm again. Confirming again returns the import as it is. API keys need **Change the catalog**. An `Idempotency-Key` header makes a retry safe: the same key and body returns the first answer. Phones see only what their staff member’s role reaches.",
        "operationId": "product_template_import_confirm",
        "parameters": [
          {
            "description": "The import’s `id`, from `POST /product-templates/imports`.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Empty"
              }
            }
          },
          "required": false
        },
        "responses": {
          "202": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TemplateImport"
                }
              }
            },
            "description": "Accepted"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Check an uploaded import",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "CATALOG_MANAGE",
          "label": "Manage the catalog"
        },
        "x-required-scopes": ["CATALOG_WRITE"],
        "x-stability": "stable"
      }
    },
    "/product-templates/imports/{id}/discard": {
      "post": {
        "description": "Drop an import not yet applied (`uploading`, `validating` or `validated`): it becomes `expired` and its file is deleted. An import that already ended without writing is a success too; one being applied, or that wrote templates, is `409`. API keys need **Change the catalog**. An `Idempotency-Key` header makes a retry safe: the same key and body returns the first answer. Phones see only what their staff member’s role reaches.",
        "operationId": "product_template_import_discard",
        "parameters": [
          {
            "description": "The import’s `id`, from `POST /product-templates/imports`.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Empty"
              }
            }
          },
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TemplateImport"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Discard a template import",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "CATALOG_MANAGE",
          "label": "Manage the catalog"
        },
        "x-required-scopes": ["CATALOG_WRITE"],
        "x-stability": "stable"
      }
    },
    "/product-templates/sync-retry": {
      "post": {
        "description": "Retry the Shopify sync of every active template whose sync failed or never ran, as the Products page’s Retry sync for all does: one batch in the background (`queued` of them; `remaining` wait for the next). `status` is `nothing` (none needs it), `queued`, `running` or `already_queued` (a retry is under way). API keys need **Change the catalog**. An `Idempotency-Key` header makes a retry safe: the same key and body returns the first answer. Phones see only what their staff member’s role reaches.",
        "operationId": "product_templates_sync_retry",
        "parameters": [
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Empty"
              }
            }
          },
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TemplateSyncRetry"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Retry every failed sync",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "CATALOG_MANAGE",
          "label": "Manage the catalog"
        },
        "x-required-scopes": ["CATALOG_WRITE"],
        "x-stability": "stable"
      }
    },
    "/product-templates/{id}": {
      "delete": {
        "description": "Delete a template, as the Products page’s Delete template does: its Shopify product is archived, never deleted (past orders point at it). Refused (`422 DELETE_REFUSED`) while stock or purchasing records use it: set it to draft instead. It can’t be undone. Needs Delete records as well, and counts against the key’s deletes a day. API keys need **Change the catalog**, and **Delete records**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "product_template_delete",
        "parameters": [
          {
            "description": "The template’s `id` from `GET /product-templates`.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TemplateDeleted"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Delete a template",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "CATALOG_MANAGE",
          "label": "Manage the catalog"
        },
        "x-required-scopes": ["CATALOG_WRITE"],
        "x-required-scopes-all": ["DELETE"],
        "x-stability": "stable"
      },
      "get": {
        "description": "One product template, active or draft (its `status` says which), with its options. Only an active template can go on a quote. API keys need **Read the catalog**.",
        "operationId": "product_template",
        "parameters": [
          {
            "description": "The id from a list.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Template"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get a product template",
        "x-rate-weight": 1,
        "x-required-scopes": ["CATALOG_READ"],
        "x-stability": "stable"
      }
    },
    "/product-templates/{id}/active": {
      "post": {
        "description": "Activate a template (`active: true`: it can be sold and is sent to Shopify) or set it to draft (`active: false`: its Shopify product is archived and it leaves the storefront), as the Products page’s Activate and Set to draft do. Answers the template. API keys need **Change the catalog**. An `Idempotency-Key` header makes a retry safe: the same key and body returns the first answer. Phones see only what their staff member’s role reaches.",
        "operationId": "product_template_active",
        "parameters": [
          {
            "description": "The template’s `id` from `GET /product-templates`.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TemplateActive"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Template"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Activate or set to draft",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "CATALOG_MANAGE",
          "label": "Manage the catalog"
        },
        "x-required-scopes": ["CATALOG_WRITE"],
        "x-stability": "stable"
      }
    },
    "/product-templates/{id}/availability": {
      "get": {
        "description": "Where a product template’s finished units are, as the app’s Availability card reads them: the units at `location_id`, at every other location, and on the way, with a row for each configuration stocked there. `on_the_way` is null for a caller whose role sees no purchase orders. Counts come from Shopify; when Shopify can’t be read the answer is a 502, never zero. API keys need **Read the catalog**.",
        "operationId": "product_template_availability",
        "parameters": [
          {
            "description": "The product template’s `id`.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "The location to read at: a Shopify location id (`gid://shopify/Location/…` or its number, from `GET /locations`). Left out or `ALL`: every location.",
            "in": "query",
            "name": "location_id",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TemplateAvailability"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "See a template’s availability",
        "x-rate-weight": 1,
        "x-required-scopes": ["CATALOG_READ"],
        "x-stability": "stable"
      }
    },
    "/product-templates/{id}/availability/locations": {
      "get": {
        "description": "The other locations holding a product template’s units, with how many each holds: the five holding most, or with `q` the best matches (up to 20). `location_id` is left out of the list. API keys need **Read the catalog**.",
        "operationId": "product_template_availability_locations",
        "parameters": [
          {
            "description": "The product template’s `id`.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "The location to read at: a Shopify location id (`gid://shopify/Location/…` or its number, from `GET /locations`). Left out or `ALL`: every location.",
            "in": "query",
            "name": "location_id",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Search the locations’ names (up to 100 characters).",
            "in": "query",
            "name": "q",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TemplateAvailabilityLocations"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "List availability by location",
        "x-rate-weight": 1,
        "x-required-scopes": ["CATALOG_READ"],
        "x-stability": "stable"
      }
    },
    "/product-templates/{id}/availability/units/{unitId}": {
      "patch": {
        "description": "Set a finished unit’s own prices and name, as the template page’s Availability card does: `prices` per location (a `null` price sells it at the template’s price there), `name` (`null`: the template’s). Only what is sent changes. The unit ids are `units[].unit_id` from `GET /product-templates/{id}/availability`. Answers the unit’s prices. API keys need **Change the catalog**. An `Idempotency-Key` header makes a retry safe: the same key and body returns the first answer. Phones see only what their staff member’s role reaches.",
        "operationId": "product_template_unit_prices",
        "parameters": [
          {
            "description": "The template’s `id` from `GET /product-templates`.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "The finished unit: a `unit_id` from `GET /product-templates/{id}/availability`.",
            "in": "path",
            "name": "unitId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TemplateUnitPricesInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TemplateUnitPrices"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Set a unit’s prices",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "CATALOG_MANAGE",
          "label": "Manage the catalog"
        },
        "x-required-scopes": ["CATALOG_WRITE"],
        "x-stability": "stable"
      }
    },
    "/product-templates/{id}/bundles/{bundleId}": {
      "delete": {
        "description": "Stop a template following a bundle, as the Options card’s Remove bundle does: options it brought that this template never changed come off, changed ones stay as the template’s own. Answers what was removed and the template’s options; an active template syncs to Shopify in the background. API keys need **Change the catalog**. An `Idempotency-Key` header makes a retry safe: the same key and body returns the first answer. Phones see only what their staff member’s role reaches.",
        "operationId": "product_template_bundle_detach",
        "parameters": [
          {
            "description": "The template’s `id` from `GET /product-templates`.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "A bundle the template follows: a `bundles[].bundle_id` from `GET /product-templates/{id}/options`.",
            "in": "path",
            "name": "bundleId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TemplateBundleDetached"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Remove a bundle from a template",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "CATALOG_MANAGE",
          "label": "Manage the catalog"
        },
        "x-required-scopes": ["CATALOG_WRITE"],
        "x-stability": "stable"
      }
    },
    "/product-templates/{id}/costs": {
      "get": {
        "description": "What a template has cost, as the template editor’s cost cards read it: its supplier cost estimate, the last 25 deliveries received for it with their landed costs, the cost of what is on hand under the store’s costing method, and the cost per item Shopify was last given for each variant. Needs See costs. API keys need **See costs** or **Enter and correct costs**. Phones see only what their staff member’s role reaches.",
        "operationId": "product_template_costs",
        "parameters": [
          {
            "description": "The template’s `id` from `GET /product-templates`.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TemplateCosts"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "See a template’s costs",
        "x-rate-weight": 1,
        "x-required-permission": {
          "id": "COSTS_VIEW",
          "label": "View costs"
        },
        "x-required-scopes": ["COSTS_READ", "COSTS_WRITE"],
        "x-stability": "stable"
      }
    },
    "/product-templates/{id}/duplicate": {
      "post": {
        "description": "Copy a template, as the Products page’s Duplicate does: its options, prices and settings, named “… (copy)”, as a draft (activate it when it is ready). `201` with the copy. API keys need **Change the catalog**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "product_template_duplicate",
        "parameters": [
          {
            "description": "The template’s `id` from `GET /product-templates`.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Empty"
              }
            }
          },
          "required": false
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Template"
                }
              }
            },
            "description": "Created"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Duplicate a template",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "CATALOG_MANAGE",
          "label": "Manage the catalog"
        },
        "x-required-scopes": ["CATALOG_WRITE"],
        "x-stability": "stable"
      }
    },
    "/product-templates/{id}/online-options": {
      "get": {
        "description": "A template’s Online options page: how its options block on the online store shows each option (its look, the look’s settings, Hide online), the price line, Show lead time, Also offer Request a quote and the button labels. API keys need **Read the catalog**.",
        "operationId": "product_template_online_options",
        "parameters": [
          {
            "description": "The template’s `id` from `GET /product-templates`.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TemplateOnlineOptions"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "See a template’s online options",
        "x-rate-weight": 1,
        "x-required-scopes": ["CATALOG_READ"],
        "x-stability": "stable"
      },
      "patch": {
        "description": "Change a template’s Online options, as the page saves them: the price line, Show lead time, Also offer Request a quote, the button labels, and per option its look, look settings and Hide online. Only what is sent changes. A look that doesn’t fit the option, or hiding a required option with no Starts as, is `422 RULE_REFUSED` with the reason. The storefront changes after the template’s Shopify sync. Answers the page. API keys need **Change the catalog**. An `Idempotency-Key` header makes a retry safe: the same key and body returns the first answer. Phones see only what their staff member’s role reaches.",
        "operationId": "product_template_online_options_edit",
        "parameters": [
          {
            "description": "The template’s `id` from `GET /product-templates`.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TemplateOnlineOptionsEdit"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TemplateOnlineOptions"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Change a template’s online options",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "CATALOG_MANAGE",
          "label": "Manage the catalog"
        },
        "x-required-scopes": ["CATALOG_WRITE"],
        "x-stability": "stable"
      }
    },
    "/product-templates/{id}/options": {
      "get": {
        "description": "A template’s options as the template editor’s Options card shows them: each attached option with its values (offered or not), this template’s price, lead time and rule overrides, its required flag and Starts as, the bundle it came from and whether it still follows it, and its `updated_at` to send with a change. Costs only for a caller who may see them. API keys need **Read the catalog**.",
        "operationId": "product_template_options",
        "parameters": [
          {
            "description": "The template’s `id` from `GET /product-templates`.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TemplateOptions"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "List a template’s options",
        "x-rate-weight": 1,
        "x-required-scopes": ["CATALOG_READ"],
        "x-stability": "stable"
      },
      "patch": {
        "description": "Reorder a template’s options (`order`) or lock the whole template against its bundles (`locked`), as the Options card does. Send the options’ `version` (or their `updated_at` as `expected_updated_at`): a change made since is `409 STALE_VERSION` with the current `version`. Answers the template’s options as `GET /product-templates/{id}/options` reads them. An active template’s Shopify product syncs in the background, as after the editor’s save. API keys need **Change the catalog**. An `Idempotency-Key` header makes a retry safe: the same key and body returns the first answer. Phones see only what their staff member’s role reaches.",
        "operationId": "product_template_options_edit",
        "parameters": [
          {
            "description": "The template’s `id` from `GET /product-templates`.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TemplateOptionsEdit"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TemplateOptions"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Reorder or lock a template’s options",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "CATALOG_MANAGE",
          "label": "Manage the catalog"
        },
        "x-required-scopes": ["CATALOG_WRITE"],
        "x-stability": "stable"
      },
      "post": {
        "description": "Attach an option of the library (`field_id`) or a bundle (`bundle_id`) to a template, as the Options card’s Add does. An option already attached stays as it is. An archived option, or an order-level field, is `422 RULE_REFUSED`. Answers the template’s options as `GET /product-templates/{id}/options` reads them. An active template’s Shopify product syncs in the background, as after the editor’s save. API keys need **Change the catalog**. An `Idempotency-Key` header makes a retry safe: the same key and body returns the first answer. Phones see only what their staff member’s role reaches.",
        "operationId": "product_template_option_attach",
        "parameters": [
          {
            "description": "The template’s `id` from `GET /product-templates`.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TemplateOptionAttach"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TemplateOptions"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Attach an option to a template",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "CATALOG_MANAGE",
          "label": "Manage the catalog"
        },
        "x-required-scopes": ["CATALOG_WRITE"],
        "x-stability": "stable"
      }
    },
    "/product-templates/{id}/options/{fieldId}": {
      "delete": {
        "description": "Take an option off a template, as the Options card’s Remove does: this template’s overrides for it go with it; the option stays in the library and on other templates. Answers the template’s options as `GET /product-templates/{id}/options` reads them. An active template’s Shopify product syncs in the background, as after the editor’s save. API keys need **Change the catalog**. An `Idempotency-Key` header makes a retry safe: the same key and body returns the first answer. Phones see only what their staff member’s role reaches.",
        "operationId": "product_template_option_detach",
        "parameters": [
          {
            "description": "The template’s `id` from `GET /product-templates`.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "An option on this template: its `field_id` from `GET /product-templates/{id}/options`.",
            "in": "path",
            "name": "fieldId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TemplateOptions"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Remove an option from a template",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "CATALOG_MANAGE",
          "label": "Manage the catalog"
        },
        "x-required-scopes": ["CATALOG_WRITE"],
        "x-stability": "stable"
      },
      "patch": {
        "description": "Change one option on this template, as the Options card’s Manage dialog saves it: required, Starts as, which values it offers, each value’s price, cost and lead time here, rules, and the bundle lock. Only what is sent changes. Send the option’s `version` (or its `updated_at` as `expected_updated_at`): a change made since is `409 STALE_VERSION` with the current `version`. A price that changes needs Change the catalog; a cost, Enter and correct costs. Answers the template’s options as `GET /product-templates/{id}/options` reads them. An active template’s Shopify product syncs in the background, as after the editor’s save. API keys need **Change the catalog**. An `Idempotency-Key` header makes a retry safe: the same key and body returns the first answer. Phones see only what their staff member’s role reaches.",
        "operationId": "product_template_option_edit",
        "parameters": [
          {
            "description": "The template’s `id` from `GET /product-templates`.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "An option on this template: its `field_id` from `GET /product-templates/{id}/options`.",
            "in": "path",
            "name": "fieldId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TemplateOptionEdit"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TemplateOptions"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Change a template’s option",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "CATALOG_MANAGE",
          "label": "Manage the catalog"
        },
        "x-required-scopes": ["CATALOG_WRITE"],
        "x-stability": "stable"
      }
    },
    "/product-templates/{id}/options/{fieldId}/match-bundle": {
      "post": {
        "description": "Make an option follow its bundle again, as the Options card’s Match bundle does: the values it offers, required and its rules come from the bundle; this template’s prices, costs, lead times and Starts as stay. It never unlocks the option. Only for an option a bundle brought, as the card shows the button: one attached on its own is a 422. Answers the template’s options as `GET /product-templates/{id}/options` reads them. An active template’s Shopify product syncs in the background, as after the editor’s save. API keys need **Change the catalog**. An `Idempotency-Key` header makes a retry safe: the same key and body returns the first answer. Phones see only what their staff member’s role reaches.",
        "operationId": "product_template_option_match_bundle",
        "parameters": [
          {
            "description": "The template’s `id` from `GET /product-templates`.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "An option on this template: its `field_id` from `GET /product-templates/{id}/options`.",
            "in": "path",
            "name": "fieldId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Empty"
              }
            }
          },
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TemplateOptions"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Match a template’s option to its bundle",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "CATALOG_MANAGE",
          "label": "Manage the catalog"
        },
        "x-required-scopes": ["CATALOG_WRITE"],
        "x-stability": "stable"
      }
    },
    "/product-templates/{id}/options/{fieldId}/values": {
      "post": {
        "description": "Add a value to a dropdown option from a template, as the Options card’s Add value does: the value joins the shared option in the library (every template attaching it can offer it) and this template offers it. A price needs Change the catalog or Prices and exceptions; a cost, Enter and correct costs. `201` with the new value’s `option_id` and the template’s options. API keys need **Change the catalog**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "product_template_option_value_add",
        "parameters": [
          {
            "description": "The template’s `id` from `GET /product-templates`.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "An option on this template: its `field_id` from `GET /product-templates/{id}/options`.",
            "in": "path",
            "name": "fieldId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TemplateOptionValueAdd"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TemplateOptionValueAdded"
                }
              }
            },
            "description": "Created"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Add a value from a template",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "CATALOG_MANAGE",
          "label": "Manage the catalog"
        },
        "x-required-scopes": ["CATALOG_WRITE"],
        "x-stability": "stable"
      }
    },
    "/product-templates/{id}/pin": {
      "post": {
        "description": "Pin a template to the top of the template pickers and the Products list (`pinned: true`), or unpin it. OrderPilot’s own order: nothing is sent to Shopify. Answers the template (`pinned_at`). API keys need **Change the catalog**. An `Idempotency-Key` header makes a retry safe: the same key and body returns the first answer. Phones see only what their staff member’s role reaches.",
        "operationId": "product_template_pin",
        "parameters": [
          {
            "description": "The template’s `id` from `GET /product-templates`.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TemplatePin"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Template"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Pin a template",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "CATALOG_MANAGE",
          "label": "Manage the catalog"
        },
        "x-required-scopes": ["CATALOG_WRITE"],
        "x-stability": "stable"
      }
    },
    "/product-templates/{id}/sync-retry": {
      "post": {
        "description": "Send an active template to Shopify again, as the template editor’s Sync to Shopify does: its `sync_status` becomes `syncing` and the catalog sync runs in the background (no Shopify call is made here). Read the template again for the outcome. A draft is `422 TEMPLATE_REFUSED`: activate it first. API keys need **Change the catalog**. An `Idempotency-Key` header makes a retry safe: the same key and body returns the first answer. Phones see only what their staff member’s role reaches.",
        "operationId": "product_template_sync_retry",
        "parameters": [
          {
            "description": "The template’s `id` from `GET /product-templates`.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Empty"
              }
            }
          },
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Template"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Retry a template’s sync",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "CATALOG_MANAGE",
          "label": "Manage the catalog"
        },
        "x-required-scopes": ["CATALOG_WRITE"],
        "x-stability": "stable"
      }
    },
    "/product-templates/{id}/warranty": {
      "get": {
        "description": "A template’s Warranty card: the product’s term a new order gets today and where it comes from, this template’s own term, the options whose term differs, the options that follow the product’s, and whether every unit needs a serial number. A preview: an order keeps the terms it was sold with. API keys need **Read the catalog**.",
        "operationId": "product_template_warranty",
        "parameters": [
          {
            "description": "The template’s `id` from `GET /product-templates`.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Preview through one of the template’s vendors (`vendors[].id` of this read). Without it, its only vendor, or none when it has several.",
            "in": "query",
            "name": "vendor_id",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TemplateWarranty"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "See a template’s warranty",
        "x-rate-weight": 1,
        "x-required-scopes": ["CATALOG_READ"],
        "x-stability": "stable"
      },
      "patch": {
        "description": "Change a template’s Warranty card, as the editor saves it: its own product term (`null` follows the category and vendor again), an option’s own term and its lock (`months: null` follows the product term again), and Require a serial number. Only what is sent changes. Applies to orders placed from now on. Answers the card. API keys need **Change the catalog**. An `Idempotency-Key` header makes a retry safe: the same key and body returns the first answer. Phones see only what their staff member’s role reaches.",
        "operationId": "product_template_warranty_edit",
        "parameters": [
          {
            "description": "The template’s `id` from `GET /product-templates`.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TemplateWarrantyEdit"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TemplateWarranty"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Change a template’s warranty",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "CATALOG_MANAGE",
          "label": "Manage the catalog"
        },
        "x-required-scopes": ["CATALOG_WRITE"],
        "x-stability": "stable"
      }
    },
    "/products": {
      "get": {
        "description": "The store’s own Shopify products, read live from Shopify, newest first: the products Settings › Products lists with Type: Shopify. Products OrderPilot made (a product template’s own, an option’s, a stock configuration’s) are left out, so this list and `GET /product-templates` never repeat a product; archived products are left out too. Each item says `kind: shopify_product`; one with 10 or fewer variants carries them (`variants`: id, title, SKU, price). A page can hold fewer than `limit` items while `next_cursor` is set. `503 BUSY` with `Retry-After` while Shopify limits the store’s calls; `502` when Shopify can’t be reached. API keys need **Read the catalog**.",
        "operationId": "products",
        "parameters": [
          {
            "description": "Items per page, 1–50 (default 25). A larger value is clamped to 50.",
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 25,
              "maximum": 50,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "description": "The `next_cursor` of the previous page of this list. A cursor from another list is `400 INVALID_CURSOR`.",
            "in": "query",
            "name": "cursor",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "The order of the list: `-created_at` (newest first, the default), `created_at` (oldest first), `-updated_at` (newest change first) or `title` (A–Z). A `next_cursor` pages in the order it was made for: send the same `sort` with it (another is `400 INVALID_CURSOR`). Another value is `400 INVALID_PARAMETER`.",
            "in": "query",
            "name": "sort",
            "required": false,
            "schema": {
              "enum": ["-created_at", "created_at", "-updated_at", "title"],
              "type": "string"
            }
          },
          {
            "description": "Search, as Settings › Products does: every word must start a word of the title, a SKU, the vendor, the product type or a tag. 2–100 characters.",
            "in": "query",
            "name": "q",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Only products of this vendor (as Shopify spells it). One value, several separated by commas, or a JSON array of strings for values with commas in them; a product holding any of them matches. The values are what `GET /products/facets` lists as `value` for this filter.",
            "in": "query",
            "name": "vendor",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Only products of this product type. One value, several separated by commas, or a JSON array of strings for values with commas in them; a product holding any of them matches. The values are what `GET /products/facets` lists as `value` for this filter.",
            "in": "query",
            "name": "product_type",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Only products with this tag. One value, several separated by commas, or a JSON array of strings for values with commas in them; a product holding any of them matches. The values are what `GET /products/facets` lists as `value` for this filter.",
            "in": "query",
            "name": "tag",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Only products in this collection (`gid://shopify/Collection/…` or its number). One value, several separated by commas, or a JSON array of strings for values with commas in them; a product holding any of them matches. The values are what `GET /products/facets` lists as `value` for this filter.",
            "in": "query",
            "name": "collection_id",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Only products in this Shopify product category (`gid://shopify/TaxonomyCategory/…` or its id, as `GET /product-categories` gives it). One value, several separated by commas, or a JSON array of strings for values with commas in them; a product holding any of them matches. The values are what `GET /products/facets` lists as `value` for this filter.",
            "in": "query",
            "name": "category_id",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ShopifyProductList"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "List Shopify products",
        "x-rate-weight": 1,
        "x-required-scopes": ["CATALOG_READ"],
        "x-stability": "stable"
      }
    },
    "/products/by-barcode": {
      "get": {
        "description": "The sellable variants whose barcode or SKU is exactly the scanned code, as the POS Add product scanner finds them: the same products the picker lists. An empty list when nothing matches. Open to any signed-in staff, as in the admin, and to a key that reads the catalog. `502` when Shopify can’t be reached. API keys need **Read the catalog**.",
        "operationId": "products_by_barcode",
        "parameters": [
          {
            "description": "The scanned barcode or SKU (up to 128 characters).",
            "in": "query",
            "name": "code",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "The location whose default product image stands in for a missing one: a Shopify location id (an `id` from `GET /locations`).",
            "in": "query",
            "name": "location_id",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BarcodeMatches"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Find a product by barcode",
        "x-rate-weight": 1,
        "x-required-scopes": ["CATALOG_READ"],
        "x-stability": "stable"
      }
    },
    "/products/facets": {
      "get": {
        "description": "One filter’s values for the store’s Shopify products, as the product picker’s filter menus show them: the vendors, product types, tags, collections or Shopify categories the products matching the other filters (and `q`) carry, each with how many products it would leave (`count`; null past the first 25). At most 50 values; `contains` narrows them by name. Send a `value` back as that filter on `GET /products` (or here, to narrow another filter). Products OrderPilot made are left out of the counts, as the list leaves them out. Read live from Shopify within a bounded budget. `503 BUSY` with `Retry-After` while Shopify limits the store’s calls; `502` when Shopify can’t be reached. API keys need **Read the catalog**.",
        "operationId": "product_facets",
        "parameters": [
          {
            "description": "Which filter’s values: `vendor`, `product_type`, `tag`, `collection` (`collection_id`) or `category` (`category_id`).",
            "in": "query",
            "name": "facet",
            "required": true,
            "schema": {
              "enum": [
                "vendor",
                "product_type",
                "tag",
                "collection",
                "category"
              ],
              "type": "string"
            }
          },
          {
            "description": "Only values whose name holds this text (any case).",
            "in": "query",
            "name": "contains",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Count within this search of the products, as `GET /products` takes it.",
            "in": "query",
            "name": "q",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Only products of this vendor (as Shopify spells it). One value, several separated by commas, or a JSON array of strings for values with commas in them; a product holding any of them matches. The values are what `GET /products/facets` lists as `value` for this filter.",
            "in": "query",
            "name": "vendor",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Only products of this product type. One value, several separated by commas, or a JSON array of strings for values with commas in them; a product holding any of them matches. The values are what `GET /products/facets` lists as `value` for this filter.",
            "in": "query",
            "name": "product_type",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Only products with this tag. One value, several separated by commas, or a JSON array of strings for values with commas in them; a product holding any of them matches. The values are what `GET /products/facets` lists as `value` for this filter.",
            "in": "query",
            "name": "tag",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Only products in this collection (`gid://shopify/Collection/…` or its number). One value, several separated by commas, or a JSON array of strings for values with commas in them; a product holding any of them matches. The values are what `GET /products/facets` lists as `value` for this filter.",
            "in": "query",
            "name": "collection_id",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Only products in this Shopify product category (`gid://shopify/TaxonomyCategory/…` or its id, as `GET /product-categories` gives it). One value, several separated by commas, or a JSON array of strings for values with commas in them; a product holding any of them matches. The values are what `GET /products/facets` lists as `value` for this filter.",
            "in": "query",
            "name": "category_id",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProductFacets"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "List a Shopify product filter’s values",
        "x-rate-weight": 1,
        "x-required-scopes": ["CATALOG_READ"],
        "x-stability": "stable"
      }
    },
    "/products/imports": {
      "post": {
        "description": "Import up to 100 Shopify products (a product migration): each is created in Shopify, or updated when an earlier import created it. Answers 202 at once with the import; the products are written in the background, one at a time, and `GET /products/imports/{id}` says how each went. A product whose handle belongs to a product OrderPilot didn’t create is refused, never changed. The Idempotency-Key is the import: send the same key and body again to get the same import back. Only OrderPilot’s data-migration connection calls it, and sets costs: any other key is `403 IMPORT_NEEDS_REVIEW`: send a `products` import draft instead. API keys need **Change the catalog**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches. Preview: this endpoint’s shape may still change inside v1.",
        "operationId": "product_import_create",
        "parameters": [
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ProductImportCreate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "202": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProductImport"
                }
              }
            },
            "description": "Accepted"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Import Shopify products",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "CATALOG_MANAGE",
          "label": "Manage the catalog"
        },
        "x-required-scopes": ["CATALOG_WRITE"],
        "x-stability": "preview"
      }
    },
    "/products/imports/{id}": {
      "get": {
        "description": "One product import: its status, the counts, and each item’s status, Shopify product id and the reason it was refused or failed. Poll it until `status` is `completed` or `failed` (every 10 seconds or more). Imports are kept for 30 days. API keys need **Read the catalog** or **Change the catalog**. Preview: this endpoint’s shape may still change inside v1.",
        "operationId": "product_import",
        "parameters": [
          {
            "description": "The import’s `id`, as `POST /products/imports` answered it.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProductImport"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get a product import",
        "x-rate-weight": 1,
        "x-required-scopes": ["CATALOG_READ", "CATALOG_WRITE"],
        "x-stability": "preview"
      }
    },
    "/products/{id}": {
      "get": {
        "description": "One of the store’s Shopify products, read live from Shopify, with its options and its first 100 variants (`variants_truncated` when it has more). An archived product is read too. A product OrderPilot made, another store’s or an unknown id is `404`. `503 BUSY` with `Retry-After` while Shopify limits the store’s calls; `502` when Shopify can’t be reached. API keys need **Read the catalog**.",
        "operationId": "product",
        "parameters": [
          {
            "description": "The product’s `id` from `GET /products` (`gid://shopify/Product/123`, URL-encoded in a path), or its number alone (`123`).",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ShopifyProduct"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get a Shopify product",
        "x-rate-weight": 1,
        "x-required-scopes": ["CATALOG_READ"],
        "x-stability": "stable"
      }
    },
    "/products/{id}/composition": {
      "get": {
        "description": "A Shopify product’s composition, as the order screens read it when it is picked: a composition (`is_composition`) is sold as its pieces, each with its quantity. Add the composition itself (`lines` of `POST /quotes`, a PATCH's `add_lines`): it goes on as its pieces, as the order screens add one. Pieces that can’t be a line are in `skipped` with why. `part_of` names the compositions the product is a piece of. `503 BUSY` while Shopify limits the store’s calls; `502 SHOPIFY_UNAVAILABLE` when Shopify can’t be reached. API keys need **Read the catalog**.",
        "operationId": "product_composition",
        "parameters": [
          {
            "description": "The product’s `id` from `GET /products` (`gid://shopify/Product/123`, URL-encoded in a path), or its number alone (`123`).",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProductComposition"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "See a product’s composition",
        "x-rate-weight": 1,
        "x-required-scopes": ["CATALOG_READ"],
        "x-stability": "stable"
      }
    },
    "/products/{id}/requirements": {
      "get": {
        "description": "A Shopify product’s own signature and deposit before an order is placed, as the OrderPilot block on its page in Shopify admin reads them: `null` follows the OrderPilot category its lines get (`category`, read from Shopify; null when none matches). A template’s own Shopify product names the `template`, whose setting its lines take. API keys need **Read the catalog** or **Change the catalog**.",
        "operationId": "product_requirements",
        "parameters": [
          {
            "description": "The product’s `id` from `GET /products` (`gid://shopify/Product/123`, URL-encoded in a path), or its number alone (`123`).",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProductRequirements"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "See a product’s requirements",
        "x-rate-weight": 1,
        "x-required-scopes": ["CATALOG_READ", "CATALOG_WRITE"],
        "x-stability": "stable"
      },
      "patch": {
        "description": "Set a Shopify product’s own signature and deposit before an order is placed, as its page’s OrderPilot block saves them: `requires_signature` true or false, `required_deposit_percent` 0–100 (two decimals); `null` follows its category again. Only what is sent changes; both `null` clears the product’s own setting. It applies to quotes and orders checked from now on. Answers the setting. API keys need **Change the catalog**. An `Idempotency-Key` header makes a retry safe: the same key and body returns the first answer. Phones see only what their staff member’s role reaches.",
        "operationId": "product_requirements_edit",
        "parameters": [
          {
            "description": "The product’s `id` from `GET /products` (`gid://shopify/Product/123`, URL-encoded in a path), or its number alone (`123`).",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ProductRequirementsEdit"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProductRequirements"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Change a product’s requirements",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "CATALOG_MANAGE",
          "label": "Manage the catalog"
        },
        "x-required-scopes": ["CATALOG_WRITE"],
        "x-stability": "stable"
      }
    },
    "/products/{id}/spec-fields": {
      "get": {
        "description": "A Shopify product’s spec values as an order line reads them (its spec metafields: “Wood finish: Walnut”), which the order screens prefill a line’s matching fields from. `503 BUSY` while Shopify limits the store’s calls; `502 SHOPIFY_UNAVAILABLE` when Shopify can’t be reached. API keys need **Read the catalog**.",
        "operationId": "product_spec_fields",
        "parameters": [
          {
            "description": "The product’s `id` from `GET /products` (`gid://shopify/Product/123`, URL-encoded in a path), or its number alone (`123`).",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProductSpecFields"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "See a product’s spec values",
        "x-rate-weight": 1,
        "x-required-scopes": ["CATALOG_READ"],
        "x-stability": "stable"
      }
    },
    "/products/{id}/spec-sheet": {
      "get": {
        "description": "A Shopify product’s spec sheet PDF for one location (its address and look), as the product page’s Spec sheet action makes it: `url` is a link to the PDF that works for 10 minutes without sign-in. A sheet still being built is `503 BUSY` with `Retry-After`: ask again. A product Shopify doesn’t have is `404`. API keys need **Read the catalog**.",
        "operationId": "product_spec_sheet",
        "parameters": [
          {
            "description": "The product’s `id` from `GET /products` (`gid://shopify/Product/123`, URL-encoded in a path), or its number alone (`123`).",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "The location the sheet is for: a Shopify location id (`gid://shopify/Location/…` or the number; an `id` from `GET /locations`).",
            "in": "query",
            "name": "location_id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProductSpecSheet"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get a product’s spec sheet",
        "x-rate-weight": 1,
        "x-required-scopes": ["CATALOG_READ"],
        "x-stability": "stable"
      }
    },
    "/purchase-orders": {
      "get": {
        "description": "Purchase orders in the caller’s reach, newest change first. Money is left out without “View costs”. An API key sees money with See costs. API keys need **Read purchase orders** or **Manage purchase orders**. Phones see only what their staff member’s role reaches.",
        "operationId": "purchase_orders",
        "parameters": [
          {
            "description": "Items per page, 1–50 (default 25).",
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 25,
              "maximum": 50,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "description": "The `next_cursor` of the previous page.",
            "in": "query",
            "name": "cursor",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Only items changed at or after this time (ISO 8601).",
            "in": "query",
            "name": "updated_since",
            "required": false,
            "schema": {
              "format": "date-time",
              "type": "string"
            }
          },
          {
            "description": "draft, sending, sent, partial, partially_received, received, rejected or completed (any casing).",
            "in": "query",
            "name": "status",
            "required": false,
            "schema": {
              "type": "string",
              "x-values": [
                "draft",
                "sending",
                "sent",
                "partial",
                "partially_received",
                "received",
                "rejected",
                "completed"
              ]
            }
          },
          {
            "description": "Only this vendor’s.",
            "in": "query",
            "name": "vendor_id",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Search PO number, vendor or item (up to 100 characters).",
            "in": "query",
            "name": "q",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PurchaseOrderList"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "List purchase orders",
        "x-rate-weight": 1,
        "x-required-permission": {
          "id": "PURCHASING_VIEW",
          "label": "View purchase orders"
        },
        "x-required-scopes": ["PURCHASING_READ", "PURCHASING_WRITE"],
        "x-stability": "stable"
      },
      "post": {
        "description": "Create a draft purchase order for one vendor: from order lines, or for stock (needs `store_location_id`) with Shopify products by SKU, new products (made in Shopify on create) and template configurations (`lines[].kind`). New product and template lines need Manage catalog (a key: Change the catalog). Prices, `tax` and `shipping` need “Enter costs and charges” (a key: Enter and correct costs); without it an order line is costed from its order line and any other line at 0. Email it to the vendor with `POST /purchase-orders/{id}/send`. API keys need **Manage purchase orders**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Use a `purchase_orders` import draft (`POST /imports`) for existing records, even one, unless asked otherwise. Outside an import, create from requests or email signatures directly. Phones see only what their staff member’s role reaches.",
        "operationId": "purchase_order_create",
        "parameters": [
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PurchaseOrderCreate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PurchaseOrderCreated"
                }
              }
            },
            "description": "Created"
          },
          "202": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReadBackPending"
                }
              }
            },
            "description": "Accepted: the write is done, but its record couldn’t be read back. Don’t send it again: read it with `read`."
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Create a purchase order",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "PURCHASING_PREPARE",
          "label": "Prepare purchase orders"
        },
        "x-required-scopes": ["PURCHASING_WRITE"],
        "x-stability": "stable"
      }
    },
    "/purchase-orders/{id}": {
      "get": {
        "description": "One purchase order with its lines, status and money (money only with “View costs”). An API key sees money with See costs. API keys need **Read purchase orders** or **Manage purchase orders**. Phones see only what their staff member’s role reaches.",
        "operationId": "purchase_order",
        "parameters": [
          {
            "description": "The id from a list.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PurchaseOrder"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get a purchase order",
        "x-rate-weight": 1,
        "x-required-permission": {
          "id": "PURCHASING_VIEW",
          "label": "View purchase orders"
        },
        "x-required-scopes": ["PURCHASING_READ", "PURCHASING_WRITE"],
        "x-stability": "stable"
      },
      "patch": {
        "description": "Change an editable purchase order’s delivery (only the delivery fields: store or warehouse, the receiving location and the address). Send the `version` of the last answer about it (or its `content_version`): the save is refused if someone changed it meanwhile. API keys need **Manage purchase orders**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "purchase_order_delivery",
        "parameters": [
          {
            "description": "The id from a list.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PurchaseOrderDeliveryEdit"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PurchaseOrderDelivery"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Change a purchase order’s delivery",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "PURCHASING_PREPARE",
          "label": "Prepare purchase orders"
        },
        "x-required-scopes": ["PURCHASING_WRITE"],
        "x-stability": "stable"
      }
    },
    "/purchase-orders/{id}/attachments": {
      "get": {
        "description": "The files kept with the purchase order (a vendor’s quote, a bill of lading, a receipt), newest first. The vendor email carries the purchase order’s PDF, not these. Needs View purchase orders. API keys need **Read purchase orders** or **Manage purchase orders**. Phones see only what their staff member’s role reaches.",
        "operationId": "purchase_order_attachments",
        "parameters": [
          {
            "description": "The purchase order’s `id`.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PurchaseOrderAttachmentList"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "List a purchase order’s files",
        "x-rate-weight": 1,
        "x-required-permission": {
          "id": "PURCHASING_VIEW",
          "label": "View purchase orders"
        },
        "x-required-scopes": ["PURCHASING_READ", "PURCHASING_WRITE"],
        "x-stability": "stable"
      },
      "post": {
        "description": "Keep a file with the purchase order, up to 10 MB (a purchase order holds up to the app’s limit of files). Send multipart/form-data with the file in a `file` field. Not JSON, but an `Idempotency-Key` header is required all the same: the same key with the same file answers the first upload again (`Idempotent-Replayed: true`) instead of adding it twice. Answers 201 with the file. Needs Prepare purchase orders on a purchase order the caller reaches. API keys need **Manage purchase orders**. Phones see only what their staff member’s role reaches.",
        "operationId": "purchase_order_attachment_upload",
        "parameters": [
          {
            "description": "The purchase order’s `id`.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "multipart/form-data": {
              "schema": {
                "$ref": "#/components/schemas/Object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PurchaseOrderAttachment"
                }
              }
            },
            "description": "Created"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Upload a purchase order file",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "PURCHASING_PREPARE",
          "label": "Prepare purchase orders"
        },
        "x-required-scopes": ["PURCHASING_WRITE"],
        "x-stability": "stable"
      }
    },
    "/purchase-orders/{id}/attachments/from-url": {
      "post": {
        "description": "Keep a file with the purchase order from its address, as the upload does (for a caller that can’t send multipart form data, such as an agent on MCP): a photo (JPEG, PNG, WebP or GIF) or a PDF of up to 10 MB, fetched from a public https address (a private or local address is refused, and so is one that redirects there). Answers 201 with the file. Needs Prepare purchase orders on a purchase order the caller reaches. API keys need **Manage purchase orders**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "purchase_order_attachment_from_url",
        "parameters": [
          {
            "description": "The purchase order’s `id`.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/FileFromUrl"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PurchaseOrderAttachment"
                }
              }
            },
            "description": "Created"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Add a purchase order file from a URL",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "PURCHASING_PREPARE",
          "label": "Prepare purchase orders"
        },
        "x-required-scopes": ["PURCHASING_WRITE"],
        "x-stability": "stable"
      }
    },
    "/purchase-orders/{id}/attachments/{attachmentId}": {
      "delete": {
        "description": "Remove a file from the purchase order (its activity says so). Needs Prepare purchase orders on a purchase order the caller reaches. API keys need **Manage purchase orders**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "purchase_order_attachment_delete",
        "parameters": [
          {
            "description": "The purchase order’s `id`.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "The file’s `id` from the list.",
            "in": "path",
            "name": "attachmentId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PurchaseOrderAttachmentDeleted"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Delete a purchase order file",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "PURCHASING_PREPARE",
          "label": "Prepare purchase orders"
        },
        "x-required-scopes": ["PURCHASING_WRITE"],
        "x-stability": "stable"
      },
      "get": {
        "description": "A short-lived link that opens one of the purchase order’s files. Needs View purchase orders. API keys need **Read purchase orders** or **Manage purchase orders**. Phones see only what their staff member’s role reaches.",
        "operationId": "purchase_order_attachment_url",
        "parameters": [
          {
            "description": "The purchase order’s `id`.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "The file’s `id` from the list.",
            "in": "path",
            "name": "attachmentId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PurchaseOrderAttachmentUrl"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Open a purchase order file",
        "x-rate-weight": 1,
        "x-required-permission": {
          "id": "PURCHASING_VIEW",
          "label": "View purchase orders"
        },
        "x-required-scopes": ["PURCHASING_READ", "PURCHASING_WRITE"],
        "x-stability": "stable"
      }
    },
    "/purchase-orders/{id}/cancel": {
      "post": {
        "description": "Cancel a purchase order that nothing has been received on, which deletes it with its lines, charges, files and activity. Needs Send and cancel purchase orders (a key: Manage purchase orders and Delete records). It can’t be undone, and counts against the key’s Deletes per day cap. API keys need **Manage purchase orders**, and **Delete records**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "purchase_order_cancel",
        "parameters": [
          {
            "description": "The id from a list.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Empty"
              }
            }
          },
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PurchaseOrderCancelled"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Cancel a purchase order",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "PURCHASING_SEND",
          "label": "Send and cancel purchase orders"
        },
        "x-required-scopes": ["PURCHASING_WRITE"],
        "x-required-scopes-all": ["DELETE"],
        "x-stability": "stable"
      }
    },
    "/purchase-orders/{id}/charges": {
      "get": {
        "description": "The purchase order’s costs, as its Landed cost and Charges cards: every charge (type, amount, its split over the lines in `allocations`, estimated or final), the goods, tax and shipping, the charges’ totals, the planned landed cost, whether the costs are final (`cost_status`) and their publishing to Shopify and QuickBooks. Send its `version` back with `PATCH /purchase-orders/{id}/vendor-costs`. Needs View costs and View purchase orders (a key: See costs or Enter and correct costs, and Read or Manage purchase orders). API keys need **See costs** or **Enter and correct costs**. Phones see only what their staff member’s role reaches.",
        "operationId": "purchase_order_charges",
        "parameters": [
          {
            "description": "The purchase order’s `id`.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PurchaseOrderCosts"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "List a purchase order’s charges",
        "x-rate-weight": 1,
        "x-required-permission": {
          "id": "COSTS_VIEW",
          "label": "View costs"
        },
        "x-required-scopes": ["COSTS_READ", "COSTS_WRITE"],
        "x-stability": "stable"
      },
      "post": {
        "description": "Add a charge to the purchase order (Add charge): freight, duty, inbound shipping, brokerage, insurance, handling, a tariff or another cost, split over the lines by value, quantity, weight or by hand, or expensed (in no item cost). Units already received take their share at once. Answers 201: the purchase order’s costs and the new `charge_id`. A charge on one posted receipt (`scope: receipt`) also needs “Correct received costs”. A finalized purchase order refuses it unless `reopen: true` (with “Finalize and reopen purchase orders”) reopens it, charges and finalizes again in one go. Needs “Enter costs and charges” and View purchase orders (a key: Enter and correct costs, and Read or Manage purchase orders). API keys need **Enter and correct costs**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "purchase_order_charge_create",
        "parameters": [
          {
            "description": "The purchase order’s `id`.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PurchaseOrderChargeCreate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PurchaseOrderChargeSaved"
                }
              }
            },
            "description": "Created"
          },
          "202": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReadBackPending"
                }
              }
            },
            "description": "Accepted: the write is done, but its record couldn’t be read back. Don’t send it again: read it with `read`."
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Add a purchase order charge",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "COSTS_ENTER",
          "label": "Enter costs and charges"
        },
        "x-required-scopes": ["COSTS_WRITE"],
        "x-stability": "stable"
      }
    },
    "/purchase-orders/{id}/charges/preview": {
      "post": {
        "description": "How a charge would be split over the purchase order’s lines, as the Add charge dialog shows it, without saving anything: each line’s share and what posts now to units already received. A split that can’t be made says why in `refusal` (a line with no weight, amounts that don’t add up). Needs “Enter costs and charges” and View purchase orders (a key: Enter and correct costs, and Read or Manage purchase orders). API keys need **Enter and correct costs**. An `Idempotency-Key` header makes a retry safe: the same key and body returns the first answer. Phones see only what their staff member’s role reaches.",
        "operationId": "purchase_order_charge_preview",
        "parameters": [
          {
            "description": "The purchase order’s `id`.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PurchaseOrderChargePreviewInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PurchaseOrderChargePreview"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Preview a charge’s split",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "COSTS_ENTER",
          "label": "Enter costs and charges"
        },
        "x-required-scopes": ["COSTS_WRITE"],
        "x-stability": "stable"
      }
    },
    "/purchase-orders/{id}/charges/{chargeId}": {
      "delete": {
        "description": "Remove a charge from the purchase order. Received units give back the share it put on them. Needs “Enter costs and charges” and View purchase orders (a key: Enter and correct costs, and Read or Manage purchase orders). API keys need **Enter and correct costs**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "purchase_order_charge_delete",
        "parameters": [
          {
            "description": "The purchase order’s `id`.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "The charge’s `id`, from `GET /purchase-orders/{id}/charges`.",
            "in": "path",
            "name": "chargeId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PurchaseOrderChargeDeleted"
                }
              }
            },
            "description": "OK"
          },
          "202": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReadBackPending"
                }
              }
            },
            "description": "Accepted: the write is done, but its record couldn’t be read back. Don’t send it again: read it with `read`."
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Remove a purchase order charge",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "COSTS_ENTER",
          "label": "Enter costs and charges"
        },
        "x-required-scopes": ["COSTS_WRITE"],
        "x-stability": "stable"
      },
      "patch": {
        "description": "Change a charge: only the fields sent change (the rest are kept), and its split is made again. Received units’ shares move with it. A charge on one receipt changes from that receipt, not here (`409 PURCHASE_ORDER_REFUSED`). Needs “Enter costs and charges” and View purchase orders (a key: Enter and correct costs, and Read or Manage purchase orders). API keys need **Enter and correct costs**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "purchase_order_charge_edit",
        "parameters": [
          {
            "description": "The purchase order’s `id`.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "The charge’s `id`, from `GET /purchase-orders/{id}/charges`.",
            "in": "path",
            "name": "chargeId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PurchaseOrderChargeEdit"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PurchaseOrderChargeSaved"
                }
              }
            },
            "description": "OK"
          },
          "202": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReadBackPending"
                }
              }
            },
            "description": "Accepted: the write is done, but its record couldn’t be read back. Don’t send it again: read it with `read`."
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Change a purchase order charge",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "COSTS_ENTER",
          "label": "Enter costs and charges"
        },
        "x-required-scopes": ["COSTS_WRITE"],
        "x-stability": "stable"
      }
    },
    "/purchase-orders/{id}/charges/{chargeId}/estimated": {
      "post": {
        "description": "Mark a charge final once the vendor’s invoice confirms it (`is_estimated: false`), or estimated again. Final costs are what get published to Shopify. Confirming a charge on a posted receipt also needs “Correct received costs”. Needs “Enter costs and charges” and View purchase orders (a key: Enter and correct costs, and Read or Manage purchase orders). API keys need **Enter and correct costs**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "purchase_order_charge_estimated",
        "parameters": [
          {
            "description": "The purchase order’s `id`.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "The charge’s `id`, from `GET /purchase-orders/{id}/charges`.",
            "in": "path",
            "name": "chargeId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PurchaseOrderChargeEstimate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PurchaseOrderChargeSaved"
                }
              }
            },
            "description": "OK"
          },
          "202": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReadBackPending"
                }
              }
            },
            "description": "Accepted: the write is done, but its record couldn’t be read back. Don’t send it again: read it with `read`."
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Mark a charge estimated or final",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "COSTS_ENTER",
          "label": "Enter costs and charges"
        },
        "x-required-scopes": ["COSTS_WRITE"],
        "x-stability": "stable"
      }
    },
    "/purchase-orders/{id}/cost-sync/retry": {
      "post": {
        "description": "Publish the purchase order’s costs to Shopify’s cost per item again, as the list’s “Shopify sync failed · retry”: for a `cost_sync_status` of `failed` or `paused` (a retry decides a paused conflict). Queued for the worker; read `GET /purchase-orders/{id}/charges` for where it stands. Needs “Enter costs and charges” and View purchase orders (a key: Enter and correct costs, and Read or Manage purchase orders). API keys need **Enter and correct costs**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "purchase_order_cost_sync_retry",
        "parameters": [
          {
            "description": "The purchase order’s `id`.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Empty"
              }
            }
          },
          "required": false
        },
        "responses": {
          "202": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PurchaseOrderCostSync"
                }
              }
            },
            "description": "Accepted"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Retry publishing costs to Shopify",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "COSTS_ENTER",
          "label": "Enter costs and charges"
        },
        "x-required-scopes": ["COSTS_WRITE"],
        "x-stability": "stable"
      }
    },
    "/purchase-orders/{id}/email-placeholders": {
      "get": {
        "description": "The merge fields the purchase order’s vendor email can use, each with this purchase order’s value (its own, never the customer order’s), as its composer shows them: `items` (the documented ones) and `values` (every field by its path). Totals are at cost, so it also needs See costs. API keys need **Manage purchase orders**. Phones see only what their staff member’s role reaches.",
        "operationId": "purchase_order_email_placeholders",
        "parameters": [
          {
            "description": "The id from a list.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmailPlaceholders"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "List a purchase order’s merge fields",
        "x-rate-weight": 1,
        "x-required-permission": {
          "id": "PURCHASING_SEND",
          "label": "Send and cancel purchase orders"
        },
        "x-required-scopes": ["PURCHASING_WRITE"],
        "x-stability": "stable"
      }
    },
    "/purchase-orders/{id}/finalize": {
      "post": {
        "description": "Finalize a received purchase order: its estimated charges become final and cost editing locks. API keys need **Manage purchase orders**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "purchase_order_finalize",
        "parameters": [
          {
            "description": "The id from a list.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Empty"
              }
            }
          },
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PurchaseOrderFinalized"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Finalize a purchase order",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "PURCHASING_FINALIZE",
          "label": "Finalize and reopen purchase orders"
        },
        "x-required-scopes": ["PURCHASING_WRITE"],
        "x-stability": "stable"
      }
    },
    "/purchase-orders/{id}/freed-units": {
      "get": {
        "description": "Units that arrived for an order that was then cancelled, waiting for someone to add them to stock or write them off (the purchase order page’s “The order was canceled after … arrived”). Nothing happens to them until `POST /purchase-orders/{id}/freed-units/decision`. API keys need **Read purchase orders** or **Manage purchase orders**. Phones see only what their staff member’s role reaches.",
        "operationId": "purchase_order_freed_units",
        "parameters": [
          {
            "description": "The purchase order’s `id`.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PurchaseOrderFreedUnitList"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "List freed-up units",
        "x-rate-weight": 1,
        "x-required-permission": {
          "id": "PURCHASING_VIEW",
          "label": "View purchase orders"
        },
        "x-required-scopes": ["PURCHASING_READ", "PURCHASING_WRITE"],
        "x-stability": "stable"
      }
    },
    "/purchase-orders/{id}/freed-units/decision": {
      "post": {
        "description": "Decide units a cancelled order freed up, as the purchase order page’s Add to stock and Write off: `add_to_stock` puts them in stock under their stock product (made in Shopify and stocked by the worker) with their cost; `write_off` only records who decided. Decided once: a second decision is `409 PURCHASE_ORDER_REFUSED`. Needs “Add to stock or write off” (a key: Enter and correct costs). API keys need **Enter and correct costs**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "purchase_order_freed_units_decision",
        "parameters": [
          {
            "description": "The purchase order’s `id`.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PurchaseOrderFreedUnitsDecision"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PurchaseOrderFreedUnitsDecided"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Stock or write off freed-up units",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "RECEIVING_STOCK_DECISIONS",
          "label": "Add to stock or write off"
        },
        "x-required-scopes": ["COSTS_WRITE"],
        "x-stability": "stable"
      }
    },
    "/purchase-orders/{id}/lines": {
      "patch": {
        "description": "Change a purchase order’s lines, as its edit page’s Save: `lines` sets a line’s quantity, unit cost and Item notes, `remove_lines` takes lines off, `add_lines` adds order lines or stock lines (`kind` as in `POST /purchase-orders`). Send the `version` of the last answer about it: a change since is `409 PURCHASE_ORDER_STALE`. A received, rejected or finalized purchase order can’t be edited, and a line goods arrived on isn’t removed or ordered below what arrived. A line’s `price` needs “Enter costs and charges” (a key: Enter and correct costs): without it lines keep their stored prices and new ones are costed from their order line, or at 0. Needs Prepare purchase orders on a purchase order the caller reaches. API keys need **Manage purchase orders**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "purchase_order_lines",
        "parameters": [
          {
            "description": "The purchase order’s `id`.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PurchaseOrderLinesEdit"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PurchaseOrderLinesChanged"
                }
              }
            },
            "description": "OK"
          },
          "202": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReadBackPending"
                }
              }
            },
            "description": "Accepted: the write is done, but its record couldn’t be read back. Don’t send it again: read it with `read`."
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Change a purchase order’s lines",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "PURCHASING_PREPARE",
          "label": "Prepare purchase orders"
        },
        "x-required-scopes": ["PURCHASING_WRITE"],
        "x-stability": "stable"
      }
    },
    "/purchase-orders/{id}/mark-sent": {
      "post": {
        "description": "Mark a draft (or sending) purchase order Sent without emailing anyone: for a vendor who was phoned or sent the PDF by hand. Its stock is committed as a sent purchase order’s. Needs Send and cancel purchase orders on a purchase order the caller reaches. API keys need **Manage purchase orders**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "purchase_order_mark_sent",
        "parameters": [
          {
            "description": "The purchase order’s `id`.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Empty"
              }
            }
          },
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PurchaseOrderSent"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Mark a purchase order sent",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "PURCHASING_SEND",
          "label": "Send and cancel purchase orders"
        },
        "x-required-scopes": ["PURCHASING_WRITE"],
        "x-stability": "stable"
      }
    },
    "/purchase-orders/{id}/new-products": {
      "get": {
        "description": "The purchase order’s New product lines still waiting for their Shopify product (they can’t be received until it exists): `creating`, `failed` with Shopify’s reason, or `not_queued`. Empty once every product is made: a made product’s ids are on its line’s `new_product` (`GET /purchase-orders/{id}`, and the create’s and the lines edit’s answers). Needs View purchase orders. API keys need **Read purchase orders** or **Manage purchase orders**. Phones see only what their staff member’s role reaches.",
        "operationId": "purchase_order_new_products",
        "parameters": [
          {
            "description": "The purchase order’s `id`.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PurchaseOrderNewProducts"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "List waiting new products",
        "x-rate-weight": 1,
        "x-required-permission": {
          "id": "PURCHASING_VIEW",
          "label": "View purchase orders"
        },
        "x-required-scopes": ["PURCHASING_READ", "PURCHASING_WRITE"],
        "x-stability": "stable"
      }
    },
    "/purchase-orders/{id}/new-products/retry": {
      "post": {
        "description": "Try again: queue the Shopify product of a waiting New product line again (`line_id`), or of every one. Answers how many were queued and where each stands. Needs Prepare purchase orders or Receive items (a key: Manage purchase orders) on a purchase order the caller reaches. API keys need **Manage purchase orders**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice.",
        "operationId": "purchase_order_new_products_retry",
        "parameters": [
          {
            "description": "The purchase order’s `id`.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PurchaseOrderNewProductsRetry"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PurchaseOrderNewProductsRetried"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Retry waiting new products",
        "x-rate-weight": 5,
        "x-required-scopes": ["PURCHASING_WRITE"],
        "x-stability": "stable"
      }
    },
    "/purchase-orders/{id}/pdf": {
      "get": {
        "description": "The purchase order as a PDF, as its page’s Download PDF makes it (the merchant’s copy: lines, delivery, notes and terms). Without View costs (a key: See costs) it prints with its prices hidden, the copy a vendor gets when the purchase order hides prices, rather than being refused. Only a purchase order the caller reaches. `503 BUSY` with `Retry-After` while it is still being built: ask again then. Needs View purchase orders (a key: Read or Manage purchase orders). API keys need **Read purchase orders** or **Manage purchase orders**. Phones see only what their staff member’s role reaches.",
        "operationId": "purchase_order_pdf",
        "parameters": [
          {
            "description": "The purchase order’s `id`.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/pdf": {
                "schema": {
                  "$ref": "#/components/schemas/Pdf"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Download a purchase order’s PDF",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "PURCHASING_VIEW",
          "label": "View purchase orders"
        },
        "x-required-scopes": ["PURCHASING_READ", "PURCHASING_WRITE"],
        "x-stability": "stable"
      }
    },
    "/purchase-orders/{id}/quickbooks-sync": {
      "post": {
        "description": "Send the purchase order to QuickBooks now (Send to QuickBooks, and its Retry), for a store that syncs QuickBooks and a purchase order sent to the vendor: `409 NOT_APPLICABLE` otherwise. Queued for the worker. Needs “Enter costs and charges” and View purchase orders (a key: Enter and correct costs, and Read or Manage purchase orders). API keys need **Enter and correct costs**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "purchase_order_quickbooks_sync",
        "parameters": [
          {
            "description": "The purchase order’s `id`.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Empty"
              }
            }
          },
          "required": false
        },
        "responses": {
          "202": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PurchaseOrderQuickBooksSync"
                }
              }
            },
            "description": "Accepted"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Send a purchase order to QuickBooks",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "COSTS_ENTER",
          "label": "Enter costs and charges"
        },
        "x-required-scopes": ["COSTS_WRITE"],
        "x-stability": "stable"
      }
    },
    "/purchase-orders/{id}/receipts": {
      "get": {
        "description": "The receipts posted on a purchase order, newest first, as the receive screen lists them: each with its lines (what arrived and was rejected per purchase order line), its own charges and the cost changes made to it since. Money (vendor and landed costs, charge amounts) needs “View costs” (a key: See costs). A receipt’s `version` is what `PATCH /purchase-orders/{id}/receipts/{receiptId}` takes back. API keys need **Read purchase orders** or **Manage purchase orders**. Phones see only what their staff member’s role reaches.",
        "operationId": "purchase_order_receipts",
        "parameters": [
          {
            "description": "The purchase order’s `id`.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PurchaseOrderReceiptList"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "List a purchase order’s receipts",
        "x-rate-weight": 1,
        "x-required-permission": {
          "id": "PURCHASING_VIEW",
          "label": "View purchase orders"
        },
        "x-required-scopes": ["PURCHASING_READ", "PURCHASING_WRITE"],
        "x-stability": "stable"
      }
    },
    "/purchase-orders/{id}/receipts/{receiptId}": {
      "patch": {
        "description": "Correct a posted receipt, as the receive screen’s Edit receipt: change a line’s received or rejected count, rejection reason or vendor unit cost, add an item missed at check-in (`add_lines`), and add, change or remove the receipt’s own charges, with one `reason` for the lot. Needs “Correct receipts” or “Correct received costs”, and only what really differs from the receipt needs its own: counts, rejections and added items “Correct receipts” (a key: Manage purchase orders), vendor costs and charges “Correct received costs” (a key: Enter and correct costs). Stock in Shopify follows the corrected counts on the worker. A receipt changed since its `version` is `409 PURCHASE_ORDER_STALE`; a finalized purchase order is reopened first. API keys need **Manage purchase orders** or **Enter and correct costs**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice.",
        "operationId": "purchase_order_receipt_edit",
        "parameters": [
          {
            "description": "The purchase order’s `id`.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "The receipt’s `id` from `GET /purchase-orders/{id}/receipts`.",
            "in": "path",
            "name": "receiptId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PurchaseOrderReceiptEdit"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PurchaseOrderReceiptEdited"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Correct a receipt",
        "x-rate-weight": 5,
        "x-required-scopes": ["PURCHASING_WRITE", "COSTS_WRITE"],
        "x-stability": "stable"
      }
    },
    "/purchase-orders/{id}/receipts/{receiptId}/cost-adjustments": {
      "post": {
        "description": "Change a cost already received on a receipt, on the record: a late charge, a corrected unit cost, a vendor credit or a reversal, spread over the receipt’s received units (or one line’s), with a required `reason`. Units still in stock are revalued and the new costs are published to Shopify on the worker; no stock moves. Needs “Correct received costs” (a key: Enter and correct costs), on a purchase order that isn’t finalized. API keys need **Enter and correct costs**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "purchase_order_receipt_cost_adjustment",
        "parameters": [
          {
            "description": "The purchase order’s `id`.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "The receipt’s `id` from `GET /purchase-orders/{id}/receipts`.",
            "in": "path",
            "name": "receiptId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PurchaseOrderCostAdjustmentCreate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PurchaseOrderCostAdjustment"
                }
              }
            },
            "description": "Created"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Adjust a received cost",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "COSTS_CORRECT",
          "label": "Correct received costs"
        },
        "x-required-scopes": ["COSTS_WRITE"],
        "x-stability": "stable"
      }
    },
    "/purchase-orders/{id}/receive": {
      "post": {
        "description": "Record a receipt against a sent purchase order. Counts are the totals so far per line. Stock changes in Shopify are queued and applied by the worker. Send the purchase order’s `version` from the last answer to refuse a receipt over one posted (or an edit saved) since. API keys need **Manage purchase orders**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. This adds the units to Shopify stock. A delivery that came in before the store used OrderPilot goes in as a `purchase_orders` import draft (`POST /imports`) instead, which moves no stock. Phones see only what their staff member’s role reaches.",
        "operationId": "purchase_order_receive",
        "parameters": [
          {
            "description": "The id from a list.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PurchaseOrderReceive"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PurchaseOrderReceived"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Receive a purchase order",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "RECEIVING_RECEIVE",
          "label": "Receive items"
        },
        "x-required-scopes": ["PURCHASING_WRITE"],
        "x-stability": "stable"
      }
    },
    "/purchase-orders/{id}/reopen": {
      "post": {
        "description": "Reopen a finalized purchase order so costs can be corrected again; a reason is required. API keys need **Manage purchase orders**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "purchase_order_reopen",
        "parameters": [
          {
            "description": "The id from a list.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PurchaseOrderReopen"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PurchaseOrderFinalized"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Reopen a purchase order",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "PURCHASING_FINALIZE",
          "label": "Finalize and reopen purchase orders"
        },
        "x-required-scopes": ["PURCHASING_WRITE"],
        "x-stability": "stable"
      }
    },
    "/purchase-orders/{id}/send": {
      "post": {
        "description": "Email the purchase order to its vendor with its PDF and mark it Sent, as the PO page’s Send an email: the store’s vendor template unless `template_key` names another, its own subject and message unless the request writes them, to the vendor’s address unless `to` names others. The purchase order goes Draft → Sending → Sent once the email is accepted (back to Draft if it can’t be queued). One the vendor has already is emailed again only with `resend: true`. Without View costs (a key: See costs) it goes only to the vendor’s address and the store’s default CC and BCC. Needs Send and cancel purchase orders on a purchase order the caller reaches; an API key also needs Send emails, and each send counts against its Emails per day cap. API keys need **Manage purchase orders**, and **Send emails**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "purchase_order_send",
        "parameters": [
          {
            "description": "The purchase order’s `id`.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PurchaseOrderSend"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PurchaseOrderSent"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Email a purchase order",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "PURCHASING_SEND",
          "label": "Send and cancel purchase orders"
        },
        "x-required-scopes": ["PURCHASING_WRITE"],
        "x-required-scopes-all": ["EMAILS_SEND"],
        "x-stability": "stable"
      }
    },
    "/purchase-orders/{id}/send/preview": {
      "post": {
        "description": "The vendor email as the purchase order’s composer previews it, sending nothing: the store’s vendor template unless `template_key` names one (`GET /email-templates` with `audience=vendor`), its own words unless `subject` or `message` write yours (merge fields from `GET /purchase-orders/{id}/email-placeholders`). The lines show at cost, as the vendor receives them, so it also needs See costs. Changes nothing. API keys need **Manage purchase orders**. An `Idempotency-Key` header makes a retry safe: the same key and body returns the first answer. Phones see only what their staff member’s role reaches.",
        "operationId": "purchase_order_send_preview",
        "parameters": [
          {
            "description": "The id from a list.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PurchaseOrderEmailCompose"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PurchaseOrderEmailPreview"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Preview a purchase order’s email",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "PURCHASING_SEND",
          "label": "Send and cancel purchase orders"
        },
        "x-required-scopes": ["PURCHASING_WRITE"],
        "x-stability": "stable"
      }
    },
    "/purchase-orders/{id}/vendor-costs": {
      "patch": {
        "description": "Change the tax and the vendor’s shipping on the purchase order (the Landed cost card’s Tax and shipping). Send both, and the `version` of the last answer about it (or the `content_version` it was read with): a change since is `409 PURCHASE_ORDER_STALE` with the current `version`. Its total follows. Needs “Enter costs and charges” and View purchase orders (a key: Enter and correct costs, and Read or Manage purchase orders). API keys need **Enter and correct costs**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "purchase_order_vendor_costs",
        "parameters": [
          {
            "description": "The purchase order’s `id`.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PurchaseOrderVendorCostsEdit"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PurchaseOrderVendorCosts"
                }
              }
            },
            "description": "OK"
          },
          "202": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReadBackPending"
                }
              }
            },
            "description": "Accepted: the write is done, but its record couldn’t be read back. Don’t send it again: read it with `read`."
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Change a purchase order’s tax and shipping",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "COSTS_ENTER",
          "label": "Enter costs and charges"
        },
        "x-required-scopes": ["COSTS_WRITE"],
        "x-stability": "stable"
      }
    },
    "/purchase-orders/{id}/vendor-payments": {
      "get": {
        "description": "The payments made to the vendor against the purchase order (a deposit, a part payment, the balance), oldest first, with what was paid in all. Needs View costs and View purchase orders (a key: See costs or Enter and correct costs, and Read or Manage purchase orders). API keys need **See costs** or **Enter and correct costs**. Phones see only what their staff member’s role reaches.",
        "operationId": "purchase_order_vendor_payments",
        "parameters": [
          {
            "description": "The purchase order’s `id`.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PurchaseOrderVendorPayments"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "List payments to the vendor",
        "x-rate-weight": 1,
        "x-required-permission": {
          "id": "COSTS_VIEW",
          "label": "View costs"
        },
        "x-required-scopes": ["COSTS_READ", "COSTS_WRITE"],
        "x-stability": "stable"
      },
      "post": {
        "description": "Record a payment made to the vendor (Record payment): the amount, the date paid and how. Where the store syncs QuickBooks, the payment goes there too. Answers 201 with the purchase order’s payments and the new `payment_id`. Needs “Enter costs and charges” and View purchase orders (a key: Enter and correct costs, and Read or Manage purchase orders). API keys need **Enter and correct costs**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "purchase_order_vendor_payment_create",
        "parameters": [
          {
            "description": "The purchase order’s `id`.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PurchaseOrderVendorPaymentCreate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PurchaseOrderVendorPaymentSaved"
                }
              }
            },
            "description": "Created"
          },
          "202": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReadBackPending"
                }
              }
            },
            "description": "Accepted: the write is done, but its record couldn’t be read back. Don’t send it again: read it with `read`."
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Record a payment to the vendor",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "COSTS_ENTER",
          "label": "Enter costs and charges"
        },
        "x-required-scopes": ["COSTS_WRITE"],
        "x-stability": "stable"
      }
    },
    "/purchase-orders/{id}/vendor-payments/{paymentId}": {
      "delete": {
        "description": "Remove a payment recorded in error. What it became in QuickBooks is removed too. Needs “Enter costs and charges” and View purchase orders (a key: Enter and correct costs, and Read or Manage purchase orders). API keys need **Enter and correct costs**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "purchase_order_vendor_payment_delete",
        "parameters": [
          {
            "description": "The purchase order’s `id`.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "The payment’s `id`, from `GET /purchase-orders/{id}/vendor-payments`.",
            "in": "path",
            "name": "paymentId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PurchaseOrderVendorPaymentSaved"
                }
              }
            },
            "description": "OK"
          },
          "202": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReadBackPending"
                }
              }
            },
            "description": "Accepted: the write is done, but its record couldn’t be read back. Don’t send it again: read it with `read`."
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Remove a payment to the vendor",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "COSTS_ENTER",
          "label": "Enter costs and charges"
        },
        "x-required-scopes": ["COSTS_WRITE"],
        "x-stability": "stable"
      }
    },
    "/quick-replies": {
      "get": {
        "description": "The store’s saved replies and its reply time goal, for the composer. API keys need **Work the Inbox** or **Send emails** or **Manage purchase orders**.",
        "operationId": "quick_replies",
        "parameters": [],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/QuickReplies"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "List quick replies",
        "x-rate-weight": 1,
        "x-required-scopes": ["INBOX_WRITE", "EMAILS_SEND", "PURCHASING_WRITE"],
        "x-stability": "stable"
      }
    },
    "/quotes": {
      "get": {
        "description": "Quotes, newest change first. API keys need **Read quotes**. Phones see only what their staff member’s role reaches.",
        "operationId": "quotes",
        "parameters": [
          {
            "description": "Items per page, 1–50 (default 25). A larger value is clamped to 50.",
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 25,
              "maximum": 50,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "description": "The `next_cursor` of the previous page of this list. A cursor from another list is `400 INVALID_CURSOR`.",
            "in": "query",
            "name": "cursor",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Only items changed at or after this time (ISO 8601).",
            "in": "query",
            "name": "updated_since",
            "required": false,
            "schema": {
              "format": "date-time",
              "type": "string"
            }
          },
          {
            "description": "Only this customer’s.",
            "in": "query",
            "name": "customer_id",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Search, as the admin list does: every word must be found in the number (also as `#1042` or `Q-1042`), the customer’s name, email, phone or company, a product’s name or SKU, a purchase order number or a tag. 2–100 characters.",
            "in": "query",
            "name": "q",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Only this status, by the id from `GET /statuses`. Preferred: it survives a rename. An id no status has is `400 UNKNOWN_STATUS`.",
            "in": "query",
            "name": "status_id",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Only this status by name (as shown in OrderPilot, any case). A merchant can rename a status; prefer `status_id`. Ignored when `status_id` is sent. A name no status has is `400 UNKNOWN_STATUS`, never an empty list.",
            "in": "query",
            "name": "status",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Only records in this payment state, as the Orders list’s payment filter reads it (a split order as one): `unpaid` (nothing paid yet), `partially_paid` (something paid, `balance_due` left, nothing refunded), `paid` (in full) or `refunded` (refunded in full or in part). Another value is `400 INVALID_PARAMETER`.",
            "in": "query",
            "name": "payment_status",
            "required": false,
            "schema": {
              "type": "string",
              "x-values": ["unpaid", "partially_paid", "paid", "refunded"]
            }
          },
          {
            "description": "The order of the list: `-updated_at` (newest change first, the default), `-created_at` (newest first) or `created_at` (oldest first). A `next_cursor` pages in the order it was made for: send the same `sort` with it (another is `400 INVALID_CURSOR`). Another value is `400 INVALID_PARAMETER`.",
            "in": "query",
            "name": "sort",
            "required": false,
            "schema": {
              "enum": ["-updated_at", "-created_at", "created_at"],
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrderList"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "List quotes",
        "x-rate-weight": 1,
        "x-required-permission": {
          "id": "ORDERS_VIEW",
          "label": "View quotes and orders"
        },
        "x-required-scopes": ["QUOTES_READ"],
        "x-stability": "stable"
      },
      "post": {
        "description": "Create a quote for a customer. API keys need **Create and change quotes**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Use a `quotes` import draft (`POST /imports`) for existing records, even one, unless asked otherwise. Outside an import, create from requests or email signatures directly. Phones see only what their staff member’s role reaches.",
        "operationId": "quote_create",
        "parameters": [
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/QuoteCreate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Order"
                }
              }
            },
            "description": "Created"
          },
          "202": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReadBackPending"
                }
              }
            },
            "description": "Accepted: the write is done, but its record couldn’t be read back. Don’t send it again: read it with `read`."
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Create a quote",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "ORDERS_EDIT",
          "label": "Create and edit quotes and orders"
        },
        "x-required-scopes": ["QUOTES_WRITE"],
        "x-stability": "stable"
      }
    },
    "/quotes/{id}": {
      "delete": {
        "description": "Delete a quote and its Shopify draft. Counts against the key’s Deletes per day cap. API keys need **Delete records**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "quote_delete",
        "parameters": [
          {
            "description": "The id from a list.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/QuoteDeleted"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Delete a quote",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "ORDERS_DELETE",
          "label": "Delete quotes and draft orders"
        },
        "x-required-scopes": ["DELETE"],
        "x-stability": "stable"
      },
      "get": {
        "description": "One quote with its lines and totals. API keys need **Read quotes**. Phones see only what their staff member’s role reaches.",
        "operationId": "quote",
        "parameters": [
          {
            "description": "The id from a list.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Order"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get a quote",
        "x-rate-weight": 1,
        "x-required-permission": {
          "id": "ORDERS_VIEW",
          "label": "View quotes and orders"
        },
        "x-required-scopes": ["QUOTES_READ"],
        "x-stability": "stable"
      },
      "patch": {
        "description": "Change a quote. API keys need **Create and change quotes**. An `Idempotency-Key` header makes a retry safe: the same key and body returns the first answer. Phones see only what their staff member’s role reaches.",
        "operationId": "quote_edit",
        "parameters": [
          {
            "description": "The id from a list.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OrderEdit"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Order"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Change a quote",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "ORDERS_EDIT",
          "label": "Create and edit quotes and orders"
        },
        "x-required-scopes": ["QUOTES_WRITE"],
        "x-stability": "stable"
      }
    },
    "/quotes/{id}/accept-changes": {
      "get": {
        "description": "What Accept changes shows on a quote: the open change requests it would put on their lines, the suggested reply, why it can’t go if so, and the version to send back. API keys need **Read quotes**. Phones see only what their staff member’s role reaches. Preview: this endpoint’s shape may still change inside v1.",
        "operationId": "quote_accept_changes_preview",
        "parameters": [
          {
            "description": "The id from a list.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AcceptChangesPreview"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Preview a quote’s changes",
        "x-rate-weight": 1,
        "x-required-permission": {
          "id": "ORDERS_VIEW",
          "label": "View quotes and orders"
        },
        "x-required-scopes": ["QUOTES_READ"],
        "x-stability": "preview"
      },
      "post": {
        "description": "Accept changes: every open change request’s value on its line in one save of the quote, the requests marked applied, then one reply. All or none. Needs Handle customer messages and Edit quotes and orders, on a record the caller can change; the save then checks its own rules (what the change needs, Prices and exceptions for a price, the status lock), for an API key as for a person, and records the key as the one who made the change. The reply counts against an API key’s Emails per day cap. API keys need **Create and change quotes**, and **Work the Inbox** and **Send emails**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "quote_accept_changes",
        "parameters": [
          {
            "description": "The id from a list.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AcceptChanges"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AcceptApplied"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Accept a quote’s changes",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "CUSTOMERS_SERVICE",
          "label": "Handle customer messages and change requests"
        },
        "x-required-scopes": ["QUOTES_WRITE"],
        "x-required-scopes-all": ["INBOX_WRITE", "EMAILS_SEND"],
        "x-stability": "stable"
      }
    },
    "/quotes/{id}/activity": {
      "get": {
        "description": "The activity feed: who changed what and when, and the comments, newest first (a split order reads as one feed). API keys need **Read quotes**. Phones see only what their staff member’s role reaches.",
        "operationId": "quote_activity",
        "parameters": [
          {
            "description": "The id from a list.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Items per page, 1–50 (default 25). A larger value is clamped to 50.",
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 25,
              "maximum": 50,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "description": "The `next_cursor` of the previous page of this list. A cursor from another list is `400 INVALID_CURSOR`.",
            "in": "query",
            "name": "cursor",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ActivityList"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "See the activity",
        "x-rate-weight": 1,
        "x-required-permission": {
          "id": "ORDERS_VIEW",
          "label": "View quotes and orders"
        },
        "x-required-scopes": ["QUOTES_READ"],
        "x-stability": "stable"
      }
    },
    "/quotes/{id}/activity/restore": {
      "get": {
        "description": "What restoring the quote to version `revision` (an entry’s `version` in `GET /quotes/{id}/activity`) would change, as the Restore dialog shows it, with `blocked_reason` when it can’t be restored, or not by this caller (what the version changes back needs its rights, a locked status Prices and exceptions, a line a purchase order is buying for is removed on the quote first). Send its `version` with `POST /quotes/{id}/activity/restore`. API keys need **Read quotes**. Phones see only what their staff member’s role reaches.",
        "operationId": "quote_restore_preview",
        "parameters": [
          {
            "description": "The id from a list.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "The version to go back to: an entry’s `version` from the record’s activity feed (one whose `restorable` is true).",
            "in": "query",
            "name": "revision",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ActivityRestorePreview"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Preview a quote restore",
        "x-rate-weight": 1,
        "x-required-permission": {
          "id": "ORDERS_VIEW",
          "label": "View quotes and orders"
        },
        "x-required-scopes": ["QUOTES_READ"],
        "x-stability": "stable"
      },
      "post": {
        "description": "Restore the quote to an earlier version, as the Restore dialog does: the version is saved as a change to the quote, so every rule of a change applies (rights for what it changes back, the status lock, a signature it changes is cleared, the Shopify draft is updated on the queue) and the activity records it as restored. Send the `version` (or `revision` and `token`) of `GET /quotes/{id}/activity/restore`: a quote changed since is `409 CONFLICT` with the preview’s `version` now. `422 RULE_REFUSED` with the reason when it can’t be restored. API keys need **Create and change quotes**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "quote_restore",
        "parameters": [
          {
            "description": "The id from a list.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ActivityRestoreInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ActivityRestored"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Restore a quote version",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "ORDERS_EDIT",
          "label": "Create and edit quotes and orders"
        },
        "x-required-scopes": ["QUOTES_WRITE"],
        "x-stability": "stable"
      }
    },
    "/quotes/{id}/asks": {
      "get": {
        "description": "The quote’s open items: the customer’s questions and change requests, each with its status (`open`, `applied`, `resolved` or `declined`), and how many wait on the store (`to_do`) and on the customer (`waiting`). API keys need **Read quotes**. Phones see only what their staff member’s role reaches.",
        "operationId": "quote_asks",
        "parameters": [
          {
            "description": "The id from a list.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AskList"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "List a quote’s open items",
        "x-rate-weight": 1,
        "x-required-permission": {
          "id": "ORDERS_VIEW",
          "label": "View quotes and orders"
        },
        "x-required-scopes": ["QUOTES_READ"],
        "x-stability": "stable"
      }
    },
    "/quotes/{id}/asks/{askId}": {
      "get": {
        "description": "One question or change request on a quote, as the list gives it. API keys need **Read quotes**. Phones see only what their staff member’s role reaches.",
        "operationId": "quote_ask",
        "parameters": [
          {
            "description": "The id from a list.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "The `id` of an item from `GET …/asks`.",
            "in": "path",
            "name": "askId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Ask"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get a quote’s open item",
        "x-rate-weight": 1,
        "x-required-permission": {
          "id": "ORDERS_VIEW",
          "label": "View quotes and orders"
        },
        "x-required-scopes": ["QUOTES_READ"],
        "x-stability": "stable"
      }
    },
    "/quotes/{id}/asks/{askId}/apply": {
      "post": {
        "description": "Confirm change (the customer’s requested value) or Apply change (another value, the request staying open) on a quote’s change request, with the reply, through the quote’s own save. Send the `version` from the review. Needs Handle customer messages and Edit quotes and orders, on a record the caller can change; the save then checks its own rules (what the change needs, Prices and exceptions for a price, the status lock), for an API key as for a person, and records the key as the one who made the change. A reply goes to the customer: from an API key it also needs Send emails, and counts against the key’s Emails per day cap. API keys need **Create and change quotes**, and **Work the Inbox**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "quote_ask_apply",
        "parameters": [
          {
            "description": "The id from a list.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "The `id` of an item from `GET …/asks`.",
            "in": "path",
            "name": "askId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AskApply"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AskApplied"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Apply a quote’s open item",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "CUSTOMERS_SERVICE",
          "label": "Handle customer messages and change requests"
        },
        "x-required-scopes": ["QUOTES_WRITE"],
        "x-required-scopes-all": ["INBOX_WRITE"],
        "x-stability": "stable"
      }
    },
    "/quotes/{id}/asks/{askId}/decision": {
      "post": {
        "description": "Settle a customer’s question or change request on a quote: resolve, decline, apply (mark applied), reopen or accept, as the app does. Needs Handle customer messages, on a quote the person can change. Accept and closing the last open change request can move the quote’s status. API keys need **Work the Inbox**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "quote_ask_decision",
        "parameters": [
          {
            "description": "The id from a list.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "The `id` of an item from `GET …/asks`.",
            "in": "path",
            "name": "askId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AskDecision"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AskDecided"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Decide a quote’s open item",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "CUSTOMERS_SERVICE",
          "label": "Handle customer messages and change requests"
        },
        "x-required-scopes": ["INBOX_WRITE"],
        "x-stability": "stable"
      }
    },
    "/quotes/{id}/asks/{askId}/review": {
      "get": {
        "description": "What the review drawer shows for one change request on a quote: the customer’s message, the line, each value the option offers with its price and why it can’t go on the line, the money, the version to send back and why nothing can be decided now, if so. API keys need **Read quotes**. Phones see only what their staff member’s role reaches. Preview: this endpoint’s shape may still change inside v1.",
        "operationId": "quote_ask_review",
        "parameters": [
          {
            "description": "The id from a list.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "The `id` of an item from `GET …/asks`.",
            "in": "path",
            "name": "askId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AskReview"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Review a quote’s open item",
        "x-rate-weight": 1,
        "x-required-permission": {
          "id": "ORDERS_VIEW",
          "label": "View quotes and orders"
        },
        "x-required-scopes": ["QUOTES_READ"],
        "x-stability": "preview"
      }
    },
    "/quotes/{id}/attention": {
      "get": {
        "description": "Whether the quote needs attention and who it is waiting on (the store, the customer, a vendor), checked fresh, with the suggested follow-up. API keys need **Read quotes**. Phones see only what their staff member’s role reaches.",
        "operationId": "quote_attention",
        "parameters": [
          {
            "description": "The id from a list.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Attention"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "See what needs attention on a quote",
        "x-rate-weight": 1,
        "x-required-permission": {
          "id": "ORDERS_VIEW",
          "label": "View quotes and orders"
        },
        "x-required-scopes": ["QUOTES_READ"],
        "x-stability": "stable"
      },
      "post": {
        "description": "Act on the quote’s Needs attention: ignore it for a few days, mark it followed up, or record that a follow-up went out (the app’s Ignore, Mark as followed up and follow-up sent). A reminder to the customer is sent first with `POST /conversations/{key}/reply`; this records it and restarts the wait. Needs Edit quotes and orders, on a quote the person can change. Answers the attention as it stands now. A team reminder from an API key counts against its Emails per day cap. API keys need **Create and change quotes**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "quote_attention_action",
        "parameters": [
          {
            "description": "The id from a list.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AttentionAction"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Attention"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Act on a quote’s attention",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "ORDERS_EDIT",
          "label": "Create and edit quotes and orders"
        },
        "x-required-scopes": ["QUOTES_WRITE"],
        "x-stability": "stable"
      }
    },
    "/quotes/{id}/comments": {
      "post": {
        "description": "Add a comment to the activity feed. API keys need **Create and change quotes**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "quote_comment_create",
        "parameters": [
          {
            "description": "The id from a list.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CommentCreate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ActivityEntry"
                }
              }
            },
            "description": "Created"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Add a comment",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "ORDERS_VIEW",
          "label": "View quotes and orders"
        },
        "x-required-scopes": ["QUOTES_WRITE"],
        "x-stability": "stable"
      }
    },
    "/quotes/{id}/comments/{commentId}": {
      "delete": {
        "description": "Delete a comment the caller wrote, as the activity feed’s Delete (the same rule as editing it: an API key deletes only its own). Only a person’s comment can be deleted: any other entry is `404`. The comment can’t be brought back. API keys need **Create and change quotes**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "quote_comment_delete",
        "parameters": [
          {
            "description": "The id from a list.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "The comment’s `id` in the record’s activity (`GET /quotes/{id}/activity`, an entry of type `comment`).",
            "in": "path",
            "name": "commentId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CommentDeleted"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Delete a comment on a quote",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "ORDERS_VIEW",
          "label": "View quotes and orders"
        },
        "x-required-scopes": ["QUOTES_WRITE"],
        "x-stability": "stable"
      },
      "patch": {
        "description": "Change the text of a comment the caller wrote, as the activity feed’s Edit: an API key edits only its own comments; a phone’s staff member their own, or any as the store owner (with roles off, anyone who may change the record). Only a person’s comment can be changed: any other entry (a status change, a version) is `404`. Answers the entry. API keys need **Create and change quotes**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "quote_comment_edit",
        "parameters": [
          {
            "description": "The id from a list.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "The comment’s `id` in the record’s activity (`GET /quotes/{id}/activity`, an entry of type `comment`).",
            "in": "path",
            "name": "commentId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CommentCreate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ActivityEntry"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Change a comment on a quote",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "ORDERS_VIEW",
          "label": "View quotes and orders"
        },
        "x-required-scopes": ["QUOTES_WRITE"],
        "x-stability": "stable"
      }
    },
    "/quotes/{id}/convert": {
      "post": {
        "description": "Turn a quote into an order (payment due later). Taking it out of review or a locked status, or placing it without what it usually needs, takes Prices and exceptions as well. API keys need **Change orders**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "quote_convert",
        "parameters": [
          {
            "description": "The id from a list.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/QuoteConvert"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Order"
                }
              }
            },
            "description": "OK"
          },
          "202": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReadBackPending"
                }
              }
            },
            "description": "Accepted: the write is done, but its record couldn’t be read back. Don’t send it again: read it with `read`."
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Turn into an order",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "ORDERS_CONVERT",
          "label": "Convert quotes to orders"
        },
        "x-required-scopes": ["ORDERS_WRITE"],
        "x-stability": "stable"
      }
    },
    "/quotes/{id}/customer-payment": {
      "get": {
        "description": "Whether the customer may pay the quote themselves, as its Customer payment row shows: `enabled` (turned on, when and by whom) and `store_gates_payment` (the store’s setting that customers can pay only once payment is turned on). Payments the store records are never gated. API keys need **Read quotes** or **Record and request payments**. Phones see only what their staff member’s role reaches.",
        "operationId": "quote_customer_payment",
        "parameters": [
          {
            "description": "The id from a list.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CustomerPayment"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "See a quote’s customer payment",
        "x-rate-weight": 1,
        "x-required-permission": {
          "id": "ORDERS_VIEW",
          "label": "View quotes and orders"
        },
        "x-required-scopes": ["QUOTES_READ", "PAYMENTS_WRITE"],
        "x-stability": "stable"
      },
      "post": {
        "description": "Turn customer payment on or off on the quote, as its Enable and Disable payment do. While the store gates payment, on shows the customer Pay on the sign page, the payment link and the emails’ checkout links, and off hides them. Turning it off refunds nothing, and a payment request already sent keeps its own link until it is cancelled (`cancellable` in `GET /quotes/{id}/payment-requests`, then `POST /payment-requests/{id}/cancel`). Asking for payment or recording one turns it on by itself. API keys need **Record and request payments**. An `Idempotency-Key` header makes a retry safe: the same key and body returns the first answer. Phones see only what their staff member’s role reaches.",
        "operationId": "quote_customer_payment_set",
        "parameters": [
          {
            "description": "The id from a list.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CustomerPaymentSet"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CustomerPaymentChange"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Turn a quote’s customer payment on or off",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "PAYMENTS_REQUEST",
          "label": "Request payment"
        },
        "x-required-scopes": ["PAYMENTS_WRITE"],
        "x-stability": "stable"
      }
    },
    "/quotes/{id}/deposit": {
      "get": {
        "description": "Whether a deposit can be asked for on the quote now, as its Request deposit says: `blocked_reason` is why not (the reason the button is greyed out, and what to do), null when it can. Ask for one with `POST /quotes/{id}/payment-requests` and `deposit`. API keys need **Record and request payments**. Phones see only what their staff member’s role reaches.",
        "operationId": "quote_deposit",
        "parameters": [
          {
            "description": "The id from a list.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DepositState"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "See if a quote can take a deposit",
        "x-rate-weight": 1,
        "x-required-permission": {
          "id": "PAYMENTS_REQUEST",
          "label": "Request payment"
        },
        "x-required-scopes": ["PAYMENTS_WRITE"],
        "x-stability": "stable"
      }
    },
    "/quotes/{id}/deposits": {
      "post": {
        "description": "Record a deposit the customer already paid outside Shopify (cash, a cheque, a transfer), as Request deposit’s Already paid does. Without Shopify Plus a deposit order is made and completed as paid in Shopify, on the queue, and nothing is sent to the customer; on Plus the quote is placed with the deposit recorded on it (placing it needs Change orders, and `override_requirements` places it without a missing signature or deposit). Nothing is charged. Checked against the key’s Largest payment cap and Daily payment and refund limit. API keys need **Record and request payments**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "quote_deposit_record",
        "parameters": [
          {
            "description": "The id from a list.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DepositRecord"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DepositRecorded"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Record a quote’s deposit paid",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "PAYMENTS_RECORD",
          "label": "Record payment and Mark as paid"
        },
        "x-required-scopes": ["PAYMENTS_WRITE"],
        "x-stability": "stable"
      }
    },
    "/quotes/{id}/duplicate": {
      "post": {
        "description": "Duplicate a quote, as the admin’s and the register’s Duplicate quote: a new Draft Quote (nothing in Shopify yet) with the source’s products, options, prices and own fees, and nothing else (no customer, notes, tags, discounts, terms, signature or payments); its activity says “Duplicated from …”. Made at the source’s location, or at `location_id` when the caller can’t use it. Add the customer and the rest with `PATCH /quotes/{id}`. A hand-set price or a fee off its saved price needs Override prices, as a create does. `422 RULE_REFUSED` (pickup and delivery parts, no products, more than a create takes). Answers `201` with the new quote. API keys need **Create and change quotes**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "quote_duplicate",
        "parameters": [
          {
            "description": "The id from a list.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/QuoteDuplicate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Order"
                }
              }
            },
            "description": "Created"
          },
          "202": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReadBackPending"
                }
              }
            },
            "description": "Accepted: the write is done, but its record couldn’t be read back. Don’t send it again: read it with `read`."
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Duplicate a quote",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "ORDERS_EDIT",
          "label": "Create and edit quotes and orders"
        },
        "x-required-scopes": ["QUOTES_WRITE"],
        "x-stability": "stable"
      }
    },
    "/quotes/{id}/email-placeholders": {
      "get": {
        "description": "The merge fields the quote’s email can use, each with this quote’s value, as the composer shows them: `items` (the documented ones, such as `{{customer.name}}` and `{{document.number}}`, with what each means) and `values` (every field by its path, the editor’s names included). Values include the customer’s own link and portal PIN, so it needs what the send needs. API keys need **Create and change quotes**, and **Send emails**. Phones see only what their staff member’s role reaches.",
        "operationId": "quote_email_placeholders",
        "parameters": [
          {
            "description": "The id from a list.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmailPlaceholders"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "List a quote’s merge fields",
        "x-rate-weight": 1,
        "x-required-permission": {
          "id": "ORDERS_VIEW",
          "label": "View quotes and orders"
        },
        "x-required-scopes": ["QUOTES_WRITE"],
        "x-required-scopes-all": ["EMAILS_SEND"],
        "x-stability": "stable"
      }
    },
    "/quotes/{id}/expiry": {
      "post": {
        "description": "Give a quote its own last valid day, or put it back on the store’s default (`valid_until: null`). OrderPilot’s own expiry change: an unsigned, open quote only; one activity entry. API keys need **Create and change quotes**. An `Idempotency-Key` header makes a retry safe: the same key and body returns the first answer. Phones see only what their staff member’s role reaches.",
        "operationId": "quote_expiry",
        "parameters": [
          {
            "description": "The id from a list.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/QuoteExpiryChange"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/QuoteExpirySet"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Set a quote’s expiry",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "ORDERS_EDIT",
          "label": "Create and edit quotes and orders"
        },
        "x-required-scopes": ["QUOTES_WRITE"],
        "x-stability": "stable"
      }
    },
    "/quotes/{id}/force-convert": {
      "post": {
        "description": "Force Convert to Order: place the quote now without the customer’s signature, as the admin’s ⋯ › Force Convert to Order. The signature is waived for good (pay links stop asking for it) and the placement runs on the queue. `202` with `state: converting`: read `GET /orders/{id}/force-convert` until it is `placed` (or `failed`, with why). Placed this way already: `200`, `already_converted: true`. Refused with the admin’s sentence: `422 CONVERSION_REFUSED`, `409 CONVERSION_IN_PROGRESS`, `409 SPLIT_PENDING`, `409 LOCATION_REQUIRED`. Leaving review needs Approve, a locked status Force Edit. Needs Create and edit and Skip requirements and Convert (a key: Change orders and Prices and exceptions). API keys need **Change orders**, and **Prices and exceptions**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "quote_force_convert",
        "parameters": [
          {
            "description": "The id from a list.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Empty"
              }
            }
          },
          "required": false
        },
        "responses": {
          "202": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ForceConvert"
                }
              }
            },
            "description": "Accepted"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Force convert a quote",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "APPROVALS_REQUIREMENTS",
          "label": "Bypass signature and deposit requirements"
        },
        "x-required-scopes": ["ORDERS_WRITE"],
        "x-required-scopes-all": ["PRICING_WRITE"],
        "x-stability": "stable"
      }
    },
    "/quotes/{id}/legal-hold": {
      "get": {
        "description": "The quote’s standing legal hold, or null: while it holds, none of its signature evidence is deleted at the end of the retention period. A person places or lifts a hold on the order page (⋯ › Place legal hold, Lift legal hold); standing holds are listed in Settings › Account and data › Signature records. A key can’t change a hold. Needs View quotes and orders (a key: Read quotes). API keys need **Read quotes**. Phones see only what their staff member’s role reaches.",
        "operationId": "quote_legal_hold",
        "parameters": [
          {
            "description": "The id from a list.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LegalHold"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get a quote’s legal hold",
        "x-rate-weight": 1,
        "x-required-permission": {
          "id": "ORDERS_VIEW",
          "label": "View quotes and orders"
        },
        "x-required-scopes": ["QUOTES_READ"],
        "x-stability": "stable"
      }
    },
    "/quotes/{id}/lines/{lineId}/sync-attributes": {
      "post": {
        "description": "Sync Shopify attributes on a saved Shopify product line, as the order screen’s line menu does: its option values are refreshed from its product’s own values in Shopify, without repricing the line. Queued: answers `202` with a `job_id`; read `GET /line-attribute-syncs/{jobId}` until it is `synced`, `refused` or `failed` (nothing changes unless it is `synced`). Only a Shopify product’s line (`422 RULE_REFUSED` for a template line); a status that locks editing needs Force Edit (Prices and exceptions). Values that change what the line’s options cost, other than the product’s own, need Override prices (the run is `refused` without it). API keys need **Create and change quotes**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "quote_line_attribute_sync",
        "parameters": [
          {
            "description": "The id from a list.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "The line’s `id` (`lines[].id` of `GET /quotes/{id}`).",
            "in": "path",
            "name": "lineId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Empty"
              }
            }
          },
          "required": false
        },
        "responses": {
          "202": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LineAttributeSyncQueued"
                }
              }
            },
            "description": "Accepted"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Sync a quote line’s attributes",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "ORDERS_EDIT",
          "label": "Create and edit quotes and orders"
        },
        "x-required-scopes": ["QUOTES_WRITE"],
        "x-stability": "stable"
      }
    },
    "/quotes/{id}/next-step": {
      "get": {
        "description": "What needs doing next on the quote, as the app’s Next action button lists it: the customer’s open questions and change requests first, the follow-up while it needs attention, then the shop’s own steps, each marked when it waits on the customer or a vendor. `primary_key` names the row the black button does; null when the first row waits, or nothing is left. `next_step` is null when the store has no published status map. API keys need **Read quotes**. Phones see only what their staff member’s role reaches.",
        "operationId": "quote_next_step",
        "parameters": [
          {
            "description": "The id from a list.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NextStep"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "See a quote’s next step",
        "x-rate-weight": 1,
        "x-required-permission": {
          "id": "ORDERS_VIEW",
          "label": "View quotes and orders"
        },
        "x-required-scopes": ["QUOTES_READ"],
        "x-stability": "stable"
      }
    },
    "/quotes/{id}/pay-link": {
      "post": {
        "description": "The quote’s payment link for you to hand the customer yourself, as Copy payment link does: it opens the checkout while the customer may pay (once signed, when a signature is needed), else the quote’s page, which says what is needed first; a split order’s link opens its page, where each part is paid. Handing it out is asking for payment, so customer payment turns on and a quote being priced shows its prices. Refused with the reason Copy payment link is greyed out (nothing to pay, not created yet, expired, Shopify catching up). API keys need **Record and request payments**. An `Idempotency-Key` header makes a retry safe: the same key and body returns the first answer. Phones see only what their staff member’s role reaches.",
        "operationId": "quote_pay_link",
        "parameters": [
          {
            "description": "The id from a list.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Empty"
              }
            }
          },
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PayLink"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Copy a quote’s payment link",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "PAYMENTS_REQUEST",
          "label": "Request payment"
        },
        "x-required-scopes": ["PAYMENTS_WRITE"],
        "x-stability": "stable"
      }
    },
    "/quotes/{id}/payment-requests": {
      "get": {
        "description": "The quote’s payment requests, newest first, as its Payments and invoices list shows them: a request for the balance (a Request payment email), a deposit, store credit, a POS payment, each with what it asked for and what was paid. A split order lists both parts’ requests. `link` is the request’s own payment link while it waits (Record and request payments only), and `cancellable` says whether `POST /payment-requests/{id}/cancel` can still cancel it. API keys need **Read quotes** or **Record and request payments**. Phones see only what their staff member’s role reaches.",
        "operationId": "quote_payment_requests",
        "parameters": [
          {
            "description": "The id from a list.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaymentRequestList"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "List a quote’s payment requests",
        "x-rate-weight": 1,
        "x-required-permission": {
          "id": "ORDERS_VIEW",
          "label": "View quotes and orders"
        },
        "x-required-scopes": ["QUOTES_READ", "PAYMENTS_WRITE"],
        "x-stability": "stable"
      },
      "post": {
        "description": "Ask the customer to pay, as the quote’s Request payment and Request deposit do. Without `deposit`: the Request payment email for the balance due, which records the request and turns customer payment on (it needs Send emails too, and counts against the key’s Emails per day cap). With `deposit`: without Shopify Plus, a deposit order whose link Shopify emails the customer (Settings › Deposit orders on); on Shopify Plus, Shopify’s own deposit on the draft’s terms, emailed by asking again without `deposit` once `sync_status` is `synced` (see `next`). Nothing is charged: the customer pays in Shopify’s checkout. Refused with the store’s reason when the quote can’t be asked for payment now. `send_at` schedules the balance’s email for later, as the composer’s Schedule does. API keys need **Record and request payments**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "quote_payment_request_create",
        "parameters": [
          {
            "description": "The id from a list.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PaymentRequestCreate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaymentRequestOutcome"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Request payment on a quote",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "PAYMENTS_REQUEST",
          "label": "Request payment"
        },
        "x-required-scopes": ["PAYMENTS_WRITE"],
        "x-stability": "stable"
      }
    },
    "/quotes/{id}/payment-requests/scheduled": {
      "get": {
        "description": "The quote’s scheduled Request payment emails, newest first, as the composer’s Scheduled list shows them (the last 50 scheduled emails, Request payment templates only): who it goes to, when, and its state. `can_cancel` says whether it can still be stopped with `DELETE /quotes/{id}/payment-requests/scheduled/{scheduleId}`. Schedule one with `send_at` on `POST /quotes/{id}/payment-requests`. API keys need **Read quotes** or **Record and request payments**. Phones see only what their staff member’s role reaches.",
        "operationId": "quote_scheduled_payment_requests",
        "parameters": [
          {
            "description": "The id from a list.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ScheduledPaymentRequestList"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "List a quote’s scheduled payment requests",
        "x-rate-weight": 1,
        "x-required-permission": {
          "id": "ORDERS_VIEW",
          "label": "View quotes and orders"
        },
        "x-required-scopes": ["QUOTES_READ", "PAYMENTS_WRITE"],
        "x-stability": "stable"
      }
    },
    "/quotes/{id}/payment-requests/scheduled/{scheduleId}": {
      "delete": {
        "description": "Cancel a scheduled Request payment email on the quote before it goes, as the composer’s Cancel. Refused once it is due to send. The email the key scheduled stays counted against its Emails per day cap. API keys need **Record and request payments**, and **Send emails**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "quote_scheduled_payment_request_cancel",
        "parameters": [
          {
            "description": "The id from a list.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "A scheduled Request payment’s `id`, or the `schedule_id` the request answered.",
            "in": "path",
            "name": "scheduleId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ScheduledPaymentRequestCancelled"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Cancel a quote’s scheduled payment request",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "CUSTOMERS_EMAIL",
          "label": "Email customers"
        },
        "x-required-scopes": ["PAYMENTS_WRITE"],
        "x-required-scopes-all": ["EMAILS_SEND"],
        "x-stability": "stable"
      }
    },
    "/quotes/{id}/pdf": {
      "get": {
        "description": "The quote as a PDF, as the app prints it (a signed quote gives its signed copy). API keys need **Read quotes**. Phones see only what their staff member’s role reaches.",
        "operationId": "quote_pdf",
        "parameters": [
          {
            "description": "The id from a list.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/pdf": {
                "schema": {
                  "$ref": "#/components/schemas/Pdf"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Download the PDF",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "ORDERS_VIEW",
          "label": "View quotes and orders"
        },
        "x-required-scopes": ["QUOTES_READ"],
        "x-stability": "stable"
      }
    },
    "/quotes/{id}/review": {
      "post": {
        "description": "A reviewer’s decision on the quote, as the review queue’s Approve, Reject and Request changes: `approve` keeps it a quote; `reject` and `request_changes` move it to its Rejected or Changes Requested status, `note` kept as the feedback and in the activity. The status map then moves it, as in the admin. Approving a quote signed with payment due later places it, which also needs Change orders. Send the record’s `version` from its read, a list row or your last change (or its `updated_at` as `expected_updated_at`); changed since: `409 STALE_VERSION` with the current `version`. The answer carries the next `version`. Refused with the queue’s sentence: `422 RULE_REFUSED`, `409 STATUS_CONFLICT`. Needs Approve and reject (a key: Prices and exceptions). API keys need **Create and change quotes**, and **Prices and exceptions**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "quote_review",
        "parameters": [
          {
            "description": "The id from a list.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReviewDecision"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReviewDecided"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Decide a quote’s review",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "APPROVALS_REVIEW",
          "label": "Approve, reject or request changes"
        },
        "x-required-scopes": ["QUOTES_WRITE"],
        "x-required-scopes-all": ["PRICING_WRITE"],
        "x-stability": "stable"
      }
    },
    "/quotes/{id}/scheduled-emails": {
      "get": {
        "description": "The quote’s scheduled emails and texts, newest first (the last 50), as the composer’s Scheduled list: what goes, to whom, when, and its state. `can_cancel` says whether `DELETE /quotes/{id}/scheduled-emails/{scheduleId}` can still stop it. Schedule one with `send_at` on `POST /quotes/{id}/send`. API keys need **Read quotes**. Phones see only what their staff member’s role reaches.",
        "operationId": "quote_scheduled_emails",
        "parameters": [
          {
            "description": "The id from a list.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ScheduledEmailList"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "List a quote’s scheduled emails",
        "x-rate-weight": 1,
        "x-required-permission": {
          "id": "ORDERS_VIEW",
          "label": "View quotes and orders"
        },
        "x-required-scopes": ["QUOTES_READ"],
        "x-stability": "stable"
      }
    },
    "/quotes/{id}/scheduled-emails/{scheduleId}": {
      "delete": {
        "description": "Cancel a scheduled email (or text) on the quote before it goes, as the composer’s Cancel. Refused once it is due to send. The email the key scheduled stays counted against its Emails per day cap. API keys need **Create and change quotes**, and **Send emails**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "quote_scheduled_email_cancel",
        "parameters": [
          {
            "description": "The id from a list.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "The scheduled email’s `id`, from `GET /quotes/{id}/scheduled-emails`, or the `schedule_id` the send answered.",
            "in": "path",
            "name": "scheduleId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ScheduledEmailCancelled"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Cancel a quote’s scheduled email",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "CUSTOMERS_EMAIL",
          "label": "Email customers"
        },
        "x-required-scopes": ["QUOTES_WRITE"],
        "x-required-scopes-all": ["EMAILS_SEND"],
        "x-stability": "stable"
      }
    },
    "/quotes/{id}/send": {
      "post": {
        "description": "Email the quote to the customer with one of the store’s customer email templates, in its own words or yours (`subject`, `message`; with no template, your own email as typed), now or at `send_at`. Check it first with `POST /quotes/{id}/send/preview`. Counts against the key’s Emails per day cap (a scheduled one when it is scheduled). API keys need **Create and change quotes**, and **Send emails**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "quote_send",
        "parameters": [
          {
            "description": "The id from a list.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SendEmail"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmailQueued"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Send to customer",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "CUSTOMERS_EMAIL",
          "label": "Email customers"
        },
        "x-required-scopes": ["QUOTES_WRITE"],
        "x-required-scopes-all": ["EMAILS_SEND"],
        "x-stability": "stable"
      }
    },
    "/quotes/{id}/send/preview": {
      "post": {
        "description": "The email as the quote’s composer previews it, sending nothing: a template (`template_key`, from `GET /email-templates`) with its own words or yours (`subject`, `message`, with merge fields from `GET /quotes/{id}/email-placeholders`), or with no template your own email as typed. The recipients decide the “what changed” lines a quote’s email lists. Answers the subject, the text, the HTML and the button’s link (the customer’s sign or portal link). Changes nothing. Needs what the send needs (the customer’s own links are in it). The payment request template is refused: it is sent and checked with `POST /quotes/{id}/payment-requests`. API keys need **Create and change quotes**, and **Send emails**. An `Idempotency-Key` header makes a retry safe: the same key and body returns the first answer. Phones see only what their staff member’s role reaches.",
        "operationId": "quote_send_preview",
        "parameters": [
          {
            "description": "The id from a list.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EmailCompose"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmailPreview"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Preview a quote’s email",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "ORDERS_VIEW",
          "label": "View quotes and orders"
        },
        "x-required-scopes": ["QUOTES_WRITE"],
        "x-required-scopes-all": ["EMAILS_SEND"],
        "x-stability": "stable"
      }
    },
    "/quotes/{id}/send/test": {
      "post": {
        "description": "Send a test of the quote’s email to one address (`test_to`), as the composer’s Send test: the same body as the preview, marked a test, to nobody else. With the PDF it is queued (`queued: true`, its result is in the store’s email activity); otherwise it is sent now. Refused when the store can’t send it, the test allowance is used, or the quote’s location isn’t on the store’s plan. Counts against the key’s Emails per day cap. API keys need **Create and change quotes**, and **Send emails**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "quote_send_test",
        "parameters": [
          {
            "description": "The id from a list.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EmailTest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmailTestSent"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Send a test of a quote’s email",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "CUSTOMERS_EMAIL",
          "label": "Email customers"
        },
        "x-required-scopes": ["QUOTES_WRITE"],
        "x-required-scopes-all": ["EMAILS_SEND"],
        "x-stability": "stable"
      }
    },
    "/quotes/{id}/sign-link": {
      "post": {
        "description": "The quote’s sign link for you to hand the customer yourself, as Copy sign link does (for a store that doesn’t email through OrderPilot): the page where they view, sign and pay. Handing it out asks them to sign, so it takes the same rights as Request signature; a quote being priced shows its prices. Refused with the reason Copy sign link is greyed out (not created yet, expired, the customer’s open items). Sends nothing. API keys need **Create and change quotes**, and **Send emails**. An `Idempotency-Key` header makes a retry safe: the same key and body returns the first answer. Phones see only what their staff member’s role reaches.",
        "operationId": "quote_sign_link",
        "parameters": [
          {
            "description": "The id from a list.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Empty"
              }
            }
          },
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SignLink"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Copy a quote’s sign link",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "CUSTOMERS_EMAIL",
          "label": "Email customers"
        },
        "x-required-scopes": ["QUOTES_WRITE"],
        "x-required-scopes-all": ["EMAILS_SEND"],
        "x-stability": "stable"
      }
    },
    "/quotes/{id}/signature-request": {
      "post": {
        "description": "Email the customer the Request signature email (or the store’s own version of it), as the quote’s Request signature does: it carries the sign link, and once it went out the customer has to sign before they pay. Waits on the customer’s open questions and change requests, as the app does. Counts against the key’s Emails per day cap. API keys need **Create and change quotes**, and **Send emails**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "quote_signature_request",
        "parameters": [
          {
            "description": "The id from a list.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SignatureRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmailQueued"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Request a quote’s signature",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "CUSTOMERS_EMAIL",
          "label": "Email customers"
        },
        "x-required-scopes": ["QUOTES_WRITE"],
        "x-required-scopes-all": ["EMAILS_SEND"],
        "x-stability": "stable"
      }
    },
    "/quotes/{id}/signatures": {
      "get": {
        "description": "The quote’s signature records, newest first, as its Signature history lists them: each signature given on it (online through the sign link, on the store’s iPad, or on paper and recorded by staff), whether it still stands (`current`) or was replaced by an edit or a later signature (`superseded`), who signed and when, the consent they gave, the request’s address and device, what happened before (the link sent and opened), whether the signed PDF is stored, and a paper signature’s scan. A record whose files were deleted at the end of the store’s retention period says so in `purged`. Up to 100. API keys need **Read quotes**. Phones see only what their staff member’s role reaches.",
        "operationId": "quote_signatures",
        "parameters": [
          {
            "description": "The id from a list.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SignatureList"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "List a quote’s signatures",
        "x-rate-weight": 1,
        "x-required-permission": {
          "id": "ORDERS_VIEW",
          "label": "View quotes and orders"
        },
        "x-required-scopes": ["QUOTES_READ"],
        "x-stability": "stable"
      }
    },
    "/quotes/{id}/signed-copy/send": {
      "post": {
        "description": "Email the customer their signed PDF again, as the quote menu’s Email signed copy (the one sent at signing failed, or the customer lost it). Refused when the quote isn’t signed, when the signature was recorded from an external copy (no signed PDF), or when the store doesn’t send signed copies, with what to do. A retry with the same Idempotency-Key never sends twice. Counts against the key’s Emails per day cap. API keys need **Create and change quotes**, and **Send emails**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "quote_signed_copy_send",
        "parameters": [
          {
            "description": "The id from a list.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Empty"
              }
            }
          },
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SignedCopySent"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Email a quote’s signed copy",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "CUSTOMERS_EMAIL",
          "label": "Email customers"
        },
        "x-required-scopes": ["QUOTES_WRITE"],
        "x-required-scopes-all": ["EMAILS_SEND"],
        "x-stability": "stable"
      }
    },
    "/quotes/{id}/status": {
      "post": {
        "description": "Move a quote to another status, named or by id. A status the store hasn’t, or one it can’t move to, is refused naming the statuses it can move to. API keys need **Create and change quotes**. An `Idempotency-Key` header makes a retry safe: the same key and body returns the first answer. Phones see only what their staff member’s role reaches.",
        "operationId": "quote_status",
        "parameters": [
          {
            "description": "The id from a list.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/StatusChange"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StatusChanged"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Change a status",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "ORDERS_STATUS",
          "label": "Change order status"
        },
        "x-required-scopes": ["QUOTES_WRITE"],
        "x-stability": "stable"
      }
    },
    "/quotes/{id}/store-credit": {
      "get": {
        "description": "The customer’s Shopify store credit for the quote, as Payments’ Store credit reads it: what they have in the quote’s currency, the balance due, the amount to offer and `blocked_reason` (why credit can’t pay it now). A placed order is paid now (without Shopify Plus only the whole balance); before placing, without Plus the credit pays a deposit (a cent at least stays due), and on Plus it places the order. API keys need **Record and request payments**. Phones see only what their staff member’s role reaches.",
        "operationId": "quote_store_credit",
        "parameters": [
          {
            "description": "The id from a list.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StoreCredit"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "See a quote’s store credit",
        "x-rate-weight": 1,
        "x-required-permission": {
          "id": "PAYMENTS_RECORD",
          "label": "Record payment and Mark as paid"
        },
        "x-required-scopes": ["PAYMENTS_WRITE"],
        "x-stability": "stable"
      },
      "post": {
        "description": "Pay the quote from the customer’s Shopify store credit, as Payments’ Store credit does: a debit of their Shopify balance, recorded as a payment in Shopify. A placed order is paid now (without Shopify Plus only the whole balance); before placing, without Plus a deposit is paid from the credit on the queue (`queued`), and on Plus the order is placed with the credit paid on it (placing it needs Change orders; `override_requirements` places it without a missing signature or deposit). Read `GET /quotes/{id}/store-credit` first. Checked against the key’s Largest payment cap and Daily payment and refund limit. API keys need **Record and request payments**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "quote_store_credit_pay",
        "parameters": [
          {
            "description": "The id from a list.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/StoreCreditPay"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StoreCreditPaid"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Pay a quote with store credit",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "PAYMENTS_RECORD",
          "label": "Record payment and Mark as paid"
        },
        "x-required-scopes": ["PAYMENTS_WRITE"],
        "x-stability": "stable"
      }
    },
    "/quotes/{id}/sync-retry": {
      "post": {
        "description": "Send the record to Shopify again after its sync failed (`sync_status` `failed`), as the order page’s Retry sync does: its Shopify draft is made, or updated, again on the queue. Answers at once with `sync_status: pending`; read the record again until it is `synced`. `409 SYNC_IN_PROGRESS` while a sync is running, `422 NOT_APPLICABLE` when there is nothing to retry (it is `synced`, or has no lines), `422 RULE_REFUSED` when its status cancels it in Shopify. API keys need **Create and change quotes**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "quote_sync_retry",
        "parameters": [
          {
            "description": "The id from a list.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Empty"
              }
            }
          },
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SyncRetry"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Retry a quote’s Shopify sync",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "ORDERS_EDIT",
          "label": "Create and edit quotes and orders"
        },
        "x-required-scopes": ["QUOTES_WRITE"],
        "x-stability": "stable"
      }
    },
    "/reports/profit": {
      "get": {
        "description": "Analytics › Profit for a period: what the order lines sold for (net, without tax), what they cost (landed cost of the units drawn, less freight; estimated before any is drawn), freight, commission and what was left (net and margin), per group and in total per currency. The first page also has the chart by day, week or month and the best-selling configurations. Orders placed in the period, on the records the caller reaches. Shows costs and everyone’s commission: an API key needs Read reports and See commission. API keys need **See commission**, and **Read reports**. Phones see only what their staff member’s role reaches.",
        "operationId": "reports_profit",
        "parameters": [
          {
            "description": "The period in the store’s days: the last 7, 30 or 90 days up to today (`30d` when left out), or `custom` with `from` and `to`. Another value is `400 INVALID_RANGE`.",
            "in": "query",
            "name": "range",
            "required": false,
            "schema": {
              "enum": ["7d", "30d", "90d", "custom"],
              "type": "string"
            }
          },
          {
            "description": "With `range=custom`: the first day, YYYY-MM-DD, in the store’s time zone.",
            "in": "query",
            "name": "from",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "With `range=custom`: the last day, YYYY-MM-DD, included. A custom period covers at most 366 days (`400 INVALID_RANGE`).",
            "in": "query",
            "name": "to",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "One store: an `id` from `GET /locations`. Left out: every store the caller reaches (a key limited to locations reaches only its own). A store outside the caller’s reach is `403 ACCESS_DENIED`.",
            "in": "query",
            "name": "location",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "What a row is: `product` (default), `template`, `category`, `vendor`, `store` or `configuration`.",
            "in": "query",
            "name": "group_by",
            "required": false,
            "schema": {
              "enum": [
                "product",
                "template",
                "category",
                "vendor",
                "store",
                "configuration"
              ],
              "type": "string"
            }
          },
          {
            "description": "`net` (default) or `selling`.",
            "in": "query",
            "name": "sort",
            "required": false,
            "schema": {
              "enum": ["net", "selling"],
              "type": "string"
            }
          },
          {
            "description": "`desc` (default) or `asc`.",
            "in": "query",
            "name": "dir",
            "required": false,
            "schema": {
              "enum": ["desc", "asc"],
              "type": "string"
            }
          },
          {
            "description": "Only groups whose name holds this, any case (up to 100 characters).",
            "in": "query",
            "name": "search",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Groups per page, 1–50 (default 25). A larger value is clamped to 50.",
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 25,
              "maximum": 50,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "description": "The `next_cursor` of the previous page of this list.",
            "in": "query",
            "name": "cursor",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProfitReport"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "See the profit report",
        "x-rate-weight": 1,
        "x-required-permission": {
          "id": "COMMISSION_VIEW_ALL",
          "label": "View all commission and profit"
        },
        "x-required-scopes": ["COMMISSION_READ"],
        "x-required-scopes-all": ["REPORTS_READ"],
        "x-stability": "stable"
      }
    },
    "/reports/profit/breakdown": {
      "get": {
        "description": "What one profit group holds, as the admin opens a row: its configurations (grouped by product or template) or its products (by category, vendor or store), the first five in the report’s order and the rest added up as `rest`. Not for `group_by=configuration` (a configuration holds nothing more). An API key needs Read reports and See commission. API keys need **See commission**, and **Read reports**. Phones see only what their staff member’s role reaches.",
        "operationId": "reports_profit_breakdown",
        "parameters": [
          {
            "description": "The period in the store’s days: the last 7, 30 or 90 days up to today (`30d` when left out), or `custom` with `from` and `to`. Another value is `400 INVALID_RANGE`.",
            "in": "query",
            "name": "range",
            "required": false,
            "schema": {
              "enum": ["7d", "30d", "90d", "custom"],
              "type": "string"
            }
          },
          {
            "description": "With `range=custom`: the first day, YYYY-MM-DD, in the store’s time zone.",
            "in": "query",
            "name": "from",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "With `range=custom`: the last day, YYYY-MM-DD, included. A custom period covers at most 366 days (`400 INVALID_RANGE`).",
            "in": "query",
            "name": "to",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "One store: an `id` from `GET /locations`. Left out: every store the caller reaches (a key limited to locations reaches only its own). A store outside the caller’s reach is `403 ACCESS_DENIED`.",
            "in": "query",
            "name": "location",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "What a row is: `product` (default), `template`, `category`, `vendor`, `store` or `configuration`.",
            "in": "query",
            "name": "group_by",
            "required": false,
            "schema": {
              "enum": [
                "product",
                "template",
                "category",
                "vendor",
                "store",
                "configuration"
              ],
              "type": "string"
            }
          },
          {
            "description": "`net` (default) or `selling`.",
            "in": "query",
            "name": "sort",
            "required": false,
            "schema": {
              "enum": ["net", "selling"],
              "type": "string"
            }
          },
          {
            "description": "`desc` (default) or `asc`.",
            "in": "query",
            "name": "dir",
            "required": false,
            "schema": {
              "enum": ["desc", "asc"],
              "type": "string"
            }
          },
          {
            "description": "The group’s `key` from `GET /reports/profit`, with the same `group_by`.",
            "in": "query",
            "name": "key",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "The group’s `currency` from `GET /reports/profit`.",
            "in": "query",
            "name": "currency",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProfitBreakdown"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Open a profit report row",
        "x-rate-weight": 1,
        "x-required-permission": {
          "id": "COMMISSION_VIEW_ALL",
          "label": "View all commission and profit"
        },
        "x-required-scopes": ["COMMISSION_READ"],
        "x-required-scopes-all": ["REPORTS_READ"],
        "x-stability": "stable"
      }
    },
    "/reports/sales": {
      "get": {
        "description": "Analytics › Sales for a period and the period it is compared with: revenue (net merchandise of the orders placed, after discounts and refunds, without tax and shipping), orders, average order, quotes created and converted, by day, week or month; open quotes, the top products and the first page of salespeople. The admin’s own report: the same numbers, read on the records the caller reaches. One currency at a time. An API key needs Read reports and Read quotes or Read orders. API keys need **Read quotes** or **Read orders**, and **Read reports**. Phones see only what their staff member’s role reaches.",
        "operationId": "reports_sales",
        "parameters": [
          {
            "description": "The period in the store’s days: the last 7, 30 or 90 days up to today (`30d` when left out), or `custom` with `from` and `to`. Another value is `400 INVALID_RANGE`.",
            "in": "query",
            "name": "range",
            "required": false,
            "schema": {
              "enum": ["7d", "30d", "90d", "custom"],
              "type": "string"
            }
          },
          {
            "description": "With `range=custom`: the first day, YYYY-MM-DD, in the store’s time zone.",
            "in": "query",
            "name": "from",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "With `range=custom`: the last day, YYYY-MM-DD, included. A custom period covers at most 366 days (`400 INVALID_RANGE`).",
            "in": "query",
            "name": "to",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "One store: an `id` from `GET /locations`. Left out: every store the caller reaches (a key limited to locations reaches only its own). A store outside the caller’s reach is `403 ACCESS_DENIED`.",
            "in": "query",
            "name": "location",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "What the period is compared with: `previous` (the same number of days before it, default) or `year` (the same days a year earlier).",
            "in": "query",
            "name": "compare",
            "required": false,
            "schema": {
              "enum": ["previous", "year"],
              "type": "string"
            }
          },
          {
            "description": "Three letters (`USD`). Left out: the currency the period sold most in. The money is one currency at a time; `currencies` lists every one the period has.",
            "in": "query",
            "name": "currency",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Only salespeople whose name holds this (up to 100 characters).",
            "in": "query",
            "name": "q",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "How the salespeople are ordered: `revenue` (default), `name`, `quotes`, `converted`, `conversion`, `orders` or `average`.",
            "in": "query",
            "name": "sort",
            "required": false,
            "schema": {
              "enum": [
                "revenue",
                "name",
                "quotes",
                "converted",
                "conversion",
                "orders",
                "average"
              ],
              "type": "string"
            }
          },
          {
            "description": "`desc` (default) or `asc`.",
            "in": "query",
            "name": "dir",
            "required": false,
            "schema": {
              "enum": ["desc", "asc"],
              "type": "string"
            }
          },
          {
            "description": "Salespeople per page, 1–50 (default 25). A larger value is clamped to 50.",
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 25,
              "maximum": 50,
              "minimum": 1,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SalesReport"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "See the sales report",
        "x-rate-weight": 1,
        "x-required-permission": {
          "id": "REPORTS_ANALYTICS",
          "label": "View Home and Analytics totals"
        },
        "x-required-scopes": ["QUOTES_READ", "ORDERS_READ"],
        "x-required-scopes-all": ["REPORTS_READ"],
        "x-stability": "stable"
      }
    },
    "/reports/sales/salespeople": {
      "get": {
        "description": "A page of the sales report’s salespeople: each person’s quotes, converted quotes, orders and revenue in the period, by their share of each record (a quote counts for everyone credited on it). What no one is credited with is `unassigned` (first page, no search), so the people and `unassigned` add up to the revenue. An API key needs Read reports and Read quotes or Read orders. API keys need **Read quotes** or **Read orders**, and **Read reports**. Phones see only what their staff member’s role reaches.",
        "operationId": "reports_sales_salespeople",
        "parameters": [
          {
            "description": "The period in the store’s days: the last 7, 30 or 90 days up to today (`30d` when left out), or `custom` with `from` and `to`. Another value is `400 INVALID_RANGE`.",
            "in": "query",
            "name": "range",
            "required": false,
            "schema": {
              "enum": ["7d", "30d", "90d", "custom"],
              "type": "string"
            }
          },
          {
            "description": "With `range=custom`: the first day, YYYY-MM-DD, in the store’s time zone.",
            "in": "query",
            "name": "from",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "With `range=custom`: the last day, YYYY-MM-DD, included. A custom period covers at most 366 days (`400 INVALID_RANGE`).",
            "in": "query",
            "name": "to",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "One store: an `id` from `GET /locations`. Left out: every store the caller reaches (a key limited to locations reaches only its own). A store outside the caller’s reach is `403 ACCESS_DENIED`.",
            "in": "query",
            "name": "location",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Three letters (`USD`): the `currency` `GET /reports/sales` answered.",
            "in": "query",
            "name": "currency",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Only salespeople whose name holds this (up to 100 characters).",
            "in": "query",
            "name": "q",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "How the salespeople are ordered: `revenue` (default), `name`, `quotes`, `converted`, `conversion`, `orders` or `average`.",
            "in": "query",
            "name": "sort",
            "required": false,
            "schema": {
              "enum": [
                "revenue",
                "name",
                "quotes",
                "converted",
                "conversion",
                "orders",
                "average"
              ],
              "type": "string"
            }
          },
          {
            "description": "`desc` (default) or `asc`.",
            "in": "query",
            "name": "dir",
            "required": false,
            "schema": {
              "enum": ["desc", "asc"],
              "type": "string"
            }
          },
          {
            "description": "Salespeople per page, 1–50 (default 25). A larger value is clamped to 50.",
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 25,
              "maximum": 50,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "description": "The `next_cursor` of the previous page of this list.",
            "in": "query",
            "name": "cursor",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SalesPeoplePage"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "List the sales report’s salespeople",
        "x-rate-weight": 1,
        "x-required-permission": {
          "id": "REPORTS_ANALYTICS",
          "label": "View Home and Analytics totals"
        },
        "x-required-scopes": ["QUOTES_READ", "ORDERS_READ"],
        "x-required-scopes-all": ["REPORTS_READ"],
        "x-stability": "stable"
      }
    },
    "/reports/warranty": {
      "get": {
        "description": "Analytics › Warranty: claims reported and resolved in the period, the claims open now by status and age, the median days to resolve, what claims cost and what vendors credited back (with View costs), the products claimed on most, claims by vendor, how many lines sold a plan and its revenue, and the cover ending in the next 90 days. Only claims and orders the caller reaches; `location` narrows to one store. Needs View Home and Analytics totals and View warranty claims (a key: Read reports, and Read or Work warranty claims). API keys need **Read warranty claims** or **Work warranty claims**, and **Read reports**. Phones see only what their staff member’s role reaches.",
        "operationId": "reports_warranty",
        "parameters": [
          {
            "description": "The period in the store’s days: the last 7, 30 or 90 days up to today (`30d` when left out), or `custom` with `from` and `to`. Another value is `400 INVALID_RANGE`.",
            "in": "query",
            "name": "range",
            "required": false,
            "schema": {
              "enum": ["7d", "30d", "90d", "custom"],
              "type": "string"
            }
          },
          {
            "description": "With `range=custom`: the first day, YYYY-MM-DD, in the store’s time zone.",
            "in": "query",
            "name": "from",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "With `range=custom`: the last day, YYYY-MM-DD, included. A custom period covers at most 366 days (`400 INVALID_RANGE`).",
            "in": "query",
            "name": "to",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "One store: an `id` from `GET /locations`. Left out: every store the caller reaches (a key limited to locations reaches only its own). A store outside the caller’s reach is `403 ACCESS_DENIED`.",
            "in": "query",
            "name": "location",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WarrantyReport"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get the warranty report",
        "x-rate-weight": 1,
        "x-required-permission": {
          "id": "REPORTS_ANALYTICS",
          "label": "View Home and Analytics totals"
        },
        "x-required-scopes": ["WARRANTY_READ", "WARRANTY_WRITE"],
        "x-required-scopes-all": ["REPORTS_READ"],
        "x-stability": "stable"
      }
    },
    "/roles": {
      "get": {
        "description": "The store’s roles, as Staff and roles’ Roles tab lists them: each with its permissions, which records it reaches, where it opens OrderPilot, its discount limit and who has it, and what people without a role get. An API key needs Manage staff. API keys need **Manage staff**.",
        "operationId": "roles",
        "parameters": [],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RoleList"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "List roles",
        "x-rate-weight": 1,
        "x-required-scopes": ["STAFF_MANAGE"],
        "x-stability": "stable"
      },
      "post": {
        "description": "Add a role, as the Roles tab’s Create role: a name no other role has, its permissions (ids from `GET /roles` or `GET /me`, lowercase), which records it reaches and where it opens OrderPilot. Nobody makes a role wider than their own access (an API key: than its own scopes). Needs Manage roles (a key: Manage staff). API keys need **Manage staff**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "role_create",
        "parameters": [
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RoleCreate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Role"
                }
              }
            },
            "description": "Created"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Create a role",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "ACCESS_ROLES",
          "label": "Create and edit roles"
        },
        "x-required-scopes": ["STAFF_MANAGE"],
        "x-stability": "stable"
      }
    },
    "/roles/{id}": {
      "delete": {
        "description": "Delete a role, as the role editor’s Delete role: refused (`422 REFUSED`) while anyone has it, someone is pre-assigned it or people without a role get it; move them to another role first. Needs Manage roles (a key: Manage staff). API keys need **Manage staff**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "role_delete",
        "parameters": [
          {
            "description": "The role’s `id` from `GET /roles`.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RoleDeleted"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Delete a role",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "ACCESS_ROLES",
          "label": "Create and edit roles"
        },
        "x-required-scopes": ["STAFF_MANAGE"],
        "x-stability": "stable"
      },
      "patch": {
        "description": "Change a role, as the role editor’s Save; only the fields sent change, and `permissions` replaces the whole list. It changes everyone who has the role, so it is refused when the role, or someone who has it, reaches beyond the caller’s own access. The Store administrator always holds every permission. Needs Manage roles (a key: Manage staff). API keys need **Manage staff**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "role_edit",
        "parameters": [
          {
            "description": "The role’s `id` from `GET /roles`.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RoleEdit"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Role"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Change a role",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "ACCESS_ROLES",
          "label": "Create and edit roles"
        },
        "x-required-scopes": ["STAFF_MANAGE"],
        "x-stability": "stable"
      }
    },
    "/sales-credit": {
      "get": {
        "description": "The commission report for a period: a page of rows (`items`) by salesperson, order, product or category, and the totals per currency. Someone with “View own commission” sees their own; “View all commission and profit” sees everyone’s. An API key with See commission sees everyone’s, with profit. API keys need **See commission**.",
        "operationId": "sales_credit",
        "parameters": [
          {
            "description": "7d, 30d (default), 90d or custom.",
            "in": "query",
            "name": "range",
            "required": false,
            "schema": {
              "type": "string",
              "x-values": ["7d", "30d", "90d", "custom"]
            }
          },
          {
            "description": "With range=custom: the first day, YYYY-MM-DD (the store’s time zone).",
            "in": "query",
            "name": "from",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "With range=custom: the last day, YYYY-MM-DD, inclusive.",
            "in": "query",
            "name": "to",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Only this store location: its Shopify location id (an `id` from `GET /locations`).",
            "in": "query",
            "name": "location",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Only this currency (a store selling in several has a row per currency).",
            "in": "query",
            "name": "cur",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "salesperson (default), order, product or category.",
            "in": "query",
            "name": "by",
            "required": false,
            "schema": {
              "type": "string",
              "x-values": ["salesperson", "order", "product", "category"]
            }
          },
          {
            "description": "Search the rows (up to 100 characters).",
            "in": "query",
            "name": "q",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "earned (default), credited, name or newest.",
            "in": "query",
            "name": "sort",
            "required": false,
            "schema": {
              "type": "string",
              "x-values": ["earned", "credited", "name", "newest"]
            }
          },
          {
            "description": "The `next_cursor` of the previous page.",
            "in": "query",
            "name": "cursor",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Page number, from 1: an alternative to `cursor` (the cursor wins when both are sent).",
            "in": "query",
            "name": "page",
            "required": false,
            "schema": {
              "type": "integer"
            }
          },
          {
            "description": "Rows per page, clamped to the largest the report allows.",
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SalesCreditReport"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "See sales credit",
        "x-rate-weight": 1,
        "x-required-scopes": ["COMMISSION_READ"],
        "x-stability": "stable"
      }
    },
    "/sales-credit/code-assignments": {
      "post": {
        "description": "Put a commission code on a template, a category or a vendor, or take it off (`code_id` null). Answers with the store’s codes (`items`) as `GET /sales-credit/codes` does, with how many things use each. Needs Manage catalog for a template or category, Purchasing and vendors for a vendor. API keys need **Change the catalog** or **Manage purchase orders**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice.",
        "operationId": "sales_credit_code_assign",
        "parameters": [
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SalesCreditCodeAssign"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SalesCreditCodes"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Assign a commission code",
        "x-rate-weight": 5,
        "x-required-scopes": ["CATALOG_WRITE", "PURCHASING_WRITE"],
        "x-stability": "stable"
      }
    },
    "/sales-credit/codes": {
      "get": {
        "description": "The store’s commission codes. Rates show only to those who may see them. API keys need **See commission** or **Change sales credit** or **Change settings** or **Change the catalog** or **Manage purchase orders**.",
        "operationId": "sales_credit_codes",
        "parameters": [],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SalesCreditCodes"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "List commission codes",
        "x-rate-weight": 1,
        "x-required-scopes": [
          "COMMISSION_READ",
          "COMMISSION_WRITE",
          "SETTINGS_WRITE",
          "CATALOG_WRITE",
          "PURCHASING_WRITE"
        ],
        "x-stability": "stable"
      },
      "post": {
        "description": "Add, change and delete commission codes in one batch, as Settings › Commissions’ Save (`changes`: up to 100 of each `op`). A changed rate re-prices earned commission on a store that recalculates. Answers with the store’s codes (`items`) as `GET /sales-credit/codes` does, with how many things use each. Needs the order-defaults settings right. API keys need **Change settings**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "sales_credit_codes_save",
        "parameters": [
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SalesCreditCodesBatch"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SalesCreditCodes"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Save commission codes",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "SETTINGS_ORDERS",
          "label": "Manage order and quote settings"
        },
        "x-required-scopes": ["SETTINGS_WRITE"],
        "x-stability": "stable"
      }
    },
    "/sales-credit/lines": {
      "get": {
        "description": "The lines one staff member was credited on one order in the period, with their share, rate and commission. API keys need **See commission**.",
        "operationId": "sales_credit_lines",
        "parameters": [
          {
            "description": "7d, 30d (default), 90d or custom.",
            "in": "query",
            "name": "range",
            "required": false,
            "schema": {
              "type": "string",
              "x-values": ["7d", "30d", "90d", "custom"]
            }
          },
          {
            "description": "With range=custom: the first day, YYYY-MM-DD (the store’s time zone).",
            "in": "query",
            "name": "from",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "With range=custom: the last day, YYYY-MM-DD, inclusive.",
            "in": "query",
            "name": "to",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Only this store location: its Shopify location id (an `id` from `GET /locations`).",
            "in": "query",
            "name": "location",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Only this currency (a store selling in several has a row per currency).",
            "in": "query",
            "name": "cur",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "The salesperson’s staff id.",
            "in": "query",
            "name": "staff_id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "The order’s id.",
            "in": "query",
            "name": "order_id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SalesCreditLines"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "List credited lines",
        "x-rate-weight": 1,
        "x-required-scopes": ["COMMISSION_READ"],
        "x-stability": "stable"
      }
    },
    "/sales-credit/orders": {
      "get": {
        "description": "The orders one report row earned or had refunded in the period (for a salesperson: the orders they were credited on), newest first. API keys need **See commission**.",
        "operationId": "sales_credit_orders",
        "parameters": [
          {
            "description": "7d, 30d (default), 90d or custom.",
            "in": "query",
            "name": "range",
            "required": false,
            "schema": {
              "type": "string",
              "x-values": ["7d", "30d", "90d", "custom"]
            }
          },
          {
            "description": "With range=custom: the first day, YYYY-MM-DD (the store’s time zone).",
            "in": "query",
            "name": "from",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "With range=custom: the last day, YYYY-MM-DD, inclusive.",
            "in": "query",
            "name": "to",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Only this store location: its Shopify location id (an `id` from `GET /locations`).",
            "in": "query",
            "name": "location",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Only this currency (a store selling in several has a row per currency).",
            "in": "query",
            "name": "cur",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "salesperson (default), order, product or category.",
            "in": "query",
            "name": "by",
            "required": false,
            "schema": {
              "type": "string",
              "x-values": ["salesperson", "order", "product", "category"]
            }
          },
          {
            "description": "The row’s `key` from `GET /sales-credit` (a staff id for salesperson); `__all` for everyone.",
            "in": "query",
            "name": "key",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "The `next_cursor` of the previous page.",
            "in": "query",
            "name": "cursor",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Page number, from 1: an alternative to `cursor` (the cursor wins when both are sent).",
            "in": "query",
            "name": "page",
            "required": false,
            "schema": {
              "type": "integer"
            }
          },
          {
            "description": "Rows per page, clamped to the largest the report allows.",
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SalesCreditOrders"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "List credited orders",
        "x-rate-weight": 1,
        "x-required-scopes": ["COMMISSION_READ"],
        "x-stability": "stable"
      }
    },
    "/sales-credit/staff-rates": {
      "get": {
        "description": "Staff commission rates as Settings › Commissions › Staff rates lists them: 25 a page (`items`), with why a rate can’t be changed by this person. Everyone’s with View all commission and profit or Assign roles and locations, otherwise only the caller’s own (View own commission). API keys need **See commission** or **Manage staff**.",
        "operationId": "sales_credit_staff_rates",
        "parameters": [
          {
            "description": "Search by name, email or role.",
            "in": "query",
            "name": "q",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "1: only people with no rate.",
            "in": "query",
            "name": "no_rate",
            "required": false,
            "schema": {
              "type": "integer"
            }
          },
          {
            "description": "The `next_cursor` of the previous page.",
            "in": "query",
            "name": "cursor",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Page number, from 1: an alternative to `cursor` (the cursor wins when both are sent).",
            "in": "query",
            "name": "page",
            "required": false,
            "schema": {
              "type": "integer"
            }
          },
          {
            "description": "Rows per page, 1–50 (default 25). `page_size` is accepted as the same thing.",
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 25,
              "maximum": 50,
              "minimum": 1,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StaffRatesPage"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "List staff rates",
        "x-rate-weight": 1,
        "x-required-scopes": ["COMMISSION_READ", "STAFF_MANAGE"],
        "x-stability": "stable"
      },
      "post": {
        "description": "Set commission rates for up to 100 people at once, as the Staff rates Save: a percentage from 0 to 100, or null for no rate. One refusal refuses the whole save. Needs Assign roles and locations, and the app’s delegation rules (nobody sets their own rate; only the owner sets the owner’s). API keys need **Manage staff**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "sales_credit_staff_rates_save",
        "parameters": [
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/StaffRatesSave"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StaffRatesSaved"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Save staff rates",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "ACCESS_ASSIGN",
          "label": "Assign roles and locations"
        },
        "x-required-scopes": ["STAFF_MANAGE"],
        "x-stability": "stable"
      }
    },
    "/search": {
      "get": {
        "description": "One search over the store: customers, quotes, orders, product templates, Shopify products, vendors, purchase orders, records still in imports, locations, warehouses, categories, options and their values, statuses, staff and warranty claims. The closest match first; each result says which fields matched (`matched_on`) and is the record as its own list gives it. A kind the caller may not read is left out; one that couldn’t be searched just now is in `not_searched`. When nothing is found the words are corrected against the store’s own and the search runs again: `correction` says so. API keys need **Read quotes** or **Read orders** or **Read customers** or **Read the catalog** or **Read purchase orders** or **Read warranty claims** or **Create and change quotes** or **Change orders** or **Create and change customers** or **Change the catalog** or **Manage purchase orders** or **Work warranty claims** or **Change settings**.",
        "operationId": "search",
        "parameters": [
          {
            "description": "What to find: 2–100 characters, every word must match.",
            "in": "query",
            "name": "q",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "The most results of each kind, 1–10 (default 5).",
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 5,
              "maximum": 10,
              "minimum": 1,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SearchResults"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Search the store",
        "x-rate-weight": 1,
        "x-required-scopes": [
          "QUOTES_READ",
          "ORDERS_READ",
          "CUSTOMERS_READ",
          "CATALOG_READ",
          "PURCHASING_READ",
          "WARRANTY_READ",
          "QUOTES_WRITE",
          "ORDERS_WRITE",
          "CUSTOMERS_WRITE",
          "CATALOG_WRITE",
          "PURCHASING_WRITE",
          "WARRANTY_WRITE",
          "SETTINGS_WRITE"
        ],
        "x-stability": "stable"
      }
    },
    "/settings/approval": {
      "get": {
        "description": "The review settings (Settings › Quotes and orders › Defaults › Before an order is placed), as saved. API keys need **Read settings** or **Change settings**.",
        "operationId": "settings_approval",
        "parameters": [],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SettingsApproval"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "See the review settings",
        "x-rate-weight": 1,
        "x-required-scopes": ["SETTINGS_READ", "SETTINGS_WRITE"],
        "x-stability": "stable"
      },
      "patch": {
        "description": "Change the review settings (Settings › Quotes and orders › Defaults › Before an order is placed), as its Save does: send only the fields to change. Each changed field needs the admin’s permission for it, and the change is listed in Settings › Change history as the key. API keys need **Change settings**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "settings_approval_update",
        "parameters": [
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SettingsApprovalUpdate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SettingsApproval"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Change the review settings",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "SETTINGS_ORDERS",
          "label": "Manage order and quote settings"
        },
        "x-required-scopes": ["SETTINGS_WRITE"],
        "x-stability": "stable"
      }
    },
    "/settings/brand-grouping": {
      "get": {
        "description": "The brand grouping (Settings › Business and locations › Locations › Brand grouping), as saved. API keys need **Read settings** or **Change settings**.",
        "operationId": "settings_brand_grouping",
        "parameters": [],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SettingsBrandGrouping"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "See the brand grouping",
        "x-rate-weight": 1,
        "x-required-scopes": ["SETTINGS_READ", "SETTINGS_WRITE"],
        "x-stability": "stable"
      },
      "patch": {
        "description": "Change the brand grouping (Settings › Business and locations › Locations › Brand grouping), as its Save does: send only the fields to change. Each changed field needs the admin’s permission for it, and the change is listed in Settings › Change history as the key. API keys need **Change settings**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "settings_brand_grouping_update",
        "parameters": [
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SettingsBrandGroupingUpdate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SettingsBrandGrouping"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Change the brand grouping",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "SETTINGS_SHOP",
          "label": "Manage shop settings"
        },
        "x-required-scopes": ["SETTINGS_WRITE"],
        "x-stability": "stable"
      }
    },
    "/settings/branding": {
      "get": {
        "description": "The brand kit (Settings › Branding › Brand), as saved. API keys need **Read settings** or **Change settings**.",
        "operationId": "settings_branding",
        "parameters": [],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SettingsBranding"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "See the brand kit",
        "x-rate-weight": 1,
        "x-required-scopes": ["SETTINGS_READ", "SETTINGS_WRITE"],
        "x-stability": "stable"
      },
      "patch": {
        "description": "Change the brand kit (Settings › Branding › Brand), as its Save does: send only the fields to change. Each changed field needs the admin’s permission for it, and the change is listed in Settings › Change history as the key. The logos are set from a picture’s address with `POST /settings/branding/logo`; the text colour comes from the theme (`POST /settings/branding/theme-import`). API keys need **Change settings**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "settings_branding_update",
        "parameters": [
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SettingsBrandingUpdate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SettingsBranding"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Change the brand kit",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "SETTINGS_SHOP",
          "label": "Manage shop settings"
        },
        "x-required-scopes": ["SETTINGS_WRITE"],
        "x-stability": "stable"
      }
    },
    "/settings/branding/customer-pages": {
      "get": {
        "description": "The customer pages look (Settings › Branding › Customer portal, Quote request page and Request sent page › Look), as saved. API keys need **Read settings** or **Change settings**.",
        "operationId": "settings_customer_pages_look",
        "parameters": [],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SettingsCustomerPagesLook"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "See the customer pages look",
        "x-rate-weight": 1,
        "x-required-scopes": ["SETTINGS_READ", "SETTINGS_WRITE"],
        "x-stability": "stable"
      },
      "patch": {
        "description": "Change the customer pages look (Settings › Branding › Customer portal, Quote request page and Request sent page › Look), as its Save does: send only the fields to change. Each changed field needs the admin’s permission for it, and the change is listed in Settings › Change history as the key. Picking `fonts: theme` reads the live theme’s fonts once; a read that fails keeps the fonts read before. API keys need **Change settings**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "settings_customer_pages_look_update",
        "parameters": [
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SettingsCustomerPagesLookUpdate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SettingsCustomerPagesLook"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Change the customer pages look",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "SETTINGS_SHOP",
          "label": "Manage shop settings"
        },
        "x-required-scopes": ["SETTINGS_WRITE"],
        "x-stability": "stable"
      }
    },
    "/settings/branding/customer-pages/theme-fonts": {
      "post": {
        "description": "Read again: the live theme’s heading and body fonts, read now and stored for the customer pages’ `fonts: theme`. A read that only failed this time keeps the fonts read before and says why (`problem`). API keys need **Change settings**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "settings_customer_pages_theme_fonts",
        "parameters": [
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Empty"
              }
            }
          },
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SettingsCustomerPagesThemeFonts"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Read the theme fonts again",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "SETTINGS_SHOP",
          "label": "Manage shop settings"
        },
        "x-required-scopes": ["SETTINGS_WRITE"],
        "x-stability": "stable"
      }
    },
    "/settings/branding/logo": {
      "post": {
        "description": "Set the store logo or the square logo (Settings › Branding › Brand) from the picture at an address: it is fetched (a JPEG, PNG, WebP or GIF up to 5 MB), uploaded to Shopify Files and saved, and the upload it replaces is deleted. `url` null removes the logo. Answers the brand kit. API keys need **Change settings**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "settings_branding_logo",
        "parameters": [
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SettingsBrandingLogo"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SettingsBranding"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Set a logo from a URL",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "SETTINGS_SHOP",
          "label": "Manage shop settings"
        },
        "x-required-scopes": ["SETTINGS_WRITE"],
        "x-stability": "stable"
      }
    },
    "/settings/branding/portal": {
      "get": {
        "description": "The customer portal page (Settings › Branding › Customer portal), as saved. API keys need **Read settings** or **Change settings**.",
        "operationId": "settings_portal_page",
        "parameters": [],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SettingsPortalPage"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "See the customer portal page",
        "x-rate-weight": 1,
        "x-required-scopes": ["SETTINGS_READ", "SETTINGS_WRITE"],
        "x-stability": "stable"
      },
      "patch": {
        "description": "Change the customer portal page (Settings › Branding › Customer portal), as its Save does: send only the fields to change. Each changed field needs the admin’s permission for it, and the change is listed in Settings › Change history as the key. API keys need **Change settings**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "settings_portal_page_update",
        "parameters": [
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SettingsPortalPageUpdate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SettingsPortalPage"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Change the customer portal page",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "SETTINGS_SHOP",
          "label": "Manage shop settings"
        },
        "x-required-scopes": ["SETTINGS_WRITE"],
        "x-stability": "stable"
      }
    },
    "/settings/branding/product-page": {
      "get": {
        "description": "The product page pop-up (Settings › Branding › Product page and pop-up), as saved. API keys need **Read settings** or **Change settings**.",
        "operationId": "settings_product_page",
        "parameters": [],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SettingsProductPage"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "See the product page pop-up",
        "x-rate-weight": 1,
        "x-required-scopes": ["SETTINGS_READ", "SETTINGS_WRITE"],
        "x-stability": "stable"
      },
      "patch": {
        "description": "Change the product page pop-up (Settings › Branding › Product page and pop-up), as its Save does: send only the fields to change. Each changed field needs the admin’s permission for it, and the change is listed in Settings › Change history as the key. API keys need **Change settings**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "settings_product_page_update",
        "parameters": [
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SettingsProductPageUpdate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SettingsProductPage"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Change the product page pop-up",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "SETTINGS_ORDERS",
          "label": "Manage order and quote settings"
        },
        "x-required-scopes": ["SETTINGS_WRITE"],
        "x-stability": "stable"
      }
    },
    "/settings/branding/receipt": {
      "get": {
        "description": "The POS receipt (Settings › Branding › POS receipt), as saved. API keys need **Read settings** or **Change settings**.",
        "operationId": "settings_receipt",
        "parameters": [],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SettingsReceipt"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "See the POS receipt",
        "x-rate-weight": 1,
        "x-required-scopes": ["SETTINGS_READ", "SETTINGS_WRITE"],
        "x-stability": "stable"
      },
      "patch": {
        "description": "Change the POS receipt (Settings › Branding › POS receipt), as its Save does: send only the fields to change. Each changed field needs the admin’s permission for it, and the change is listed in Settings › Change history as the key. A location’s own receipt terms win over `receipt_text`. API keys need **Change settings**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "settings_receipt_update",
        "parameters": [
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SettingsReceiptUpdate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SettingsReceipt"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Change the POS receipt",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "SETTINGS_SHOP",
          "label": "Manage shop settings"
        },
        "x-required-scopes": ["SETTINGS_WRITE"],
        "x-stability": "stable"
      }
    },
    "/settings/branding/request-page": {
      "get": {
        "description": "The quote request page (Settings › Branding › Quote request page), as saved. API keys need **Read settings** or **Change settings**.",
        "operationId": "settings_request_page",
        "parameters": [],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SettingsRequestPage"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "See the quote request page",
        "x-rate-weight": 1,
        "x-required-scopes": ["SETTINGS_READ", "SETTINGS_WRITE"],
        "x-stability": "stable"
      },
      "patch": {
        "description": "Change the quote request page (Settings › Branding › Quote request page), as its Save does: send only the fields to change. Each changed field needs the admin’s permission for it, and the change is listed in Settings › Change history as the key. API keys need **Change settings**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "settings_request_page_update",
        "parameters": [
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SettingsRequestPageUpdate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SettingsRequestPage"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Change the quote request page",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "SETTINGS_SHOP",
          "label": "Manage shop settings"
        },
        "x-required-scopes": ["SETTINGS_WRITE"],
        "x-stability": "stable"
      }
    },
    "/settings/branding/sent-page": {
      "get": {
        "description": "The Request sent page (Settings › Branding › Request sent page), as saved. API keys need **Read settings** or **Change settings**.",
        "operationId": "settings_sent_page",
        "parameters": [],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SettingsSentPage"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "See the Request sent page",
        "x-rate-weight": 1,
        "x-required-scopes": ["SETTINGS_READ", "SETTINGS_WRITE"],
        "x-stability": "stable"
      },
      "patch": {
        "description": "Change the Request sent page (Settings › Branding › Request sent page), as its Save does: send only the fields to change. Each changed field needs the admin’s permission for it, and the change is listed in Settings › Change history as the key. API keys need **Change settings**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "settings_sent_page_update",
        "parameters": [
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SettingsSentPageUpdate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SettingsSentPage"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Change the Request sent page",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "SETTINGS_SHOP",
          "label": "Manage shop settings"
        },
        "x-required-scopes": ["SETTINGS_WRITE"],
        "x-stability": "stable"
      }
    },
    "/settings/branding/signing-page": {
      "get": {
        "description": "The signing page (Settings › Branding › Signing page), as saved. API keys need **Read settings** or **Change settings**.",
        "operationId": "settings_signing_page",
        "parameters": [],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SettingsSigningPage"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "See the signing page",
        "x-rate-weight": 1,
        "x-required-scopes": ["SETTINGS_READ", "SETTINGS_WRITE"],
        "x-stability": "stable"
      },
      "patch": {
        "description": "Change the signing page (Settings › Branding › Signing page), as its Save does: send only the fields to change. Each changed field needs the admin’s permission for it, and the change is listed in Settings › Change history as the key. API keys need **Change settings**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "settings_signing_page_update",
        "parameters": [
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SettingsSigningPageUpdate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SettingsSigningPage"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Change the signing page",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "SETTINGS_SHOP",
          "label": "Manage shop settings"
        },
        "x-required-scopes": ["SETTINGS_WRITE"],
        "x-stability": "stable"
      }
    },
    "/settings/branding/theme-import": {
      "get": {
        "description": "Update from theme’s review: the live theme read now (its colours, fonts, logo and store name, as the brand kit would take them) and each brand kit or page look field that differs from what is saved. Saves nothing. `503 SHOPIFY_UNAVAILABLE` when the theme can’t be read. API keys need **Change settings**. Phones see only what their staff member’s role reaches.",
        "operationId": "settings_branding_theme_import",
        "parameters": [],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SettingsBrandingThemeImport"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Preview the brand kit from the theme",
        "x-rate-weight": 1,
        "x-required-permission": {
          "id": "SETTINGS_SHOP",
          "label": "Manage shop settings"
        },
        "x-required-scopes": ["SETTINGS_WRITE"],
        "x-stability": "stable"
      },
      "post": {
        "description": "Update from theme: read the live theme again and save its values for the brand kit `kit_fields` named (all that differ when left out), recorded as the last theme import, as Use these then Save do. The text colour is set only this way. The page look fields (background, fonts, corners, buttons) are `PATCH /settings/branding/customer-pages`’s. API keys need **Change settings**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "settings_branding_theme_import_apply",
        "parameters": [
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SettingsBrandingThemeImportApply"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SettingsBrandingThemeImportApplied"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Update the brand kit from the theme",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "SETTINGS_SHOP",
          "label": "Manage shop settings"
        },
        "x-required-scopes": ["SETTINGS_WRITE"],
        "x-stability": "stable"
      }
    },
    "/settings/business-details": {
      "get": {
        "description": "The business details (Settings › Business and locations › Business details), as saved. API keys need **Read settings** or **Change settings**.",
        "operationId": "settings_business_details",
        "parameters": [],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SettingsBusinessDetails"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "See the business details",
        "x-rate-weight": 1,
        "x-required-scopes": ["SETTINGS_READ", "SETTINGS_WRITE"],
        "x-stability": "stable"
      },
      "patch": {
        "description": "Change the business details (Settings › Business and locations › Business details), as its Save does: send only the fields to change. Each changed field needs the admin’s permission for it, and the change is listed in Settings › Change history as the key. API keys need **Change settings**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "settings_business_details_update",
        "parameters": [
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SettingsBusinessDetailsUpdate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SettingsBusinessDetails"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Change the business details",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "SETTINGS_SHOP",
          "label": "Manage shop settings"
        },
        "x-required-scopes": ["SETTINGS_WRITE"],
        "x-stability": "stable"
      }
    },
    "/settings/commissions/earning": {
      "get": {
        "description": "The commission earning rules (Settings › Purchasing and accounting › Commissions › Earning), as saved. API keys need **Read settings** or **Change settings**.",
        "operationId": "settings_commission_earning",
        "parameters": [],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SettingsCommissionEarning"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "See the commission earning rules",
        "x-rate-weight": 1,
        "x-required-scopes": ["SETTINGS_READ", "SETTINGS_WRITE"],
        "x-stability": "stable"
      },
      "patch": {
        "description": "Change the commission earning rules (Settings › Purchasing and accounting › Commissions › Earning), as its Save does: send only the fields to change. Each changed field needs the admin’s permission for it, and the change is listed in Settings › Change history as the key. A new `earned_when` applies from now: orders it makes earned earn today, never in a closed period. API keys need **Change settings**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "settings_commission_earning_update",
        "parameters": [
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SettingsCommissionEarningUpdate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SettingsCommissionEarning"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Change the commission earning rules",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "SETTINGS_ORDERS",
          "label": "Manage order and quote settings"
        },
        "x-required-scopes": ["SETTINGS_WRITE"],
        "x-stability": "stable"
      }
    },
    "/settings/commissions/sales-credit": {
      "get": {
        "description": "The sales credit rules (Settings › Purchasing and accounting › Commissions › Sales credit), as saved. API keys need **Read settings** or **Change settings**.",
        "operationId": "settings_commission_credit",
        "parameters": [],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SettingsCommissionCredit"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "See the sales credit rules",
        "x-rate-weight": 1,
        "x-required-scopes": ["SETTINGS_READ", "SETTINGS_WRITE"],
        "x-stability": "stable"
      },
      "patch": {
        "description": "Change the sales credit rules (Settings › Purchasing and accounting › Commissions › Sales credit), as its Save does: send only the fields to change. Each changed field needs the admin’s permission for it, and the change is listed in Settings › Change history as the key. API keys need **Change settings**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "settings_commission_credit_update",
        "parameters": [
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SettingsCommissionCreditUpdate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SettingsCommissionCredit"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Change the sales credit rules",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "SETTINGS_ORDERS",
          "label": "Manage order and quote settings"
        },
        "x-required-scopes": ["SETTINGS_WRITE"],
        "x-stability": "stable"
      }
    },
    "/settings/costing": {
      "get": {
        "description": "The costing settings (Settings › Purchasing and accounting › Purchase orders and costing › Costing), as saved. API keys need **Read settings** or **Change settings**.",
        "operationId": "settings_costing",
        "parameters": [],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SettingsCosting"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "See the costing settings",
        "x-rate-weight": 1,
        "x-required-scopes": ["SETTINGS_READ", "SETTINGS_WRITE"],
        "x-stability": "stable"
      },
      "patch": {
        "description": "Change the costing settings (Settings › Purchasing and accounting › Purchase orders and costing › Costing), as its Save does: send only the fields to change. Each changed field needs the admin’s permission for it, and the change is listed in Settings › Change history as the key. API keys need **Change settings**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "settings_costing_update",
        "parameters": [
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SettingsCostingUpdate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SettingsCosting"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Change the costing settings",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "SETTINGS_PURCHASING",
          "label": "Manage purchasing settings"
        },
        "x-required-scopes": ["SETTINGS_WRITE"],
        "x-stability": "stable"
      }
    },
    "/settings/customer-fields": {
      "get": {
        "description": "Settings › Customers › Customer fields: every customer field the store has in Shopify, in the profile’s order, with its type, choices, profile section, how it shows on quotes and orders, and which one is the header tag (shown as tags beside a customer’s name). `502 SHOPIFY_UNAVAILABLE` when Shopify can’t be read. Open to every staff member, as the page is (a key: Read or Change settings, or Read or Create and change customers). API keys need **Read settings** or **Change settings** or **Read customers** or **Create and change customers**.",
        "operationId": "settings_customer_fields",
        "parameters": [],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CustomerFieldSettings"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "List customer fields",
        "x-rate-weight": 1,
        "x-required-scopes": [
          "SETTINGS_READ",
          "SETTINGS_WRITE",
          "CUSTOMERS_READ",
          "CUSTOMERS_WRITE"
        ],
        "x-stability": "stable"
      },
      "post": {
        "description": "Add a customer field, as Customer fields’ Add field does: a Shopify customer metafield definition (namespace `custom`, the key made from the name), then where it shows. Every customer form asks it from then on. Answers 201 with the list and the new field’s `saved_key`. `400 INVALID_BODY` (a choice list without choices, a header tag that isn’t a choice list), `422 FIELD_REFUSED` (Shopify’s refusal, such as a key already used), `502 FIELD_NOT_PLACED` (Shopify made the field but its place wasn’t saved: set it with `PATCH /settings/customer-fields/{key}`). Recorded in Settings › Change history. Needs Manage shop settings (a key: Change settings). API keys need **Change settings**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "settings_customer_field_create",
        "parameters": [
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CustomerFieldCreate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CustomerFieldSettings"
                }
              }
            },
            "description": "Created"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Create a customer field",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "SETTINGS_SHOP",
          "label": "Manage shop settings"
        },
        "x-required-scopes": ["SETTINGS_WRITE"],
        "x-stability": "stable"
      }
    },
    "/settings/customer-fields/reorder": {
      "post": {
        "description": "Put the customer fields in this order on the profile and the forms, as dragging them on Customer fields does (ones left out keep their order after them). Recorded in Settings › Change history. Needs Manage shop settings (a key: Change settings). API keys need **Change settings**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "settings_customer_fields_reorder",
        "parameters": [
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CustomerFieldOrder"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CustomerFieldSettings"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Reorder customer fields",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "SETTINGS_SHOP",
          "label": "Manage shop settings"
        },
        "x-required-scopes": ["SETTINGS_WRITE"],
        "x-stability": "stable"
      }
    },
    "/settings/customer-fields/standard": {
      "post": {
        "description": "Add OrderPilot’s standard customer fields the store doesn’t have yet, as Customer fields’ Add standard fields does; `added` names them (empty when it had them all). Recorded in Settings › Change history. Needs Manage shop settings (a key: Change settings). API keys need **Change settings**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "settings_customer_fields_standard",
        "parameters": [
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Empty"
              }
            }
          },
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CustomerFieldSettings"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Add the standard customer fields",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "SETTINGS_SHOP",
          "label": "Manage shop settings"
        },
        "x-required-scopes": ["SETTINGS_WRITE"],
        "x-stability": "stable"
      }
    },
    "/settings/customer-fields/{key}": {
      "delete": {
        "description": "Delete a customer field, as its Delete does: its Shopify definition goes, so no customer form asks it any more; the values already on customers stay in Shopify. `404` (no such field), `422 FIELD_REFUSED` (Shopify’s refusal). Recorded in Settings › Change history. Needs Manage shop settings (a key: Change settings). API keys need **Change settings**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "settings_customer_field_delete",
        "parameters": [
          {
            "description": "The field’s `key` (`namespace.key`, such as `custom.trade_type`) from `GET /settings/customer-fields`.",
            "in": "path",
            "name": "key",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CustomerFieldSettings"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Delete a customer field",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "SETTINGS_SHOP",
          "label": "Manage shop settings"
        },
        "x-required-scopes": ["SETTINGS_WRITE"],
        "x-stability": "stable"
      },
      "patch": {
        "description": "Change a customer field, as its Edit field does: its name, description and choices in Shopify (its type can’t change), its profile section, how it shows on quotes and orders, and whether it is the header tag (`header_tag: false` on the header field leaves none). What isn’t sent stays as it is. `400 INVALID_BODY` (choices on a field that isn’t a choice list, a header tag that isn’t one), `404` (no such field), `422 FIELD_REFUSED` (Shopify’s refusal). Recorded in Settings › Change history. Needs Manage shop settings (a key: Change settings). API keys need **Change settings**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "settings_customer_field_update",
        "parameters": [
          {
            "description": "The field’s `key` (`namespace.key`, such as `custom.trade_type`) from `GET /settings/customer-fields`.",
            "in": "path",
            "name": "key",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CustomerFieldUpdate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CustomerFieldSettings"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Change a customer field",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "SETTINGS_SHOP",
          "label": "Manage shop settings"
        },
        "x-required-scopes": ["SETTINGS_WRITE"],
        "x-stability": "stable"
      }
    },
    "/settings/customers-page": {
      "get": {
        "description": "The Customers page switch (Settings › Customers › Customers page), as saved. API keys need **Read settings** or **Change settings**.",
        "operationId": "settings_customers_page",
        "parameters": [],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SettingsCustomersPage"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "See the Customers page switch",
        "x-rate-weight": 1,
        "x-required-scopes": ["SETTINGS_READ", "SETTINGS_WRITE"],
        "x-stability": "stable"
      },
      "patch": {
        "description": "Change the Customers page switch (Settings › Customers › Customers page), as its Save does: send only the fields to change. Each changed field needs the admin’s permission for it, and the change is listed in Settings › Change history as the key. API keys need **Change settings**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "settings_customers_page_update",
        "parameters": [
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SettingsCustomersPageUpdate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SettingsCustomersPage"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Change the Customers page switch",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "SETTINGS_SHOP",
          "label": "Manage shop settings"
        },
        "x-required-scopes": ["SETTINGS_WRITE"],
        "x-stability": "stable"
      }
    },
    "/settings/default-recipients": {
      "get": {
        "description": "Settings › Messages › Recipients: the CC and BCC customer order emails and purchase order emails start with, for the whole shop, a brand or a location. API keys need **Read settings** or **Change settings**.",
        "operationId": "settings_default_recipients",
        "parameters": [],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DefaultRecipientList"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "List default recipients",
        "x-rate-weight": 1,
        "x-required-scopes": ["SETTINGS_READ", "SETTINGS_WRITE"],
        "x-stability": "stable"
      },
      "post": {
        "description": "Set one scope’s CC and BCC (the whole shop, a brand or a location), as the Recipients card saves it. Both empty deletes the rule; a brand or location rule turns its switch on. An address in both boxes, an invalid one or more than the send path takes is `400 INVALID_BODY`. API keys need **Change settings**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "settings_default_recipients_save",
        "parameters": [
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DefaultRecipientSave"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DefaultRecipientList"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Set default recipients",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "SETTINGS_SHOP",
          "label": "Manage shop settings"
        },
        "x-required-scopes": ["SETTINGS_WRITE"],
        "x-stability": "stable"
      }
    },
    "/settings/delivery-and-stock": {
      "get": {
        "description": "The delivery and stock settings (Settings › Quotes and orders › Defaults › Delivery and stock), as saved. API keys need **Read settings** or **Change settings**.",
        "operationId": "settings_delivery_stock",
        "parameters": [],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SettingsDeliveryStock"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "See the delivery and stock settings",
        "x-rate-weight": 1,
        "x-required-scopes": ["SETTINGS_READ", "SETTINGS_WRITE"],
        "x-stability": "stable"
      },
      "patch": {
        "description": "Change the delivery and stock settings (Settings › Quotes and orders › Defaults › Delivery and stock), as its Save does: send only the fields to change. Each changed field needs the admin’s permission for it, and the change is listed in Settings › Change history as the key. API keys need **Change settings**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "settings_delivery_stock_update",
        "parameters": [
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SettingsDeliveryStockUpdate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SettingsDeliveryStock"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Change the delivery and stock settings",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "SETTINGS_ORDERS",
          "label": "Manage order and quote settings"
        },
        "x-required-scopes": ["SETTINGS_WRITE"],
        "x-stability": "stable"
      }
    },
    "/settings/discounts": {
      "get": {
        "description": "The discount settings (Settings › Quotes and orders › Discounts), as saved. API keys need **Read settings** or **Change settings**.",
        "operationId": "settings_discounts",
        "parameters": [],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SettingsDiscounts"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "See the discount settings",
        "x-rate-weight": 1,
        "x-required-scopes": ["SETTINGS_READ", "SETTINGS_WRITE"],
        "x-stability": "stable"
      },
      "patch": {
        "description": "Change the discount settings (Settings › Quotes and orders › Discounts), as its Save does: send only the fields to change. Each changed field needs the admin’s permission for it, and the change is listed in Settings › Change history as the key. API keys need **Change settings**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "settings_discounts_update",
        "parameters": [
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SettingsDiscountsUpdate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SettingsDiscounts"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Change the discount settings",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "SETTINGS_ORDERS",
          "label": "Manage order and quote settings"
        },
        "x-required-scopes": ["SETTINGS_WRITE"],
        "x-stability": "stable"
      }
    },
    "/settings/documents": {
      "get": {
        "description": "The PDF designs (Settings › Branding › Quote PDF › PDF themes): the built-in designs and the store’s own themes for each document (sales order, invoice, purchase order, product spec sheet, job sheet), each with its options, the fonts and blocks it takes and who prints it; the brands with the design each prints per document; the store’s own designs (a location with no brand); and the order fields a header row can print. API keys need **Read settings** or **Change settings**.",
        "operationId": "settings_documents",
        "parameters": [],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SettingsDocuments"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "List PDF designs",
        "x-rate-weight": 1,
        "x-required-scopes": ["SETTINGS_READ", "SETTINGS_WRITE"],
        "x-stability": "stable"
      },
      "post": {
        "description": "Publish a new theme from a design (a built-in one, or a theme to copy), as the theme editor’s Publish: its name and the options that differ from the source; `brand_ids` and `store_default` make it what those brands, or the store, print. Checked as the editor checks it (`422 VALIDATION` with the reason). At most 200 themes. Listed in Settings › Change history as the key. API keys need **Change settings**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "settings_document_create",
        "parameters": [
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SettingsDocumentCreate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SettingsDocuments"
                }
              }
            },
            "description": "Created"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Create a PDF theme",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "SETTINGS_SHOP",
          "label": "Manage shop settings"
        },
        "x-required-scopes": ["SETTINGS_WRITE"],
        "x-stability": "stable"
      }
    },
    "/settings/documents/assign": {
      "post": {
        "description": "Choose the design one brand prints for one document, or the store’s own (`brand_id` null: what a location with no brand prints). `design_id` null goes back to the built-in design. API keys need **Change settings**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "settings_document_assign",
        "parameters": [
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SettingsDocumentAssign"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SettingsDocuments"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Choose a brand’s PDF design",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "SETTINGS_SHOP",
          "label": "Manage shop settings"
        },
        "x-required-scopes": ["SETTINGS_WRITE"],
        "x-stability": "stable"
      }
    },
    "/settings/documents/preview": {
      "post": {
        "description": "A PDF of a design with options applied, drawn on the sample document, before you publish it: checked as Publish checks it (`422 VALIDATION`). Saves nothing. `503 BUSY` while too many documents are being made. API keys need **Change settings**. An `Idempotency-Key` header makes a retry safe: the same key and body returns the first answer.",
        "operationId": "settings_document_preview",
        "parameters": [
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SettingsDocumentPreview"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/pdf": {
                "schema": {
                  "$ref": "#/components/schemas/Pdf"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Preview a PDF design",
        "x-rate-weight": 5,
        "x-required-scopes": ["SETTINGS_WRITE"],
        "x-stability": "stable"
      }
    },
    "/settings/documents/{id}": {
      "delete": {
        "description": "Delete one of the store’s themes (`theme:<id>`). Brands and the store that printed it go back to the built-in design. A theme changed since `expected_version` is `409 STALE_VERSION`. API keys need **Change settings**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "settings_document_delete",
        "parameters": [
          {
            "description": "The design’s `id` from `GET /settings/documents` (`preset:<key>` for a built-in design, `theme:<id>` for one of the store’s themes).",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "The theme’s `version` from `GET /settings/documents`.",
            "in": "query",
            "name": "expected_version",
            "required": true,
            "schema": {
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SettingsDocuments"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Delete a PDF theme",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "SETTINGS_SHOP",
          "label": "Manage shop settings"
        },
        "x-required-scopes": ["SETTINGS_WRITE"],
        "x-stability": "stable"
      },
      "patch": {
        "description": "Publish a new version of one of the store’s themes (`theme:<id>`): only what is sent changes. Send its `version` as `expected_version`; a theme changed since is `409 STALE_VERSION`. A built-in design can’t be changed: create a theme from it. Documents print the new version from now on. API keys need **Change settings**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "settings_document_update",
        "parameters": [
          {
            "description": "The design’s `id` from `GET /settings/documents` (`preset:<key>` for a built-in design, `theme:<id>` for one of the store’s themes).",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SettingsDocumentUpdate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SettingsDocuments"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Publish a PDF theme",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "SETTINGS_SHOP",
          "label": "Manage shop settings"
        },
        "x-required-scopes": ["SETTINGS_WRITE"],
        "x-stability": "stable"
      }
    },
    "/settings/documents/{id}/brands": {
      "post": {
        "description": "Make exactly these brands print a design for its document: brands left out that printed it go back to the built-in design. `brand_ids` from `GET /brands`. API keys need **Change settings**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "settings_document_brands",
        "parameters": [
          {
            "description": "The design’s `id` from `GET /settings/documents` (`preset:<key>` for a built-in design, `theme:<id>` for one of the store’s themes).",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SettingsDocumentBrands"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SettingsDocuments"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Set the brands of a PDF design",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "SETTINGS_SHOP",
          "label": "Manage shop settings"
        },
        "x-required-scopes": ["SETTINGS_WRITE"],
        "x-stability": "stable"
      }
    },
    "/settings/email-rules": {
      "get": {
        "description": "The email and SMS rules (Settings › Messages and notifications › Sending settings › Email and SMS rules), as saved. API keys need **Read settings** or **Change settings**.",
        "operationId": "settings_email_rules",
        "parameters": [],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SettingsEmailRules"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "See the email and SMS rules",
        "x-rate-weight": 1,
        "x-required-scopes": ["SETTINGS_READ", "SETTINGS_WRITE"],
        "x-stability": "stable"
      },
      "patch": {
        "description": "Change the email and SMS rules (Settings › Messages and notifications › Sending settings › Email and SMS rules), as its Save does: send only the fields to change. Each changed field needs the admin’s permission for it, and the change is listed in Settings › Change history as the key. Turning a channel off also stops the sends already scheduled on it. `send_sms` needs Manage order and quote settings for a phone. API keys need **Change settings**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "settings_email_rules_update",
        "parameters": [
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SettingsEmailRulesUpdate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SettingsEmailRules"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Change the email and SMS rules",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "SETTINGS_SHOP",
          "label": "Manage shop settings"
        },
        "x-required-scopes": ["SETTINGS_WRITE"],
        "x-stability": "stable"
      }
    },
    "/settings/email-sending": {
      "delete": {
        "description": "Remove the store’s email setup (Remove setup): every email stops sending from its domain, and setting up again needs new DNS records, so it needs `confirm: true` (Settings asks too). SendGrid’s domain authentication and branded link are deleted only when this server made them and no other store on it sends through them. Answers the setup as it is now and the page’s sentence. Listed in Settings › Change history as the key. API keys need **Change settings**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "settings_email_sending_remove",
        "parameters": [
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmailSendingSaved"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Remove the email setup",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "SETTINGS_SHOP",
          "label": "Manage shop settings"
        },
        "x-required-scopes": ["SETTINGS_WRITE"],
        "x-stability": "stable"
      },
      "get": {
        "description": "The store’s email sending setup, as Sending settings shows it: whether setup was started (`account` is null before), the sending domain and its status with the DNS records to add, the From address and sender name, the Reply-to addresses, DMARC, branded links, Receive replies (vendor replies) and its MX record, whether sending is paused and why, and this month’s emails against the allowance. `delivery_ready` says whether customer emails can go now, `delivery_message` why not. API keys need **Read settings** or **Change settings**.",
        "operationId": "settings_email_sending",
        "parameters": [],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmailSendingSetup"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "See the email sending setup",
        "x-rate-weight": 1,
        "x-required-scopes": ["SETTINGS_READ", "SETTINGS_WRITE"],
        "x-stability": "stable"
      }
    },
    "/settings/email-sending/activity": {
      "get": {
        "description": "The store’s email Activity, as Sending settings’ Activity tab: every email sent, newest first, 25 a page, with whom it went to, its record, its template, what the recipient’s mail service reported (`display_status`: delivered, opened, clicked, bounced, …) and opens counted by OrderPilot’s own pixel; filtered by `group_id` (an email group, from `groups`), `status` and `q` (a customer, a record number, an address or words of the subject). With the email groups to filter by and the last 30 days’ engagement (store-wide). A key limited to some locations sees only the sends of records in its reach. Open one email with `GET /settings/email-sending/activity/{sendId}`. API keys need **Read settings** or **Change settings**.",
        "operationId": "settings_email_activity",
        "parameters": [
          {
            "description": "The `next_cursor` of the previous page (opaque).",
            "in": "query",
            "name": "cursor",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Page number, from 1: an alternative to `cursor`.",
            "in": "query",
            "name": "page",
            "required": false,
            "schema": {
              "type": "integer"
            }
          },
          {
            "description": "An email group’s `id`, from this list’s `groups`.",
            "in": "query",
            "name": "group_id",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Only the sends the tab labels this way.",
            "in": "query",
            "name": "status",
            "required": false,
            "schema": {
              "enum": [
                "opened",
                "clicked",
                "delivered",
                "bounced",
                "sent",
                "uncertain",
                "scheduled",
                "failed",
                "cancelled"
              ],
              "type": "string"
            }
          },
          {
            "description": "Search (up to 120 characters).",
            "in": "query",
            "name": "q",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmailActivityList"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "List the email activity",
        "x-rate-weight": 1,
        "x-required-scopes": ["SETTINGS_READ", "SETTINGS_WRITE"],
        "x-stability": "stable"
      }
    },
    "/settings/email-sending/activity/{sendId}": {
      "get": {
        "description": "One send of the Activity tab, as its dialog: the email as it went (the kept HTML, else rebuilt from the same template version: `sent.source` says which) and its text; with `compare=true` also the same email as it would go out now. The bodies show only on a record this caller may open (a quote’s or order’s with View quotes and orders, a vendor’s with View purchase orders and See costs, a warranty vendor claim’s with See costs); otherwise the send’s facts and `sent.unavailable_reason`. The customer’s links in it (sign or portal) open nothing unless this caller may hand them out itself (`POST /quotes/{id}/sign-link`’s rights). A key limited to some locations reads only its records’ sends. API keys need **Read settings** or **Change settings**.",
        "operationId": "settings_email_activity_send",
        "parameters": [
          {
            "description": "The send’s `id`, from `GET /settings/email-sending/activity`.",
            "in": "path",
            "name": "sendId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "`true` also renders the email as it would go out now.",
            "in": "query",
            "name": "compare",
            "required": false,
            "schema": {
              "enum": ["true", "1"],
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmailSendDetail"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get one sent email",
        "x-rate-weight": 1,
        "x-required-scopes": ["SETTINGS_READ", "SETTINGS_WRITE"],
        "x-stability": "stable"
      }
    },
    "/settings/email-sending/branded-links": {
      "delete": {
        "description": "Remove branded links: links in emails go back to SendGrid’s domain. Answers the setup as it is now and the page’s sentence. Listed in Settings › Change history as the key. API keys need **Change settings**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "settings_email_link_branding_remove",
        "parameters": [
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmailSendingSaved"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Remove branded links",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "SETTINGS_SHOP",
          "label": "Manage shop settings"
        },
        "x-required-scopes": ["SETTINGS_WRITE"],
        "x-stability": "stable"
      },
      "post": {
        "description": "Set up branded links (links in emails on the store’s own domain instead of SendGrid’s), as Sending setup does: answers the records to add, checked with the domain’s (`POST /settings/email-sending/domain/check`). Refused while the feature isn’t available, and for a branded link SendGrid already holds. Answers the setup as it is now and the page’s sentence. Listed in Settings › Change history as the key. API keys need **Change settings**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "settings_email_link_branding_setup",
        "parameters": [
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Empty"
              }
            }
          },
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmailSendingSaved"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Set up branded links",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "SETTINGS_SHOP",
          "label": "Manage shop settings"
        },
        "x-required-scopes": ["SETTINGS_WRITE"],
        "x-stability": "stable"
      }
    },
    "/settings/email-sending/domain": {
      "post": {
        "description": "Set the domain the store’s emails are sent from, with the sender name, the From address’s first part and the Reply-to addresses, as Sending setup does (setup is started if it wasn’t). Answers the DNS records to add at the domain provider; then `POST /settings/email-sending/domain/check`. The same domain again only saves the sender. Replacing another domain cancels the store’s pending and scheduled emails and stops email until the new records are verified, so it is refused without `replace_domain: true`. A domain SendGrid already holds (not this store’s own) is refused before anything changes: Settings can set it up. Answers the setup as it is now and the page’s sentence. Listed in Settings › Change history as the key. API keys need **Change settings**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "settings_email_sending_domain",
        "parameters": [
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EmailSendingDomain"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmailSendingSaved"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Set the sending domain",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "SETTINGS_SHOP",
          "label": "Manage shop settings"
        },
        "x-required-scopes": ["SETTINGS_WRITE"],
        "x-stability": "stable"
      }
    },
    "/settings/email-sending/domain/check": {
      "post": {
        "description": "Check the sending domain’s DNS records now (Check again), and DMARC and branded links with them. `verified` says whether the domain is verified; each record’s `valid` says which are found. New records can take up to an hour to show. Answers the setup as it is now and the page’s sentence. Listed in Settings › Change history as the key. API keys need **Change settings**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "settings_email_sending_domain_check",
        "parameters": [
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Empty"
              }
            }
          },
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmailSendingSaved"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Check the sending domain",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "SETTINGS_SHOP",
          "label": "Manage shop settings"
        },
        "x-required-scopes": ["SETTINGS_WRITE"],
        "x-stability": "stable"
      }
    },
    "/settings/email-sending/sender": {
      "patch": {
        "description": "Change the sender name customers see, and the Reply-to addresses when `reply_to_emails` is sent (an empty list clears them), as Sending setup and Replies do. Needs setup started. Answers the setup as it is now and the page’s sentence. Listed in Settings › Change history as the key. API keys need **Change settings**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "settings_email_sending_sender",
        "parameters": [
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EmailSendingSender"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmailSendingSaved"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Change the email sender",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "SETTINGS_SHOP",
          "label": "Manage shop settings"
        },
        "x-required-scopes": ["SETTINGS_WRITE"],
        "x-stability": "stable"
      }
    },
    "/settings/email-sending/start": {
      "post": {
        "description": "Start the store’s email setup (Set up email): makes its sending account, after which `POST /settings/email-sending/domain` sets the domain. Starting again changes nothing. Answers the setup as it is now and the page’s sentence. Listed in Settings › Change history as the key. API keys need **Change settings**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "settings_email_sending_start",
        "parameters": [
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Empty"
              }
            }
          },
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmailSendingSaved"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Start the email setup",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "SETTINGS_SHOP",
          "label": "Manage shop settings"
        },
        "x-required-scopes": ["SETTINGS_WRITE"],
        "x-stability": "stable"
      }
    },
    "/settings/email-sending/vendor-replies": {
      "patch": {
        "description": "Turn Receive replies on or off: vendors’ replies to purchase order emails come into the purchase order’s conversation. Turning on needs a verified domain and an MX record on `vendor_replies.hostname` (answered as `vendor_replies.record`); it is on once `vendor_replies.status` is `active`. Answers the setup as it is now and the page’s sentence. Listed in Settings › Change history as the key. API keys need **Change settings**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "settings_email_vendor_replies",
        "parameters": [
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EmailVendorReplies"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmailSendingSaved"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Turn Receive replies on or off",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "SETTINGS_SHOP",
          "label": "Manage shop settings"
        },
        "x-required-scopes": ["SETTINGS_WRITE"],
        "x-stability": "stable"
      }
    },
    "/settings/email-sending/vendor-replies/check": {
      "post": {
        "description": "Look the Receive replies MX record up now (Check record). Answers the setup as it is now and the page’s sentence. Listed in Settings › Change history as the key. API keys need **Change settings**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "settings_email_vendor_replies_check",
        "parameters": [
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Empty"
              }
            }
          },
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmailSendingSaved"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Check the Receive replies record",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "SETTINGS_SHOP",
          "label": "Manage shop settings"
        },
        "x-required-scopes": ["SETTINGS_WRITE"],
        "x-stability": "stable"
      }
    },
    "/settings/fees": {
      "get": {
        "description": "Settings › Fees: every saved fee, on or off, with the default fees that can be restored and the most a store can have. API keys need **Read settings** or **Change settings**.",
        "operationId": "settings_fees",
        "parameters": [],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SettingsFeeList"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "List saved fees",
        "x-rate-weight": 1,
        "x-required-scopes": ["SETTINGS_READ", "SETTINGS_WRITE"],
        "x-stability": "stable"
      },
      "post": {
        "description": "Add a saved fee, as Settings › Fees’ Add fee. Up to 100 (`422 CAP_REACHED`); names are unique (`409 CONFLICT`). API keys need **Change settings**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "settings_fee_create",
        "parameters": [
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SettingsFeeCreate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SettingsFee"
                }
              }
            },
            "description": "Created"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Create a saved fee",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "SETTINGS_ORDERS",
          "label": "Manage order and quote settings"
        },
        "x-required-scopes": ["SETTINGS_WRITE"],
        "x-stability": "stable"
      }
    },
    "/settings/fees/restore-defaults": {
      "post": {
        "description": "Restore default fees: adds back the default fees that were deleted (`missing_default_fees`), at 0 and off tax. API keys need **Change settings**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "settings_fees_restore",
        "parameters": [
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Empty"
              }
            }
          },
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SettingsFeesRestored"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Restore default fees",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "SETTINGS_ORDERS",
          "label": "Manage order and quote settings"
        },
        "x-required-scopes": ["SETTINGS_WRITE"],
        "x-stability": "stable"
      }
    },
    "/settings/fees/{id}": {
      "delete": {
        "description": "Delete a saved fee. Fees already on quotes and orders stay. API keys need **Change settings**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "settings_fee_delete",
        "parameters": [
          {
            "description": "The fee’s `id` from `GET /settings/fees`.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SettingsDeleted"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Delete a saved fee",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "SETTINGS_ORDERS",
          "label": "Manage order and quote settings"
        },
        "x-required-scopes": ["SETTINGS_WRITE"],
        "x-stability": "stable"
      },
      "patch": {
        "description": "Change a saved fee (only the fields sent): its name, type, value, whether it is taxable or physical, or on. Fees already on quotes and orders keep theirs. API keys need **Change settings**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "settings_fee_update",
        "parameters": [
          {
            "description": "The fee’s `id` from `GET /settings/fees`.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SettingsFeeUpdate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SettingsFee"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Change a saved fee",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "SETTINGS_ORDERS",
          "label": "Manage order and quote settings"
        },
        "x-required-scopes": ["SETTINGS_WRITE"],
        "x-stability": "stable"
      }
    },
    "/settings/history": {
      "get": {
        "description": "The store’s settings change history, newest first, as Settings › Account and data › Change history lists it: every change to the settings, Staff and roles, and the locations, brands, categories, options, product templates and vendors Settings lists, who made it, and each changed field before and after. A page ends with `next_cursor`; the first page also lists the people the `who` filter can name. Costs show only with See costs, commission rates only to who may see them, and a location’s rows only to a caller whose reach includes it (a key limited to some locations reads only theirs). Needs View settings change history (a key: Read settings). API keys need **Read settings**. Phones see only what their staff member’s role reaches.",
        "operationId": "settings_history",
        "parameters": [
          {
            "description": "Whose changes: `everyone` (the default), `people` (staff only), `automatic` (what OrderPilot did by itself) or `support` (Bevy support). `staff_id` names one person instead.",
            "in": "query",
            "name": "who",
            "required": false,
            "schema": {
              "enum": ["everyone", "people", "automatic", "support"],
              "type": "string"
            }
          },
          {
            "description": "Only this staff member’s changes, by an `id` from the first page’s `people`.",
            "in": "query",
            "name": "staff_id",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Only one Settings page’s changes. Left out: every page.",
            "in": "query",
            "name": "area",
            "required": false,
            "schema": {
              "enum": [
                "business",
                "staff_access",
                "customers",
                "account",
                "quotes_orders",
                "products",
                "purchasing",
                "branding",
                "online_store",
                "messages",
                "debug",
                "devices_api"
              ],
              "type": "string"
            }
          },
          {
            "description": "Only changes at or after this time (ISO 8601).",
            "in": "query",
            "name": "from",
            "required": false,
            "schema": {
              "format": "date-time",
              "type": "string"
            }
          },
          {
            "description": "Only changes before this time (ISO 8601). Must be after `from`.",
            "in": "query",
            "name": "to",
            "required": false,
            "schema": {
              "format": "date-time",
              "type": "string"
            }
          },
          {
            "description": "The `next_cursor` of the previous page, with the same filters. A cursor that is out of date is `400 INVALID_CURSOR`.",
            "in": "query",
            "name": "cursor",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SettingsHistory"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "List settings changes",
        "x-rate-weight": 1,
        "x-required-permission": {
          "id": "SETTINGS_HISTORY",
          "label": "View settings change history"
        },
        "x-required-scopes": ["SETTINGS_READ"],
        "x-stability": "stable"
      }
    },
    "/settings/locations": {
      "get": {
        "description": "Settings › Business and locations › Locations: every location the store has (inactive and made-to-order ones too, A to Z, up to 250), each with its brand, whether it is on the plan, the details its documents print, its terms and conditions, its receipt terms and its two pictures. `GET /locations` lists only the ones a quote can use. API keys need **Read settings** or **Change settings**.",
        "operationId": "settings_locations",
        "parameters": [],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SettingsLocationList"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "List locations with their settings",
        "x-rate-weight": 1,
        "x-required-scopes": ["SETTINGS_READ", "SETTINGS_WRITE"],
        "x-stability": "stable"
      }
    },
    "/settings/locations/sync": {
      "post": {
        "description": "Read the store’s locations from Shopify now, as Settings › Locations’ Sync does: new ones are added (listed in Settings › Change history as added from Shopify), renamed ones take their new name (on their orders too) and ones Shopify no longer lists are marked inactive. Nothing set in OrderPilot (brand, details, terms, pictures) changes. API keys need **Change settings**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "settings_locations_sync",
        "parameters": [
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Empty"
              }
            }
          },
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SettingsLocationList"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Sync locations from Shopify",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "SETTINGS_SHOP",
          "label": "Manage shop settings"
        },
        "x-required-scopes": ["SETTINGS_WRITE"],
        "x-stability": "stable"
      }
    },
    "/settings/locations/{id}": {
      "patch": {
        "description": "Change a location’s settings, as Settings › Locations saves them: its brand (`brand_id`, null for none), the details its documents print (`display_info`: only the fields sent), its terms and conditions (HTML, sanitized as in Settings), its receipt terms (plain text, at most 600 characters) and its logo or default product picture (an uploaded picture’s `id` from `POST /files`). Only what is sent changes. Recorded on the location’s Activity and in Settings › Change history as the key. A location not on the plan is refused as in Settings. API keys need **Change settings**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "settings_location_update",
        "parameters": [
          {
            "description": "The location’s Shopify location id, the `id` `GET /settings/locations` lists.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SettingsLocationUpdate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SettingsLocation"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Change a location’s settings",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "SETTINGS_SHOP",
          "label": "Manage shop settings"
        },
        "x-required-scopes": ["SETTINGS_WRITE"],
        "x-stability": "stable"
      }
    },
    "/settings/numbering": {
      "get": {
        "description": "The numbering settings (Settings › Quotes and orders › Defaults › Numbering), as saved. API keys need **Read settings** or **Change settings**.",
        "operationId": "settings_numbering",
        "parameters": [],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SettingsNumbering"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "See the numbering settings",
        "x-rate-weight": 1,
        "x-required-scopes": ["SETTINGS_READ", "SETTINGS_WRITE"],
        "x-stability": "stable"
      },
      "patch": {
        "description": "Change the numbering settings (Settings › Quotes and orders › Defaults › Numbering), as its Save does: send only the fields to change. Each changed field needs the admin’s permission for it, and the change is listed in Settings › Change history as the key. A new prefix whose next number is already used is refused with `409 NUMBERING_PREFIX_CONFLICT` and the clashes; send `accept_numbering_adjustments: true` to save it starting at the first free number. API keys need **Change settings**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "settings_numbering_update",
        "parameters": [
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SettingsNumberingUpdate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SettingsNumbering"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Change the numbering settings",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "SETTINGS_ORDERS",
          "label": "Manage order and quote settings"
        },
        "x-required-scopes": ["SETTINGS_WRITE"],
        "x-stability": "stable"
      }
    },
    "/settings/online-store": {
      "get": {
        "description": "The online store settings (Settings › Online store), as saved. API keys need **Read settings** or **Change settings**.",
        "operationId": "settings_online_store",
        "parameters": [],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SettingsOnlineStore"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "See the online store settings",
        "x-rate-weight": 1,
        "x-required-scopes": ["SETTINGS_READ", "SETTINGS_WRITE"],
        "x-stability": "stable"
      },
      "patch": {
        "description": "Change the online store settings (Settings › Online store), as its Save does: send only the fields to change. Each changed field needs the admin’s permission for it, and the change is listed in Settings › Change history as the key. The options block’s style is set in Settings, not here. API keys need **Change settings**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "settings_online_store_update",
        "parameters": [
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SettingsOnlineStoreUpdate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SettingsOnlineStore"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Change the online store settings",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "SETTINGS_ORDERS",
          "label": "Manage order and quote settings"
        },
        "x-required-scopes": ["SETTINGS_WRITE"],
        "x-stability": "stable"
      }
    },
    "/settings/portal-access": {
      "get": {
        "description": "The portal access (Settings › Customers › Portal access), as saved. API keys need **Read settings** or **Change settings**.",
        "operationId": "settings_portal_access",
        "parameters": [],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SettingsPortalAccess"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "See the portal access",
        "x-rate-weight": 1,
        "x-required-scopes": ["SETTINGS_READ", "SETTINGS_WRITE"],
        "x-stability": "stable"
      },
      "patch": {
        "description": "Change the portal access (Settings › Customers › Portal access), as its Save does: send only the fields to change. Each changed field needs the admin’s permission for it, and the change is listed in Settings › Change history as the key. API keys need **Change settings**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "settings_portal_access_update",
        "parameters": [
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SettingsPortalAccessUpdate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SettingsPortalAccess"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Change the portal access",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "SETTINGS_SHOP",
          "label": "Manage shop settings"
        },
        "x-required-scopes": ["SETTINGS_WRITE"],
        "x-stability": "stable"
      }
    },
    "/settings/portal-access/revoke-links": {
      "post": {
        "description": "Revoke all portal links (Settings › Customers › Portal access): every link customers hold to the customer portal stops working now, including links in emails already sent; they ask for a new one. Answers how many stopped. Listed in Settings › Change history as the key when any did. API keys need **Change settings**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "settings_portal_links_revoke",
        "parameters": [
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Empty"
              }
            }
          },
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SettingsPortalLinksRevoked"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Revoke all portal links",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "SETTINGS_SHOP",
          "label": "Manage shop settings"
        },
        "x-required-scopes": ["SETTINGS_WRITE"],
        "x-stability": "stable"
      }
    },
    "/settings/product-defaults": {
      "get": {
        "description": "The product defaults (Settings › Products › Product defaults), as saved. API keys need **Read settings** or **Change settings** or **Change the catalog**.",
        "operationId": "settings_product_defaults",
        "parameters": [],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SettingsProductDefaults"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "See the product defaults",
        "x-rate-weight": 1,
        "x-required-scopes": [
          "SETTINGS_READ",
          "SETTINGS_WRITE",
          "CATALOG_WRITE"
        ],
        "x-stability": "stable"
      },
      "patch": {
        "description": "Change the product defaults (Settings › Products › Product defaults), as its Save does: send only the fields to change. Each changed field needs the admin’s permission for it, and the change is listed in Settings › Change history as the key. A new `add_on_name_prefix` renames every add-on product in Shopify within a few minutes. API keys need **Change the catalog**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "settings_product_defaults_update",
        "parameters": [
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SettingsProductDefaultsUpdate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SettingsProductDefaults"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Change the product defaults",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "CATALOG_MANAGE",
          "label": "Manage the catalog"
        },
        "x-required-scopes": ["CATALOG_WRITE"],
        "x-stability": "stable"
      }
    },
    "/settings/purchase-orders": {
      "get": {
        "description": "The purchase order settings (Settings › Purchasing and accounting › Purchase orders and costing › Purchase orders), as saved. API keys need **Read settings** or **Change settings**.",
        "operationId": "settings_purchase_orders",
        "parameters": [],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SettingsPurchaseOrders"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "See the purchase order settings",
        "x-rate-weight": 1,
        "x-required-scopes": ["SETTINGS_READ", "SETTINGS_WRITE"],
        "x-stability": "stable"
      },
      "patch": {
        "description": "Change the purchase order settings (Settings › Purchasing and accounting › Purchase orders and costing › Purchase orders), as its Save does: send only the fields to change. Each changed field needs the admin’s permission for it, and the change is listed in Settings › Change history as the key. A new prefix whose next number is already used is refused with `409 NUMBERING_PREFIX_CONFLICT`, as on the numbering settings. API keys need **Change settings**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "settings_purchase_orders_update",
        "parameters": [
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SettingsPurchaseOrdersUpdate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SettingsPurchaseOrders"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Change the purchase order settings",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "SETTINGS_PURCHASING",
          "label": "Manage purchasing settings"
        },
        "x-required-scopes": ["SETTINGS_WRITE"],
        "x-stability": "stable"
      }
    },
    "/settings/quick-replies": {
      "get": {
        "description": "Settings › Messages › Quick replies: the saved replies staff pick in a reply, in their order, and the reply time goal. API keys need **Read settings** or **Change settings**.",
        "operationId": "settings_quick_replies",
        "parameters": [],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/QuickReplies"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "List quick replies in settings",
        "x-rate-weight": 1,
        "x-required-scopes": ["SETTINGS_READ", "SETTINGS_WRITE"],
        "x-stability": "stable"
      },
      "post": {
        "description": "Add a quick reply (placed last; up to 20, `422 CAP_REACHED`). API keys need **Change settings**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "settings_quick_reply_create",
        "parameters": [
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/QuickReplyWrite"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/QuickRepliesSaved"
                }
              }
            },
            "description": "Created"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Create a quick reply",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "SETTINGS_SHOP",
          "label": "Manage shop settings"
        },
        "x-required-scopes": ["SETTINGS_WRITE"],
        "x-stability": "stable"
      }
    },
    "/settings/quick-replies/reorder": {
      "post": {
        "description": "Put the quick replies in this order (ones left out keep their order after them). API keys need **Change settings**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "settings_quick_replies_reorder",
        "parameters": [
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SettingsIdOrder"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/QuickRepliesSaved"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Reorder quick replies",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "SETTINGS_SHOP",
          "label": "Manage shop settings"
        },
        "x-required-scopes": ["SETTINGS_WRITE"],
        "x-stability": "stable"
      }
    },
    "/settings/quick-replies/{id}": {
      "delete": {
        "description": "Delete a quick reply. API keys need **Change settings**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "settings_quick_reply_delete",
        "parameters": [
          {
            "description": "The quick reply’s `id` from `GET /settings/quick-replies`.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/QuickRepliesSaved"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Delete a quick reply",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "SETTINGS_SHOP",
          "label": "Manage shop settings"
        },
        "x-required-scopes": ["SETTINGS_WRITE"],
        "x-stability": "stable"
      },
      "patch": {
        "description": "Change a quick reply’s title or text. API keys need **Change settings**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "settings_quick_reply_update",
        "parameters": [
          {
            "description": "The quick reply’s `id` from `GET /settings/quick-replies`.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/QuickReplyWrite"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/QuickRepliesSaved"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Change a quick reply",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "SETTINGS_SHOP",
          "label": "Manage shop settings"
        },
        "x-required-scopes": ["SETTINGS_WRITE"],
        "x-stability": "stable"
      }
    },
    "/settings/quickbooks": {
      "get": {
        "description": "Settings › Purchasing and accounting › QuickBooks: whether QuickBooks is set up on this server, the connected company, its sync switch, the accounts purchases post to, vendor payments, cost of goods, customer orders, each store location’s QuickBooks Location and each Shopify tax’s QuickBooks code. Never a token. `lists=true` also reads, live from QuickBooks, its accounts, vendors, Locations and tax codes, and lists the store’s vendors with their QuickBooks match: the ids every QuickBooks save takes. Connecting and disconnecting is done by a person in the admin. API keys need **Read settings** or **Change settings**.",
        "operationId": "settings_quickbooks",
        "parameters": [
          {
            "description": "true: also read QuickBooks’ accounts, vendors, Locations and tax codes (one live read of QuickBooks, a few seconds) and the store’s vendors with their match (`lists`). Left out: `lists` is null.",
            "in": "query",
            "name": "lists",
            "required": false,
            "schema": {
              "enum": ["true", "1"],
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/QuickBooksSettings"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "See the QuickBooks settings",
        "x-rate-weight": 1,
        "x-required-scopes": ["SETTINGS_READ", "SETTINGS_WRITE"],
        "x-stability": "stable"
      }
    },
    "/settings/quickbooks/accounts": {
      "patch": {
        "description": "Change the accounts purchases post to (Settings › QuickBooks › Accounts): send only the ones to change, null to clear one. A mapping without goods for stock, goods for a customer order and other charges turns sync off. Only the fields sent are written, onto the section as it is then; a change meanwhile its checks didn’t cover is `409 CONFLICT`. Checked as Settings checks it (against QuickBooks as it is now), listed in Settings › Change history as the key, answered with the settings as saved. QuickBooks refusing for good is `422 REFUSED`, not answering `502 QUICKBOOKS_UNAVAILABLE`, having ended the connection `409 CONFLICT`. Before QuickBooks is connected (in the admin): `409 CONFLICT`. API keys need **Change settings**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "settings_quickbooks_accounts_update",
        "parameters": [
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/QuickBooksAccountsUpdate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/QuickBooksSettings"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Change the QuickBooks accounts",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "SETTINGS_PURCHASING",
          "label": "Manage purchasing settings"
        },
        "x-required-scopes": ["SETTINGS_WRITE"],
        "x-stability": "stable"
      }
    },
    "/settings/quickbooks/cost-of-goods": {
      "patch": {
        "description": "Change how cost of goods reaches QuickBooks (Settings › QuickBooks › Cost of goods). Turning it on posts from now; turning it off stops posting what ships meanwhile. Only the fields sent are written, onto the section as it is then; a change meanwhile its checks didn’t cover is `409 CONFLICT`. Checked as Settings checks it (against QuickBooks as it is now), listed in Settings › Change history as the key, answered with the settings as saved. QuickBooks refusing for good is `422 REFUSED`, not answering `502 QUICKBOOKS_UNAVAILABLE`, having ended the connection `409 CONFLICT`. Before QuickBooks is connected (in the admin): `409 CONFLICT`. API keys need **Change settings**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "settings_quickbooks_cost_of_goods_update",
        "parameters": [
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/QuickBooksCostOfGoodsUpdate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/QuickBooksSettings"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Change how cost of goods posts",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "SETTINGS_PURCHASING",
          "label": "Manage purchasing settings"
        },
        "x-required-scopes": ["SETTINGS_WRITE"],
        "x-stability": "stable"
      }
    },
    "/settings/quickbooks/cost-of-goods/post-now": {
      "post": {
        "description": "Post cost of goods now, as Settings’ Post now: queues the posting of fulfilments and cost changes not yet posted to the merchant’s QuickBooks. Cost of goods off, or sync off: `409 CONFLICT`. API keys need **Change settings**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "settings_quickbooks_cost_of_goods_post",
        "parameters": [
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Empty"
              }
            }
          },
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/QuickBooksPostNow"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Post cost of goods now",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "SETTINGS_PURCHASING",
          "label": "Manage purchasing settings"
        },
        "x-required-scopes": ["SETTINGS_WRITE"],
        "x-stability": "stable"
      }
    },
    "/settings/quickbooks/locations": {
      "patch": {
        "description": "Tag store locations with a QuickBooks Location (or null to stop tagging one), as Settings › QuickBooks › Locations: only the locations sent change. Tagging needs location tracking on in QuickBooks and each Location active there (`409 CONFLICT`). A location the store doesn’t have is `404 LOCATION_NOT_FOUND`. Listed in Settings › Change history as the key; answered with the settings as saved. Before QuickBooks is connected (in the admin): `409 CONFLICT`. API keys need **Change settings**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "settings_quickbooks_locations_update",
        "parameters": [
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/QuickBooksLocationsUpdate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/QuickBooksSettings"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Tag locations in QuickBooks",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "SETTINGS_PURCHASING",
          "label": "Manage purchasing settings"
        },
        "x-required-scopes": ["SETTINGS_WRITE"],
        "x-stability": "stable"
      }
    },
    "/settings/quickbooks/log": {
      "get": {
        "description": "The QuickBooks sync log: what OrderPilot posted, newest first (25 a page, back 1,000 documents), and what hasn’t posted (failed and waiting orders, failed purchase orders, online-store orders that failed for good). Orders show only with an order read scope and within the key’s locations, purchase orders with Read purchase orders, their amounts with See costs. Needs Change settings, as the admin opens it only with Manage purchasing settings. Never connected: `404 NOT_FOUND`. API keys need **Change settings**. Phones see only what their staff member’s role reaches.",
        "operationId": "settings_quickbooks_log",
        "parameters": [
          {
            "description": "The page, 1–40 (25 documents each).",
            "in": "query",
            "name": "page",
            "required": false,
            "schema": {
              "default": 1,
              "maximum": 40,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "description": "A document number, a QuickBooks reference, or an order or purchase order number (up to 60 characters).",
            "in": "query",
            "name": "q",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Only documents of this kind.",
            "in": "query",
            "name": "type",
            "required": false,
            "schema": {
              "enum": [
                "purchase_order",
                "bill",
                "vendor_credit",
                "supplemental_bill",
                "vendor_payment",
                "bill_payment",
                "journal_entry",
                "invoice",
                "receive_payment",
                "credit_memo",
                "refund_receipt",
                "refund_journal"
              ],
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/QuickBooksSyncLog"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "See the QuickBooks sync log",
        "x-rate-weight": 1,
        "x-required-permission": {
          "id": "SETTINGS_PURCHASING",
          "label": "Manage purchasing settings"
        },
        "x-required-scopes": ["SETTINGS_WRITE"],
        "x-stability": "stable"
      }
    },
    "/settings/quickbooks/payments": {
      "patch": {
        "description": "Change how payments recorded on purchase orders reach QuickBooks (Settings › QuickBooks › Vendor payments). Payments already recorded catch up under the new settings (queued; `warning` says when it couldn’t be). Only the fields sent are written, onto the section as it is then; a change meanwhile its checks didn’t cover is `409 CONFLICT`. Checked as Settings checks it (against QuickBooks as it is now), listed in Settings › Change history as the key, answered with the settings as saved. QuickBooks refusing for good is `422 REFUSED`, not answering `502 QUICKBOOKS_UNAVAILABLE`, having ended the connection `409 CONFLICT`. Before QuickBooks is connected (in the admin): `409 CONFLICT`. API keys need **Change settings**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "settings_quickbooks_payments_update",
        "parameters": [
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/QuickBooksPaymentsUpdate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/QuickBooksSettings"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Change how vendor payments post",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "SETTINGS_PURCHASING",
          "label": "Manage purchasing settings"
        },
        "x-required-scopes": ["SETTINGS_WRITE"],
        "x-stability": "stable"
      }
    },
    "/settings/quickbooks/sales": {
      "patch": {
        "description": "Change how customer orders and payments reach QuickBooks (Settings › QuickBooks › Customer orders). Turning it on needs sync on, its accounts, a start date and the merchant’s confirmation. Tax codes are refused while the company calculates sales tax itself (`409 CONFLICT`). Only the fields sent are written, onto the section as it is then; a change meanwhile its checks didn’t cover is `409 CONFLICT`. Checked as Settings checks it (against QuickBooks as it is now), listed in Settings › Change history as the key, answered with the settings as saved. QuickBooks refusing for good is `422 REFUSED`, not answering `502 QUICKBOOKS_UNAVAILABLE`, having ended the connection `409 CONFLICT`. Before QuickBooks is connected (in the admin): `409 CONFLICT`. API keys need **Change settings**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "settings_quickbooks_sales_update",
        "parameters": [
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/QuickBooksSalesUpdate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/QuickBooksSettings"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Change how customer orders post",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "SETTINGS_PURCHASING",
          "label": "Manage purchasing settings"
        },
        "x-required-scopes": ["SETTINGS_WRITE"],
        "x-stability": "stable"
      }
    },
    "/settings/quickbooks/sales/post-now": {
      "post": {
        "description": "Post customer orders now, as Settings’ Post now: queues the posting of paid orders and payments not yet in the merchant’s QuickBooks, and online-store orders that failed for good go again. Customer orders off, or sync off: `409 CONFLICT`. API keys need **Change settings**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "settings_quickbooks_sales_post",
        "parameters": [
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Empty"
              }
            }
          },
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/QuickBooksPostNow"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Post customer orders now",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "SETTINGS_PURCHASING",
          "label": "Manage purchasing settings"
        },
        "x-required-scopes": ["SETTINGS_WRITE"],
        "x-stability": "stable"
      }
    },
    "/settings/quickbooks/sync": {
      "post": {
        "description": "Turn QuickBooks sync on or off, as Settings’ switch: purchase orders, bills and payments post only while it is on. Turning it on needs the three required accounts mapped, the connection working, the company’s home currency the store’s and every mapped account still of its type (`409 CONFLICT` with the reason). Checked as Settings checks it (against QuickBooks as it is now), listed in Settings › Change history as the key, answered with the settings as saved. QuickBooks refusing for good is `422 REFUSED`, not answering `502 QUICKBOOKS_UNAVAILABLE`, having ended the connection `409 CONFLICT`. Before QuickBooks is connected (in the admin): `409 CONFLICT`. API keys need **Change settings**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "settings_quickbooks_sync",
        "parameters": [
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/QuickBooksSyncSet"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/QuickBooksSettings"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Turn QuickBooks sync on or off",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "SETTINGS_PURCHASING",
          "label": "Manage purchasing settings"
        },
        "x-required-scopes": ["SETTINGS_WRITE"],
        "x-stability": "stable"
      }
    },
    "/settings/quickbooks/taxes": {
      "patch": {
        "description": "Point Shopify taxes at another QuickBooks tax code (one holding one sales rate) or another liability account (null: back to Sales tax payable), as Settings › QuickBooks › Sales tax: only the taxes sent change, and invoices already posted keep theirs. Checked against QuickBooks as it is now (`409 CONFLICT`, or `400 INVALID_BODY` for an account of the wrong type). Listed in Settings › Change history as the key; answered with the settings as saved. Before QuickBooks is connected (in the admin): `409 CONFLICT`. API keys need **Change settings**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "settings_quickbooks_taxes_update",
        "parameters": [
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/QuickBooksTaxesUpdate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/QuickBooksSettings"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Point taxes at QuickBooks codes",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "SETTINGS_PURCHASING",
          "label": "Manage purchasing settings"
        },
        "x-required-scopes": ["SETTINGS_WRITE"],
        "x-stability": "stable"
      }
    },
    "/settings/quickbooks/vendor-matches": {
      "post": {
        "description": "Match vendors to QuickBooks vendors, as Settings’ Match all (1–100 at a time): each vendor’s purchase orders then post to that QuickBooks vendor. Each QuickBooks vendor is read from QuickBooks: one it doesn’t have or has made inactive, one already matched to another vendor, or one named twice is `409 CONFLICT`, and a match keeps QuickBooks’ own name for it. Vendors not in the store are left out (none in the store: `404 NOT_FOUND`). Listed in Settings › Change history as the key. API keys need **Change settings**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "settings_quickbooks_vendor_matches",
        "parameters": [
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/QuickBooksVendorMatches"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/QuickBooksVendorsMatched"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Match vendors in QuickBooks",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "SETTINGS_PURCHASING",
          "label": "Manage purchasing settings"
        },
        "x-required-scopes": ["SETTINGS_WRITE"],
        "x-stability": "stable"
      }
    },
    "/settings/quickbooks/vendor-matches/{id}": {
      "patch": {
        "description": "Match one vendor to a QuickBooks vendor, or send `quickbooks_vendor_id: null` to go back to automatic (matched by name, or created, at the next push). The QuickBooks vendor is read from QuickBooks: one it doesn’t have, or has made inactive, is `409 CONFLICT`; the match keeps QuickBooks’ own name for it. Listed in Settings › Change history as the key. API keys need **Change settings**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "settings_quickbooks_vendor_match_update",
        "parameters": [
          {
            "description": "The vendor’s id: `lists.vendors[].vendor_id` of `GET /settings/quickbooks` (with `lists=true`).",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/QuickBooksVendorMatchUpdate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/QuickBooksVendorMatch"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Match one vendor in QuickBooks",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "SETTINGS_PURCHASING",
          "label": "Manage purchasing settings"
        },
        "x-required-scopes": ["SETTINGS_WRITE"],
        "x-stability": "stable"
      }
    },
    "/settings/quote-rules": {
      "get": {
        "description": "Quote eligibility (Settings › Online store): which of the store’s Shopify products show Add to Quote. Every rule group with its conditions (a product tag, a Shopify product category or a collection, each `include` or `exclude`) and how the groups combine (`any` or `all`). With no active group holding an `include`, every product is eligible; a matching group of only `exclude` conditions takes a product out. A collection off the Online Store is flagged (`off_online_store`): while an active group has one, the storefront isn’t given the rules. API keys need **Read settings** or **Change settings**.",
        "operationId": "settings_quote_rules",
        "parameters": [],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/QuoteRules"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "See the quote eligibility rules",
        "x-rate-weight": 1,
        "x-required-scopes": ["SETTINGS_READ", "SETTINGS_WRITE"],
        "x-stability": "stable"
      }
    },
    "/settings/quote-rules/collections": {
      "get": {
        "description": "The store’s Shopify collections whose title contains `q` (up to 50), read live from Shopify, as the rule dialog’s collection picker finds them, each with whether it is on the Online Store (a rule can only name one that is; null when Shopify couldn’t say). `502 SHOPIFY_UNAVAILABLE` when Shopify can’t be read. API keys need **Read settings** or **Change settings**.",
        "operationId": "settings_quote_rule_collections",
        "parameters": [
          {
            "description": "Only titles containing this (up to 100 characters); every collection without it.",
            "in": "query",
            "name": "q",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/QuoteRuleCollections"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Find collections for quote eligibility",
        "x-rate-weight": 1,
        "x-required-scopes": ["SETTINGS_READ", "SETTINGS_WRITE"],
        "x-stability": "stable"
      }
    },
    "/settings/quote-rules/groups": {
      "post": {
        "description": "Add a rule group, as the rule dialog’s Save: a name, its conditions (at least one `include`, up to 50) and how they combine (`and` or `or`, default `or`). A collection off the Online Store is refused (`422 REFUSED` naming it); up to 50 groups (`422 CAP_REACHED`). The storefront’s copy of the rules is published again in the background (a few seconds); until then, and while an active group names a collection off the Online Store, the page shows Add to Quote everywhere and the quote’s submit decides. Listed in Settings › Change history as the key. `201`, with `saved_id`. API keys need **Change settings**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "settings_quote_rule_group_create",
        "parameters": [
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/QuoteRuleGroupCreate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/QuoteRules"
                }
              }
            },
            "description": "Created"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Create a quote rule group",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "SETTINGS_ORDERS",
          "label": "Manage order and quote settings"
        },
        "x-required-scopes": ["SETTINGS_WRITE"],
        "x-stability": "stable"
      }
    },
    "/settings/quote-rules/groups/{id}": {
      "delete": {
        "description": "Delete a rule group and its conditions. The storefront’s copy of the rules is published again in the background (a few seconds); until then, and while an active group names a collection off the Online Store, the page shows Add to Quote everywhere and the quote’s submit decides. Listed in Settings › Change history as the key. API keys need **Change settings**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "settings_quote_rule_group_delete",
        "parameters": [
          {
            "description": "The rule group’s `id` from `GET /settings/quote-rules`.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/QuoteRules"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Delete a quote rule group",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "SETTINGS_ORDERS",
          "label": "Manage order and quote settings"
        },
        "x-required-scopes": ["SETTINGS_WRITE"],
        "x-stability": "stable"
      },
      "patch": {
        "description": "Change a rule group (only the fields sent): its name, whether it is active (up to 50 active, `422 CAP_REACHED`), how its conditions combine, its place, or its conditions (the whole list, replacing the saved one; at least one `include`). The storefront’s copy of the rules is published again in the background (a few seconds); until then, and while an active group names a collection off the Online Store, the page shows Add to Quote everywhere and the quote’s submit decides. Listed in Settings › Change history as the key. API keys need **Change settings**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "settings_quote_rule_group_update",
        "parameters": [
          {
            "description": "The rule group’s `id` from `GET /settings/quote-rules`.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/QuoteRuleGroupUpdate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/QuoteRules"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Change a quote rule group",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "SETTINGS_ORDERS",
          "label": "Manage order and quote settings"
        },
        "x-required-scopes": ["SETTINGS_WRITE"],
        "x-stability": "stable"
      }
    },
    "/settings/quote-rules/policy": {
      "patch": {
        "description": "Set how the rule groups combine: `any` (a product eligible under one active group is eligible) or `all` (under every one). The storefront’s copy of the rules is published again in the background (a few seconds); until then, and while an active group names a collection off the Online Store, the page shows Add to Quote everywhere and the quote’s submit decides. Listed in Settings › Change history as the key. API keys need **Change settings**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "settings_quote_rules_policy_update",
        "parameters": [
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/QuoteRulesPolicyUpdate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/QuoteRules"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Change how quote rule groups combine",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "SETTINGS_ORDERS",
          "label": "Manage order and quote settings"
        },
        "x-required-scopes": ["SETTINGS_WRITE"],
        "x-stability": "stable"
      }
    },
    "/settings/quote-rules/recheck-collections": {
      "post": {
        "description": "Check the rules’ collections against the Online Store again, as the warning’s Check again: after a flagged collection is published to the Online Store in Shopify. The check runs in the background and publishes the rules (`202`); read `GET /settings/quote-rules` a few seconds later for the flags. `503 QUEUE_FAILED` when it couldn’t be started. API keys need **Change settings**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "settings_quote_rules_recheck",
        "parameters": [
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Empty"
              }
            }
          },
          "required": false
        },
        "responses": {
          "202": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/QuoteRulesCheckStarted"
                }
              }
            },
            "description": "Accepted"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Check quote rule collections again",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "SETTINGS_ORDERS",
          "label": "Manage order and quote settings"
        },
        "x-required-scopes": ["SETTINGS_WRITE"],
        "x-stability": "stable"
      }
    },
    "/settings/quotes": {
      "get": {
        "description": "The quote settings (Settings › Quotes and orders › Defaults › Quotes), as saved. API keys need **Read settings** or **Change settings**.",
        "operationId": "settings_quotes",
        "parameters": [],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SettingsQuotes"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "See the quote settings",
        "x-rate-weight": 1,
        "x-required-scopes": ["SETTINGS_READ", "SETTINGS_WRITE"],
        "x-stability": "stable"
      },
      "patch": {
        "description": "Change the quote settings (Settings › Quotes and orders › Defaults › Quotes), as its Save does: send only the fields to change. Each changed field needs the admin’s permission for it, and the change is listed in Settings › Change history as the key. API keys need **Change settings**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "settings_quotes_update",
        "parameters": [
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SettingsQuotesUpdate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SettingsQuotes"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Change the quote settings",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "SETTINGS_ORDERS",
          "label": "Manage order and quote settings"
        },
        "x-required-scopes": ["SETTINGS_WRITE"],
        "x-stability": "stable"
      }
    },
    "/settings/recipients": {
      "get": {
        "description": "The recipient settings (Settings › Messages and notifications › Sending settings › Recipients), as saved. API keys need **Read settings** or **Change settings**.",
        "operationId": "settings_recipients",
        "parameters": [],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SettingsRecipients"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "See the recipient settings",
        "x-rate-weight": 1,
        "x-required-scopes": ["SETTINGS_READ", "SETTINGS_WRITE"],
        "x-stability": "stable"
      },
      "patch": {
        "description": "Change the recipient settings (Settings › Messages and notifications › Sending settings › Recipients), as its Save does: send only the fields to change. Each changed field needs the admin’s permission for it, and the change is listed in Settings › Change history as the key. API keys need **Change settings**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "settings_recipients_update",
        "parameters": [
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SettingsRecipientsUpdate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SettingsRecipients"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Change the recipient settings",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "SETTINGS_SHOP",
          "label": "Manage shop settings"
        },
        "x-required-scopes": ["SETTINGS_WRITE"],
        "x-stability": "stable"
      }
    },
    "/settings/replies": {
      "get": {
        "description": "The reply time goal (Settings › Messages and notifications › Sending settings › Replies), as saved. API keys need **Read settings** or **Change settings**.",
        "operationId": "settings_replies",
        "parameters": [],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SettingsReplies"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "See the reply time goal",
        "x-rate-weight": 1,
        "x-required-scopes": ["SETTINGS_READ", "SETTINGS_WRITE"],
        "x-stability": "stable"
      },
      "patch": {
        "description": "Change the reply time goal (Settings › Messages and notifications › Sending settings › Replies), as its Save does: send only the fields to change. Each changed field needs the admin’s permission for it, and the change is listed in Settings › Change history as the key. API keys need **Change settings**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "settings_replies_update",
        "parameters": [
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SettingsRepliesUpdate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SettingsReplies"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Change the reply time goal",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "SETTINGS_SHOP",
          "label": "Manage shop settings"
        },
        "x-required-scopes": ["SETTINGS_WRITE"],
        "x-stability": "stable"
      }
    },
    "/settings/requirements": {
      "get": {
        "description": "Before an order is placed (Settings › Quotes and orders › Defaults): the Customer signature and Deposit requirements, each with its switch per device (`every_order`, `list`: only the list below, or `never`), the deposit Every order asks for, and its list of rules, categories and products (with Excluded rows: a product set to not need it, which cancels only its categories). Also every category, what a rule’s conditions can use (`rule_fields`) and the limits. The device is where a quote or order was made (POS, or the admin and online store). API keys need **Read settings** or **Change settings**.",
        "operationId": "settings_requirements",
        "parameters": [],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrderRequirements"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "See the order requirements",
        "x-rate-weight": 1,
        "x-required-scopes": ["SETTINGS_READ", "SETTINGS_WRITE"],
        "x-stability": "stable"
      }
    },
    "/settings/requirements/choices": {
      "get": {
        "description": "A page of 25 things a requirement can name, as the screen’s pickers find them: `templates` (active product templates, with their categories), `categories`, `shopify_products` (the store’s own Shopify products, read live; the ones OrderPilot runs are left out), `vendors` or `locations`. Their `id` is what a row add and a rule’s condition (`{ id, label }`) take. `502 SHOPIFY_UNAVAILABLE` when Shopify can’t be read. API keys need **Change settings**. Phones see only what their staff member’s role reaches.",
        "operationId": "settings_requirement_choices",
        "parameters": [
          {
            "description": "What to list: `templates`, `categories`, `shopify_products`, `vendors` or `locations` (a rule field’s `choices_source` in `GET /settings/requirements`).",
            "in": "query",
            "name": "source",
            "required": true,
            "schema": {
              "enum": [
                "locations",
                "templates",
                "shopify_products",
                "categories",
                "vendors"
              ],
              "type": "string"
            }
          },
          {
            "description": "Only names containing this (up to 100 characters).",
            "in": "query",
            "name": "q",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "The `next_cursor` of the previous page, with the same `source` and `q`. A cursor from another list is `400 INVALID_CURSOR`.",
            "in": "query",
            "name": "cursor",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrderRequirementChoices"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Find order requirement choices",
        "x-rate-weight": 1,
        "x-required-permission": {
          "id": "SETTINGS_ORDERS",
          "label": "Manage order and quote settings"
        },
        "x-required-scopes": ["SETTINGS_WRITE"],
        "x-stability": "stable"
      }
    },
    "/settings/requirements/mode": {
      "post": {
        "description": "Set one device’s switch of the signature or deposit requirement, as the screen’s Admin and POS choices do: `every_order` (a deposit also needs its `percent`, 1–100, kept for next time), `list` (only the list) or `never`. It changes what blocks placing every open quote and order made there: `GET /settings/requirements/mode-count` says how many first. Orders already placed don’t change. Listed in Settings › Change history as the key. Answers that requirement as `GET /settings/requirements` reads it (its switches, list and why the list isn’t used). API keys need **Change settings**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "settings_requirement_mode_set",
        "parameters": [
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OrderRequirementModeSet"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrderRequirementKindSaved"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Set an order requirement switch",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "SETTINGS_ORDERS",
          "label": "Manage order and quote settings"
        },
        "x-required-scopes": ["SETTINGS_WRITE"],
        "x-stability": "stable"
      }
    },
    "/settings/requirements/mode-count": {
      "get": {
        "description": "What setting a device’s switch to `every_order` or `never` would change, as the screen’s confirm asks: how many open quotes and orders made there start or stop needing it (of the newest 500: `scanned`), among the ones this caller can see, and the confirm’s words. `count` is null when the caller can’t read quotes and orders (a key: a quote or order read scope), as the screen shows no number then. API keys need **Change settings**. Phones see only what their staff member’s role reaches.",
        "operationId": "settings_requirement_mode_count",
        "parameters": [
          {
            "description": "The requirement: `signature` or `deposit`.",
            "in": "query",
            "name": "kind",
            "required": true,
            "schema": {
              "enum": ["signature", "deposit"],
              "type": "string"
            }
          },
          {
            "description": "The device: `admin` or `pos`.",
            "in": "query",
            "name": "device",
            "required": true,
            "schema": {
              "enum": ["admin", "pos"],
              "type": "string"
            }
          },
          {
            "description": "The switch it would move to: `every_order` or `never`.",
            "in": "query",
            "name": "mode",
            "required": true,
            "schema": {
              "enum": ["every_order", "never"],
              "type": "string"
            }
          },
          {
            "description": "A deposit on `every_order`: the % it would ask for (1–100, up to 2 decimals). Open ones needing less now count.",
            "in": "query",
            "name": "percent",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrderRequirementModeCount"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Count what a requirement switch changes",
        "x-rate-weight": 1,
        "x-required-permission": {
          "id": "SETTINGS_ORDERS",
          "label": "Manage order and quote settings"
        },
        "x-required-scopes": ["SETTINGS_WRITE"],
        "x-stability": "stable"
      }
    },
    "/settings/requirements/rows": {
      "patch": {
        "description": "Change one category, template or Shopify product row of a requirement’s list: the devices it counts on, or a deposit row’s %. An Excluded row keeps its 0 (`404` for a %). A rule’s are changed with `PATCH /settings/requirements/rules/{id}`. Products and categories are their own settings (a template’s, a category’s, a Shopify product’s), so this also needs Change the catalog (Manage the catalog), as in the admin. Listed in Settings › Change history as the key. Answers that requirement as `GET /settings/requirements` reads it (its switches, list and why the list isn’t used). API keys need **Change settings**, and **Change the catalog**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "settings_requirement_row_update",
        "parameters": [
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OrderRequirementRowUpdate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrderRequirementKindSaved"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Change an order requirement row",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "SETTINGS_ORDERS",
          "label": "Manage order and quote settings"
        },
        "x-required-scopes": ["SETTINGS_WRITE"],
        "x-required-scopes-all": ["CATALOG_WRITE"],
        "x-stability": "stable"
      },
      "post": {
        "description": "Put product templates, categories or Shopify products on a requirement’s list, as Add products and Add categories do, on the devices given (a deposit at its `percent`). One already on the list takes these settings. Up to 250 at a time. Products and categories are their own settings (a template’s, a category’s, a Shopify product’s), so this also needs Change the catalog (Manage the catalog), as in the admin. Listed in Settings › Change history as the key. Answers that requirement as `GET /settings/requirements` reads it (its switches, list and why the list isn’t used). API keys need **Change settings**, and **Change the catalog**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "settings_requirement_rows_add",
        "parameters": [
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OrderRequirementRowsAdd"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrderRequirementKindSaved"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Put items on an order requirement list",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "SETTINGS_ORDERS",
          "label": "Manage order and quote settings"
        },
        "x-required-scopes": ["SETTINGS_WRITE"],
        "x-required-scopes-all": ["CATALOG_WRITE"],
        "x-stability": "stable"
      }
    },
    "/settings/requirements/rows/remove": {
      "post": {
        "description": "Take category, template or Shopify product rows off a requirement’s list (an Excluded row included): a template or product follows its categories again, a category stops asking. Up to 250 at a time. Products and categories are their own settings (a template’s, a category’s, a Shopify product’s), so this also needs Change the catalog (Manage the catalog), as in the admin. Listed in Settings › Change history as the key. Answers that requirement as `GET /settings/requirements` reads it (its switches, list and why the list isn’t used). API keys need **Change settings**, and **Change the catalog**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "settings_requirement_rows_remove",
        "parameters": [
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OrderRequirementRowsRemove"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrderRequirementKindSaved"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Take items off an order requirement list",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "SETTINGS_ORDERS",
          "label": "Manage order and quote settings"
        },
        "x-required-scopes": ["SETTINGS_WRITE"],
        "x-required-scopes-all": ["CATALOG_WRITE"],
        "x-stability": "stable"
      }
    },
    "/settings/requirements/rules": {
      "post": {
        "description": "Add a rule to a requirement’s list, as the rule builder’s Save: a name unique on the list, the devices, a deposit’s %, and its conditions (`rule_fields` of `GET /settings/requirements` says what each field takes). Checked as the builder checks it (a contradiction or an empty value is `422 REFUSED` with its sentence); 100 rules a list. Listed in Settings › Change history as the key. Answers that requirement as `GET /settings/requirements` reads it (its switches, list and why the list isn’t used). `201`, with `saved_id`. API keys need **Change settings**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "settings_requirement_rule_create",
        "parameters": [
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OrderRequirementRuleCreate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrderRequirementKindSaved"
                }
              }
            },
            "description": "Created"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Create an order requirement rule",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "SETTINGS_ORDERS",
          "label": "Manage order and quote settings"
        },
        "x-required-scopes": ["SETTINGS_WRITE"],
        "x-stability": "stable"
      }
    },
    "/settings/requirements/rules/preview": {
      "post": {
        "description": "What a rule would match now, without saving it, as the builder’s “Matches N open quotes and orders”: how many open ones made on the devices given match (of the newest 500: `scanned`), among those this caller can see, with up to three of them (`matches`). Nothing changes. `count` is null when the caller can’t read quotes and orders (a key: a quote or order read scope). API keys need **Change settings**. An `Idempotency-Key` header makes a retry safe: the same key and body returns the first answer. Phones see only what their staff member’s role reaches.",
        "operationId": "settings_requirement_rule_preview",
        "parameters": [
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OrderRequirementRulePreviewBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrderRequirementRulePreview"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Preview an order requirement rule",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "SETTINGS_ORDERS",
          "label": "Manage order and quote settings"
        },
        "x-required-scopes": ["SETTINGS_WRITE"],
        "x-stability": "stable"
      }
    },
    "/settings/requirements/rules/{id}": {
      "delete": {
        "description": "Delete a rule from its list. Listed in Settings › Change history as the key. Answers that requirement as `GET /settings/requirements` reads it (its switches, list and why the list isn’t used). API keys need **Change settings**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "settings_requirement_rule_delete",
        "parameters": [
          {
            "description": "The rule’s `id`: a row of `type` `rule` in `signature.rows` or `deposit.rows` of `GET /settings/requirements`.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrderRequirementKindSaved"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Delete an order requirement rule",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "SETTINGS_ORDERS",
          "label": "Manage order and quote settings"
        },
        "x-required-scopes": ["SETTINGS_WRITE"],
        "x-stability": "stable"
      },
      "patch": {
        "description": "Change a rule (only the fields sent): its name, devices, a deposit rule’s %, or its conditions (the whole tree, checked as the builder checks it: a pick the rule already holds whose record is gone is kept as stored and listed in `no_longer_found`). Listed in Settings › Change history as the key. Answers that requirement as `GET /settings/requirements` reads it (its switches, list and why the list isn’t used). API keys need **Change settings**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "settings_requirement_rule_update",
        "parameters": [
          {
            "description": "The rule’s `id`: a row of `type` `rule` in `signature.rows` or `deposit.rows` of `GET /settings/requirements`.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OrderRequirementRuleUpdate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrderRequirementKindSaved"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Change an order requirement rule",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "SETTINGS_ORDERS",
          "label": "Manage order and quote settings"
        },
        "x-required-scopes": ["SETTINGS_WRITE"],
        "x-stability": "stable"
      }
    },
    "/settings/requirements/rules/{id}/duplicate": {
      "post": {
        "description": "Copy a rule onto the same list as “<name> (copy)”, as the list’s Duplicate. Listed in Settings › Change history as the key. Answers that requirement as `GET /settings/requirements` reads it (its switches, list and why the list isn’t used). `201`, with the copy’s `saved_id`. API keys need **Change settings**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "settings_requirement_rule_duplicate",
        "parameters": [
          {
            "description": "The rule’s `id`: a row of `type` `rule` in `signature.rows` or `deposit.rows` of `GET /settings/requirements`.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Empty"
              }
            }
          },
          "required": false
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrderRequirementKindSaved"
                }
              }
            },
            "description": "Created"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Duplicate an order requirement rule",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "SETTINGS_ORDERS",
          "label": "Manage order and quote settings"
        },
        "x-required-scopes": ["SETTINGS_WRITE"],
        "x-stability": "stable"
      }
    },
    "/settings/signature-records": {
      "get": {
        "description": "Settings › Account and data › Signature records, read only: how long signature records are kept and what happens then (`purge`: files and personal details deleted after a notice; `keep`: listed for a person to delete), how many are due, how many were deleted, the oldest signature, and the standing legal holds. A person changes the retention, deletes records past their time and places or lifts holds there (and on the order page); a key can’t. Needs Export and hold signature records (a key: Export signed contracts, a sensitive scope ticked on its own). API keys need **Export signed contracts**. Phones see only what their staff member’s role reaches.",
        "operationId": "settings_signature_records",
        "parameters": [],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SignatureRecordsSettings"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get signature records settings",
        "x-rate-weight": 1,
        "x-required-permission": {
          "id": "SIGNATURE_RECORDS",
          "label": "Export and hold signature records"
        },
        "x-required-scopes": ["CONTRACTS_EXPORT"],
        "x-stability": "stable"
      }
    },
    "/settings/sms-templates": {
      "get": {
        "description": "The SMS templates a status can send (`sms_template_key`), as the status dialog lists them: each with its `key`, name and text. API keys need **Read settings** or **Change settings**.",
        "operationId": "settings_sms_templates",
        "parameters": [],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SmsTemplateList"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "List SMS templates",
        "x-rate-weight": 1,
        "x-required-scopes": ["SETTINGS_READ", "SETTINGS_WRITE"],
        "x-stability": "stable"
      }
    },
    "/settings/sms-templates/{key}/test": {
      "post": {
        "description": "Text a test of the SMS template to one phone number (`to`, E.164 such as `+15551234567`), with sample data, as Settings’ Send test does. Refused with the store’s reason when it can’t send (SMS not set up, the test allowance used, the number opted out). API keys need **Change settings**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice.",
        "operationId": "settings_sms_template_test",
        "parameters": [
          {
            "description": "The SMS template’s `key`, from `GET /settings/sms-templates`.",
            "in": "path",
            "name": "key",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SmsTest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SmsTestSent"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Send a test text",
        "x-rate-weight": 5,
        "x-required-scopes": ["SETTINGS_WRITE"],
        "x-stability": "stable"
      }
    },
    "/settings/status-groups": {
      "post": {
        "description": "Add a customer group (placed last): what customers see a status as. API keys need **Change settings**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "settings_status_group_create",
        "parameters": [
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SettingsStatusGroupWrite"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SettingsStatusGroup"
                }
              }
            },
            "description": "Created"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Create a customer group",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "SETTINGS_ORDERS",
          "label": "Manage order and quote settings"
        },
        "x-required-scopes": ["SETTINGS_WRITE"],
        "x-stability": "stable"
      }
    },
    "/settings/status-groups/reorder": {
      "post": {
        "description": "Put the customer groups in this order (groups left out keep their order after them). API keys need **Change settings**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "settings_status_groups_reorder",
        "parameters": [
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SettingsStatusGroupsReorder"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SettingsStatusList"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Reorder customer groups",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "SETTINGS_ORDERS",
          "label": "Manage order and quote settings"
        },
        "x-required-scopes": ["SETTINGS_WRITE"],
        "x-stability": "stable"
      }
    },
    "/settings/status-groups/{id}": {
      "delete": {
        "description": "Delete an empty customer group you added (`409 IN_USE` while statuses are in it). The seven default groups stay. API keys need **Change settings**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "settings_status_group_delete",
        "parameters": [
          {
            "description": "The customer group’s `id` (in `groups` of `GET /settings/statuses`).",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SettingsDeleted"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Delete a customer group",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "SETTINGS_ORDERS",
          "label": "Manage order and quote settings"
        },
        "x-required-scopes": ["SETTINGS_WRITE"],
        "x-stability": "stable"
      },
      "patch": {
        "description": "Rename a customer group or change what customers read under it. API keys need **Change settings**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "settings_status_group_update",
        "parameters": [
          {
            "description": "The customer group’s `id` (in `groups` of `GET /settings/statuses`).",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SettingsStatusGroupWrite"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SettingsStatusGroup"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Change a customer group",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "SETTINGS_ORDERS",
          "label": "Manage order and quote settings"
        },
        "x-required-scopes": ["SETTINGS_WRITE"],
        "x-stability": "stable"
      }
    },
    "/settings/status-map": {
      "get": {
        "description": "The status map: the draft’s cards and connections (`draft`, with `draft_updated_at` to send back), what is published, the statuses and groups, and the choices a connection’s conditions and actions take. API keys need **Read settings** or **Change settings**.",
        "operationId": "settings_status_map",
        "parameters": [],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StatusMapEditor"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "See the status map",
        "x-rate-weight": 1,
        "x-required-scopes": ["SETTINGS_READ", "SETTINGS_WRITE"],
        "x-stability": "stable"
      }
    },
    "/settings/status-map/check-open-orders": {
      "post": {
        "description": "Check the open orders now, as after a publish: every open order in a status the published map moves orders out of is checked within seconds, and moved where a connection says. Also needs Change order status (a key: Create and change quotes or Change orders). API keys need **Change settings**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "settings_status_map_check",
        "parameters": [
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Empty"
              }
            }
          },
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StatusMapChecksQueued"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Check open orders now",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "SETTINGS_ORDERS",
          "label": "Manage order and quote settings"
        },
        "x-required-scopes": ["SETTINGS_WRITE"],
        "x-stability": "stable"
      }
    },
    "/settings/status-map/discard": {
      "post": {
        "description": "Throw the draft away: it becomes what is published again. API keys need **Change settings**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "settings_status_map_discard",
        "parameters": [
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/StatusMapStamp"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StatusMapEditor"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Discard the status map draft",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "SETTINGS_ORDERS",
          "label": "Manage order and quote settings"
        },
        "x-required-scopes": ["SETTINGS_WRITE"],
        "x-stability": "stable"
      }
    },
    "/settings/status-map/draft": {
      "post": {
        "description": "Save the status map’s draft, as the editor does: the whole document (`draft` as read, changed). Nothing runs until it is published. Checked as the editor checks it: `422 VALIDATION` lists the problems by connection or card. Send the map’s `version` from the last answer (or `expected_updated_at`): a draft changed since is `409 STALE_VERSION` with the current `version`. API keys need **Change settings**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "settings_status_map_draft",
        "parameters": [
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/StatusMapDraftSave"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StatusMapDraftSaved"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Save the status map draft",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "SETTINGS_ORDERS",
          "label": "Manage order and quote settings"
        },
        "x-required-scopes": ["SETTINGS_WRITE"],
        "x-stability": "stable"
      }
    },
    "/settings/status-map/publish": {
      "post": {
        "description": "Publish the draft: it becomes a new version and starts moving orders. Checked as Publish checks it (`422 VALIDATION` with the problems); a draft that says what is live makes no version. Listed in Settings › Change history as the key. API keys need **Change settings**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "settings_status_map_publish",
        "parameters": [
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/StatusMapStamp"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StatusMapEditor"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Publish the status map",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "SETTINGS_ORDERS",
          "label": "Manage order and quote settings"
        },
        "x-required-scopes": ["SETTINGS_WRITE"],
        "x-stability": "stable"
      }
    },
    "/settings/status-map/test": {
      "post": {
        "description": "Test on an order: what the map (the draft, or the published one) would do with one quote or order now, or if a When happened now, without moving anything. Also needs View quotes and orders (a key: a quote or order read scope). API keys need **Change settings**. An `Idempotency-Key` header makes a retry safe: the same key and body returns the first answer. Phones see only what their staff member’s role reaches.",
        "operationId": "settings_status_map_test",
        "parameters": [
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/StatusMapTest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StatusMapTestResult"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Test the status map on an order",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "SETTINGS_ORDERS",
          "label": "Manage order and quote settings"
        },
        "x-required-scopes": ["SETTINGS_WRITE"],
        "x-stability": "stable"
      }
    },
    "/settings/status-map/versions": {
      "get": {
        "description": "The published versions of the status map, newest first (up to 100). API keys need **Read settings** or **Change settings**.",
        "operationId": "settings_status_map_versions",
        "parameters": [],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StatusMapVersions"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "List status map versions",
        "x-rate-weight": 1,
        "x-required-scopes": ["SETTINGS_READ", "SETTINGS_WRITE"],
        "x-stability": "stable"
      }
    },
    "/settings/status-map/versions/{id}": {
      "get": {
        "description": "One published version’s cards and connections, read-only. API keys need **Read settings** or **Change settings**.",
        "operationId": "settings_status_map_version",
        "parameters": [
          {
            "description": "The version’s `id` from `GET /settings/status-map/versions`.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StatusMapVersionPreview"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "See a status map version",
        "x-rate-weight": 1,
        "x-required-scopes": ["SETTINGS_READ", "SETTINGS_WRITE"],
        "x-stability": "stable"
      }
    },
    "/settings/status-map/versions/{id}/restore": {
      "post": {
        "description": "Make a published version the draft again (its connections to statuses deleted since are left out and counted). Nothing runs until it is published; `problems` says what to fix first. API keys need **Change settings**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "settings_status_map_restore",
        "parameters": [
          {
            "description": "The version’s `id` from `GET /settings/status-map/versions`.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/StatusMapStamp"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StatusMapRestored"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Restore a status map version",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "SETTINGS_ORDERS",
          "label": "Manage order and quote settings"
        },
        "x-required-scopes": ["SETTINGS_WRITE"],
        "x-stability": "stable"
      }
    },
    "/settings/status-map/vocabulary": {
      "get": {
        "description": "What a status map connection is written with, as the editor offers it: the Whens (`event`, each with its `choices` for `event_choices`), the events that can unlock a button (`unlock_event`), the handover methods, the condition fields (by `scope`, with their type, and their values or the `options` list of `GET /settings/status-map` they come from), the comparisons each type takes, and the actions (the app’s own marked `system`). The same for every store. API keys need **Read settings** or **Change settings**.",
        "operationId": "settings_status_map_vocabulary",
        "parameters": [],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StatusMapVocabulary"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "See the status map vocabulary",
        "x-rate-weight": 1,
        "x-required-scopes": ["SETTINGS_READ", "SETTINGS_WRITE"],
        "x-stability": "stable"
      }
    },
    "/settings/statuses": {
      "get": {
        "description": "Settings › Statuses: every status with its settings (group, colour, whether it is public, locked, active, its Needs attention limit and its texts), in their order, and the customer groups. API keys need **Read settings** or **Change settings**.",
        "operationId": "settings_statuses",
        "parameters": [],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SettingsStatusList"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "List status settings",
        "x-rate-weight": 1,
        "x-required-scopes": ["SETTINGS_READ", "SETTINGS_WRITE"],
        "x-stability": "stable"
      },
      "post": {
        "description": "Add a status (placed last), as the status dialog’s Save. In the Quote group it waits to be placed. The live status map draws the app’s own connections for it at once. API keys need **Change settings**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "settings_status_create",
        "parameters": [
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SettingsStatusCreate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SettingsStatus"
                }
              }
            },
            "description": "Created"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Create a status",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "SETTINGS_ORDERS",
          "label": "Manage order and quote settings"
        },
        "x-required-scopes": ["SETTINGS_WRITE"],
        "x-stability": "stable"
      }
    },
    "/settings/statuses/move": {
      "post": {
        "description": "Move statuses between customer groups, as dragging them does: each one’s group and position. The Quote group’s rules apply (`409 CONFLICT` with the reason). API keys need **Change settings**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "settings_statuses_move",
        "parameters": [
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SettingsStatusesMove"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SettingsStatusesMoved"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Move statuses between groups",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "SETTINGS_ORDERS",
          "label": "Manage order and quote settings"
        },
        "x-required-scopes": ["SETTINGS_WRITE"],
        "x-stability": "stable"
      }
    },
    "/settings/statuses/reorder": {
      "post": {
        "description": "Set statuses’ positions in the list (only those sent move; nothing else about them changes). API keys need **Change settings**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "settings_statuses_reorder",
        "parameters": [
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SettingsStatusesReorder"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SettingsStatusList"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Reorder statuses",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "SETTINGS_ORDERS",
          "label": "Manage order and quote settings"
        },
        "x-required-scopes": ["SETTINGS_WRITE"],
        "x-stability": "stable"
      }
    },
    "/settings/statuses/{id}": {
      "delete": {
        "description": "Delete a status. Refused with `409 IN_USE` while quotes or orders are in it, or while the published status map has connections to or from it (remove them and publish first). A system status can’t be deleted. API keys need **Change settings**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "settings_status_delete",
        "parameters": [
          {
            "description": "The status’s `id` from `GET /settings/statuses`.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SettingsDeleted"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Delete a status",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "SETTINGS_ORDERS",
          "label": "Manage order and quote settings"
        },
        "x-required-scopes": ["SETTINGS_WRITE"],
        "x-stability": "stable"
      },
      "patch": {
        "description": "Change a status, as the status dialog’s Save: only the fields sent. A system status keeps its name, stays on and keeps whether it waits to be placed; a status with records can’t leave or join the Quote group (`409 CONFLICT`). API keys need **Change settings**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "settings_status_update",
        "parameters": [
          {
            "description": "The status’s `id` from `GET /settings/statuses`.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SettingsStatusUpdate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SettingsStatus"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Edit a status",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "SETTINGS_ORDERS",
          "label": "Manage order and quote settings"
        },
        "x-required-scopes": ["SETTINGS_WRITE"],
        "x-stability": "stable"
      }
    },
    "/settings/vendor-wording": {
      "get": {
        "description": "The vendor wording (Settings › Purchasing and accounting › Vendors › Vendor wording), as saved. API keys need **Read settings** or **Change settings**.",
        "operationId": "settings_vendor_wording",
        "parameters": [],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SettingsVendorWording"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "See the vendor wording",
        "x-rate-weight": 1,
        "x-required-scopes": ["SETTINGS_READ", "SETTINGS_WRITE"],
        "x-stability": "stable"
      },
      "patch": {
        "description": "Change the vendor wording (Settings › Purchasing and accounting › Vendors › Vendor wording), as its Save does: send only the fields to change. Each changed field needs the admin’s permission for it, and the change is listed in Settings › Change history as the key. API keys need **Change settings**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "settings_vendor_wording_update",
        "parameters": [
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SettingsVendorWordingUpdate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SettingsVendorWording"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Change the vendor wording",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "SETTINGS_PURCHASING",
          "label": "Manage purchasing settings"
        },
        "x-required-scopes": ["SETTINGS_WRITE"],
        "x-stability": "stable"
      }
    },
    "/settings/warranty-coverage": {
      "get": {
        "description": "The warranty coverage settings (Settings › Products › Warranty coverage), as saved. API keys need **Read settings** or **Change settings**.",
        "operationId": "settings_warranty_coverage",
        "parameters": [],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SettingsWarrantyCoverage"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "See the warranty coverage settings",
        "x-rate-weight": 1,
        "x-required-scopes": ["SETTINGS_READ", "SETTINGS_WRITE"],
        "x-stability": "stable"
      },
      "patch": {
        "description": "Change the warranty coverage settings (Settings › Products › Warranty coverage), as its Save does: send only the fields to change. Each changed field needs the admin’s permission for it, and the change is listed in Settings › Change history as the key. API keys need **Change settings**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "settings_warranty_coverage_update",
        "parameters": [
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SettingsWarrantyCoverageUpdate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SettingsWarrantyCoverage"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Change the warranty coverage settings",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "SETTINGS_SHOP",
          "label": "Manage shop settings"
        },
        "x-required-scopes": ["SETTINGS_WRITE"],
        "x-stability": "stable"
      }
    },
    "/settings/warranty/category-rules": {
      "post": {
        "description": "Add a step 3 rule: a category’s term, for every vendor or one vendor (a rule reaches the category’s subcategories too). One rule per category and vendor: another is `409 CONFLICT`. Answers the ladder. Listed in Settings › Change history as the key. Needs Manage shop settings (a key: Change settings). API keys need **Change settings**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "settings_warranty_category_rule_create",
        "parameters": [
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WarrantyCategoryRuleCreate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WarrantyLadder"
                }
              }
            },
            "description": "Created"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Add a category warranty rule",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "SETTINGS_SHOP",
          "label": "Manage shop settings"
        },
        "x-required-scopes": ["SETTINGS_WRITE"],
        "x-stability": "stable"
      }
    },
    "/settings/warranty/category-rules/{id}": {
      "delete": {
        "description": "Delete a category rule, with the exceptions set on it. Answers the ladder. Listed in Settings › Change history as the key. Needs Manage shop settings (a key: Change settings). API keys need **Change settings**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "settings_warranty_category_rule_delete",
        "parameters": [
          {
            "description": "The category rule’s `id` from `category_rules` of `GET /settings/warranty/ladder`.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WarrantyLadder"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Delete a category warranty rule",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "SETTINGS_SHOP",
          "label": "Manage shop settings"
        },
        "x-required-scopes": ["SETTINGS_WRITE"],
        "x-stability": "stable"
      },
      "patch": {
        "description": "Change a category rule’s term (null: follow the step above). Answers the ladder. Listed in Settings › Change history as the key. Needs Manage shop settings (a key: Change settings). API keys need **Change settings**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "settings_warranty_category_rule_update",
        "parameters": [
          {
            "description": "The category rule’s `id` from `category_rules` of `GET /settings/warranty/ladder`.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WarrantyTermEdit"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WarrantyLadder"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Change a category warranty rule",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "SETTINGS_SHOP",
          "label": "Manage shop settings"
        },
        "x-required-scopes": ["SETTINGS_WRITE"],
        "x-stability": "stable"
      }
    },
    "/settings/warranty/claims": {
      "get": {
        "description": "Settings › Products › Claims: the claim number, how long a replacement is covered, which emails start ticked, paid repairs, the labour rate, what a job sheet prints, and the two reason lists (what went wrong, why a claim is declined). API keys need **Read settings** or **Change settings**.",
        "operationId": "settings_warranty_claims",
        "parameters": [],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WarrantyClaimSettings"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "See the claim settings",
        "x-rate-weight": 1,
        "x-required-scopes": ["SETTINGS_READ", "SETTINGS_WRITE"],
        "x-stability": "stable"
      },
      "patch": {
        "description": "Change the claim settings, as the page’s Save: only the fields sent. The next number can’t go under a number a claim already holds. Answers the settings. Listed in Settings › Change history as the key. Needs Manage shop settings (a key: Change settings). API keys need **Change settings**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "settings_warranty_claims_update",
        "parameters": [
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WarrantyClaimSettingsEdit"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WarrantyClaimSettings"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Change the claim settings",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "SETTINGS_SHOP",
          "label": "Manage shop settings"
        },
        "x-required-scopes": ["SETTINGS_WRITE"],
        "x-stability": "stable"
      }
    },
    "/settings/warranty/claims/reasons": {
      "post": {
        "description": "Add a reason at the end of its list (up to 50 a list): a `problem` customers pick, or a `decline` reason with the message the customer is sent. Answers the settings. Listed in Settings › Change history as the key. Needs Manage shop settings (a key: Change settings). API keys need **Change settings**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "settings_warranty_claim_reason_add",
        "parameters": [
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WarrantyClaimReasonAdd"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WarrantyClaimSettings"
                }
              }
            },
            "description": "Created"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Add a claim reason",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "SETTINGS_SHOP",
          "label": "Manage shop settings"
        },
        "x-required-scopes": ["SETTINGS_WRITE"],
        "x-stability": "stable"
      }
    },
    "/settings/warranty/claims/reasons/{id}": {
      "delete": {
        "description": "Remove a reason from its list (archived: claims given it keep it). A list keeps at least one. Answers the settings. Listed in Settings › Change history as the key. Needs Manage shop settings (a key: Change settings). API keys need **Change settings**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "settings_warranty_claim_reason_remove",
        "parameters": [
          {
            "description": "The reason’s `id` from `problem_reasons` or `decline_reasons` of `GET /settings/warranty/claims`.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WarrantyClaimSettings"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Remove a claim reason",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "SETTINGS_SHOP",
          "label": "Manage shop settings"
        },
        "x-required-scopes": ["SETTINGS_WRITE"],
        "x-stability": "stable"
      },
      "patch": {
        "description": "Rename a reason or change a decline reason’s message. Claims already given it keep their own copy. Answers the settings. Listed in Settings › Change history as the key. Needs Manage shop settings (a key: Change settings). API keys need **Change settings**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "settings_warranty_claim_reason_update",
        "parameters": [
          {
            "description": "The reason’s `id` from `problem_reasons` or `decline_reasons` of `GET /settings/warranty/claims`.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WarrantyClaimReasonEdit"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WarrantyClaimSettings"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Change a claim reason",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "SETTINGS_SHOP",
          "label": "Manage shop settings"
        },
        "x-required-scopes": ["SETTINGS_WRITE"],
        "x-stability": "stable"
      }
    },
    "/settings/warranty/claims/reasons/{id}/move": {
      "post": {
        "description": "Move a reason one place `up` or `down` its list (at either end nothing moves). Answers the settings. Listed in Settings › Change history as the key. Needs Manage shop settings (a key: Change settings). API keys need **Change settings**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "settings_warranty_claim_reason_move",
        "parameters": [
          {
            "description": "The reason’s `id` from `problem_reasons` or `decline_reasons` of `GET /settings/warranty/claims`.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WarrantyClaimReasonMove"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WarrantyClaimSettings"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Move a claim reason",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "SETTINGS_SHOP",
          "label": "Manage shop settings"
        },
        "x-required-scopes": ["SETTINGS_WRITE"],
        "x-stability": "stable"
      }
    },
    "/settings/warranty/exceptions": {
      "post": {
        "description": "Add a step 4 exception: one option’s own term at a step (the store default, a vendor or a category rule), 12 months unless `months` says otherwise. One per option and step: another is `409 CONFLICT`. Answers the ladder. Listed in Settings › Change history as the key. Needs Manage shop settings (a key: Change settings). API keys need **Change settings**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "settings_warranty_exception_add",
        "parameters": [
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WarrantyExceptionAdd"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WarrantyLadder"
                }
              }
            },
            "description": "Created"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Add an option warranty exception",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "SETTINGS_SHOP",
          "label": "Manage shop settings"
        },
        "x-required-scopes": ["SETTINGS_WRITE"],
        "x-stability": "stable"
      }
    },
    "/settings/warranty/exceptions/{id}": {
      "delete": {
        "description": "Remove an exception: the option follows its step’s term again. Answers the ladder. Listed in Settings › Change history as the key. Needs Manage shop settings (a key: Change settings). API keys need **Change settings**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "settings_warranty_exception_remove",
        "parameters": [
          {
            "description": "The exception’s `id` from `exceptions` of `GET /settings/warranty/ladder`.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WarrantyLadder"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Remove an option warranty exception",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "SETTINGS_SHOP",
          "label": "Manage shop settings"
        },
        "x-required-scopes": ["SETTINGS_WRITE"],
        "x-stability": "stable"
      },
      "patch": {
        "description": "Change an exception’s term in months (0: the option is excluded). Answers the ladder. Listed in Settings › Change history as the key. Needs Manage shop settings (a key: Change settings). API keys need **Change settings**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "settings_warranty_exception_update",
        "parameters": [
          {
            "description": "The exception’s `id` from `exceptions` of `GET /settings/warranty/ladder`.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WarrantyExceptionEdit"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WarrantyLadder"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Change an option warranty exception",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "SETTINGS_SHOP",
          "label": "Manage shop settings"
        },
        "x-required-scopes": ["SETTINGS_WRITE"],
        "x-stability": "stable"
      }
    },
    "/settings/warranty/ladder": {
      "get": {
        "description": "Settings › Products › Warranty coverage, steps 1–4: the store default, every vendor with its own term (or none), the category rules and the option exceptions, as saved, with the term quick picks. Months: `0` is no warranty, null is not set (follows the step above). What a step reaches is counted in products. API keys need **Read settings** or **Change settings**.",
        "operationId": "settings_warranty_ladder",
        "parameters": [],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WarrantyLadder"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "See the warranty ladder",
        "x-rate-weight": 1,
        "x-required-scopes": ["SETTINGS_READ", "SETTINGS_WRITE"],
        "x-stability": "stable"
      }
    },
    "/settings/warranty/plans": {
      "get": {
        "description": "Settings › Products › Warranty plans: the extended-warranty plans the store sells (price, months, what each covers, how many were sold). A plan’s `cost` to the store is there only with See costs (`costs_hidden` says why otherwise). API keys need **Read settings** or **Change settings**.",
        "operationId": "settings_warranty_plans",
        "parameters": [
          {
            "description": "`true` lists archived plans too (after the live ones). Default `false`.",
            "in": "query",
            "name": "include_archived",
            "required": false,
            "schema": {
              "enum": ["true", "false"],
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WarrantyPlanList"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "List warranty plans",
        "x-rate-weight": 1,
        "x-required-scopes": ["SETTINGS_READ", "SETTINGS_WRITE"],
        "x-stability": "stable"
      },
      "post": {
        "description": "Add a plan, as the plan editor’s Save: name (unique), price, months it adds, and what it covers (the whole product, or the options in `option_ids`). `cost` needs See costs and Enter and correct costs (a key: `COSTS_WRITE`). Answers every plan, archived ones included. Listed in Settings › Change history as the key. Needs Manage shop settings (a key: Change settings). API keys need **Change settings**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "settings_warranty_plan_create",
        "parameters": [
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WarrantyPlanCreate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WarrantyPlanList"
                }
              }
            },
            "description": "Created"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Create a warranty plan",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "SETTINGS_SHOP",
          "label": "Manage shop settings"
        },
        "x-required-scopes": ["SETTINGS_WRITE"],
        "x-stability": "stable"
      }
    },
    "/settings/warranty/plans/{id}": {
      "delete": {
        "description": "Delete a plan that was never sold; one that was is refused (archive it instead). Answers every plan. Listed in Settings › Change history as the key. Needs Manage shop settings (a key: Change settings). API keys need **Change settings**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "settings_warranty_plan_delete",
        "parameters": [
          {
            "description": "The plan’s `id` from `GET /settings/warranty/plans`.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WarrantyPlanList"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Delete a warranty plan",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "SETTINGS_SHOP",
          "label": "Manage shop settings"
        },
        "x-required-scopes": ["SETTINGS_WRITE"],
        "x-stability": "stable"
      },
      "patch": {
        "description": "Change a plan: only the fields sent. Plans already sold keep their name, months and price. Changing `cost` needs See costs and Enter and correct costs (a key: `COSTS_WRITE`). What it covers is `POST /settings/warranty/plans/{id}/covers`. Answers every plan. Listed in Settings › Change history as the key. Needs Manage shop settings (a key: Change settings). API keys need **Change settings**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "settings_warranty_plan_update",
        "parameters": [
          {
            "description": "The plan’s `id` from `GET /settings/warranty/plans`.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WarrantyPlanEdit"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WarrantyPlanList"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Change a warranty plan",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "SETTINGS_SHOP",
          "label": "Manage shop settings"
        },
        "x-required-scopes": ["SETTINGS_WRITE"],
        "x-stability": "stable"
      }
    },
    "/settings/warranty/plans/{id}/archive": {
      "post": {
        "description": "Archive a plan (no longer offered; sold plans keep it) or bring it back (`archived: false`). Answers every plan. Listed in Settings › Change history as the key. Needs Manage shop settings (a key: Change settings). API keys need **Change settings**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "settings_warranty_plan_archive",
        "parameters": [
          {
            "description": "The plan’s `id` from `GET /settings/warranty/plans`.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WarrantyPlanArchive"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WarrantyPlanList"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Archive or restore a warranty plan",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "SETTINGS_SHOP",
          "label": "Manage shop settings"
        },
        "x-required-scopes": ["SETTINGS_WRITE"],
        "x-stability": "stable"
      }
    },
    "/settings/warranty/plans/{id}/covers": {
      "post": {
        "description": "Set what a plan covers, replacing what it covered: the whole product (options added later included), or the options listed. Answers every plan. Listed in Settings › Change history as the key. Needs Manage shop settings (a key: Change settings). API keys need **Change settings**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "settings_warranty_plan_covers",
        "parameters": [
          {
            "description": "The plan’s `id` from `GET /settings/warranty/plans`.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WarrantyPlanCovers"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WarrantyPlanList"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Set what a warranty plan covers",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "SETTINGS_SHOP",
          "label": "Manage shop settings"
        },
        "x-required-scopes": ["SETTINGS_WRITE"],
        "x-stability": "stable"
      }
    },
    "/settings/warranty/product-terms": {
      "get": {
        "description": "Settings › Products › Warranty coverage › By product (step 5): the product templates with a term of their own (set in the template editor) and the Shopify catalog products with one (set here), up to 500 of each. API keys need **Read settings** or **Change settings**.",
        "operationId": "settings_warranty_product_terms",
        "parameters": [],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WarrantyProductTerms"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "List product warranty terms",
        "x-rate-weight": 1,
        "x-required-scopes": ["SETTINGS_READ", "SETTINGS_WRITE"],
        "x-stability": "stable"
      },
      "post": {
        "description": "Give a Shopify catalog product a term of its own, or change it (one row per product): `months` (0: excluded, null: follows the steps above) and whether its units need a serial number. Up to 2,000 products. Answers the list. Listed in Settings › Change history as the key. Needs Manage shop settings (a key: Change settings). API keys need **Change settings**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "settings_warranty_product_term_set",
        "parameters": [
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WarrantyProductTermSet"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WarrantyProductTerms"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Set a product’s warranty term",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "SETTINGS_SHOP",
          "label": "Manage shop settings"
        },
        "x-required-scopes": ["SETTINGS_WRITE"],
        "x-stability": "stable"
      }
    },
    "/settings/warranty/product-terms/{id}": {
      "delete": {
        "description": "Remove a catalog product’s own term: it follows the steps above again. Answers the list. Listed in Settings › Change history as the key. Needs Manage shop settings (a key: Change settings). API keys need **Change settings**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "settings_warranty_product_term_remove",
        "parameters": [
          {
            "description": "The product term’s `id` from `catalog` of `GET /settings/warranty/product-terms`.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WarrantyProductTerms"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Remove a product’s warranty term",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "SETTINGS_SHOP",
          "label": "Manage shop settings"
        },
        "x-required-scopes": ["SETTINGS_WRITE"],
        "x-stability": "stable"
      }
    },
    "/settings/warranty/store-default": {
      "post": {
        "description": "Set step 1, the store default term: `months` (0 for no warranty) or null to clear it. Answers the ladder. Listed in Settings › Change history as the key. Needs Manage shop settings (a key: Change settings). API keys need **Change settings**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "settings_warranty_store_default",
        "parameters": [
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WarrantyStoreDefault"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WarrantyLadder"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Set the store’s default warranty",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "SETTINGS_SHOP",
          "label": "Manage shop settings"
        },
        "x-required-scopes": ["SETTINGS_WRITE"],
        "x-stability": "stable"
      }
    },
    "/settings/warranty/vendor-terms": {
      "post": {
        "description": "Set step 2, one vendor’s term: `months` (0: no warranty from this vendor) or null to follow the store default. Answers the ladder. Listed in Settings › Change history as the key. Needs Manage shop settings (a key: Change settings). API keys need **Change settings**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "settings_warranty_vendor_term",
        "parameters": [
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WarrantyVendorTerm"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WarrantyLadder"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Set a vendor’s warranty",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "SETTINGS_SHOP",
          "label": "Manage shop settings"
        },
        "x-required-scopes": ["SETTINGS_WRITE"],
        "x-stability": "stable"
      }
    },
    "/setup": {
      "get": {
        "description": "Where the store’s setup checklist (Home, for a new store) stands: each step (whether it applies, is done, or waits for how the team sells), the next step, how the team sells, whether customer emails can go out (the sending domain and from address), the email designs, and the templates a test quote can use. Each step’s action is its own call under `/setup`; a step is done when its data says so. API keys need **Read settings** or **Change settings**.",
        "operationId": "setup",
        "parameters": [],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Setup"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "See the setup progress",
        "x-rate-weight": 1,
        "x-required-scopes": ["SETTINGS_READ", "SETTINGS_WRITE"],
        "x-stability": "stable"
      },
      "patch": {
        "description": "Skip setup (`skipped: true`; Home becomes the dashboard with the setup bar) or take it back up (`false`), finish it (`finished: true`: the list and the bar are gone for good), or tick the iPads step by hand (`pos_ready: true`, as “Mark as done”; it ticks by itself when an OrderPilot tile loads on POS), or say there is nothing to bring over in the import step (`no_data: true`). Answers where setup stands, as `GET /setup` does, so the next step can be read from it. API keys need **Change settings**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "setup_update",
        "parameters": [
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SetupUpdate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Setup"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Skip, resume or finish setup",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "SETTINGS_SHOP",
          "label": "Manage shop settings"
        },
        "x-required-scopes": ["SETTINGS_WRITE"],
        "x-stability": "stable"
      }
    },
    "/setup/brand": {
      "post": {
        "description": "Step 1, “Check your logo and business name”: save the business name and support email and tick the step. Recorded in Settings › Change history as the key. Answers where setup stands, as `GET /setup` does, so the next step can be read from it. API keys need **Change settings**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "setup_brand",
        "parameters": [
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SetupBrand"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Setup"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Confirm the business name",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "SETTINGS_SHOP",
          "label": "Manage shop settings"
        },
        "x-required-scopes": ["SETTINGS_WRITE"],
        "x-stability": "stable"
      }
    },
    "/setup/channels": {
      "post": {
        "description": "Step 2, “Choose how your team sells” (Settings › Business and locations › How you sell): on POS, online, both or neither. The iPads and online store steps apply only where the team sells. Recorded in Settings › Change history as the key. Answers where setup stands, as `GET /setup` does, so the next step can be read from it. API keys need **Change settings**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "setup_channels",
        "parameters": [
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SetupChannels"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Setup"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Choose how the team sells",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "SETTINGS_SHOP",
          "label": "Manage shop settings"
        },
        "x-required-scopes": ["SETTINGS_WRITE"],
        "x-stability": "stable"
      }
    },
    "/setup/customer-emails": {
      "post": {
        "description": "Step 6, “Turn on customer emails”: switch customer emails on (as `send_customer_emails` on `PATCH /settings/email-rules`), only once the sending domain is verified (`409 CONFLICT` before). Recorded in Settings › Change history as the key. Answers where setup stands, as `GET /setup` does, so the next step can be read from it. API keys need **Change settings**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "setup_customer_emails",
        "parameters": [
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Empty"
              }
            }
          },
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Setup"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Turn on customer emails",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "SETTINGS_SHOP",
          "label": "Manage shop settings"
        },
        "x-required-scopes": ["SETTINGS_WRITE"],
        "x-stability": "stable"
      }
    },
    "/setup/email-preview": {
      "post": {
        "description": "One customer email in a design, with sample data, as the design picker previews it: its subject and HTML. Nothing is sent or saved. API keys need **Change settings**. An `Idempotency-Key` header makes a retry safe: the same key and body returns the first answer. Phones see only what their staff member’s role reaches.",
        "operationId": "setup_email_preview",
        "parameters": [
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SetupEmailPreviewRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SetupEmailPreview"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Preview an email design",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "SETTINGS_SHOP",
          "label": "Manage shop settings"
        },
        "x-required-scopes": ["SETTINGS_WRITE"],
        "x-stability": "stable"
      }
    },
    "/setup/email-theme": {
      "post": {
        "description": "Pick the design every customer email uses (Settings › Branding › Emails): the shipped templates are restyled in it, each keeping its own version history. Recorded in Settings › Change history as the key. Answers where setup stands, as `GET /setup` does, so the next step can be read from it. `email_theme_failures` names any template that couldn’t be restyled. API keys need **Change settings**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "setup_email_theme",
        "parameters": [
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SetupEmailTheme"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SetupEmailThemeSet"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Choose the email design",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "SETTINGS_SHOP",
          "label": "Manage shop settings"
        },
        "x-required-scopes": ["SETTINGS_WRITE"],
        "x-stability": "stable"
      }
    },
    "/setup/from-address": {
      "post": {
        "description": "Set the address customer emails come from, on the store’s verified sending domain: send what goes before the @. Refused with `409 CONFLICT` until the domain is verified (its DNS records added). Recorded in Settings › Change history as the key. Answers where setup stands, as `GET /setup` does, so the next step can be read from it. API keys need **Change settings**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "setup_from_address",
        "parameters": [
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SetupFromAddress"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Setup"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Set the email from address",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "SETTINGS_SHOP",
          "label": "Manage shop settings"
        },
        "x-required-scopes": ["SETTINGS_WRITE"],
        "x-stability": "stable"
      }
    },
    "/setup/online-check": {
      "post": {
        "description": "The online store step’s Check again: reads the live theme from Shopify and ticks the step when the OrderPilot block and app embed are on. Answers the progress and `theme` (what was found). API keys need **Change settings**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "setup_online_check",
        "parameters": [
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Empty"
              }
            }
          },
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SetupThemeChecked"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Check the online store setup",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "SETTINGS_SHOP",
          "label": "Manage shop settings"
        },
        "x-required-scopes": ["SETTINGS_WRITE"],
        "x-stability": "stable"
      }
    },
    "/setup/test-quote": {
      "post": {
        "description": "The last step, “Create a test quote”: a real quote for one of the store’s own templates (`test_quote_templates` of `GET /setup`) to the email given, its Shopify customer found or made, at the store’s first location. It sends nothing itself, but as with any new quote, a starting status that announces new quotes emails this address when the store sends order-created emails. A template that can’t be quoted is `409 CONFLICT`; Shopify not finding or making the customer is `502 SHOPIFY_UNAVAILABLE`, with no quote made. Needs Create and edit quotes and orders (a key: Create and change quotes and Create and change customers); a key limited to locations makes it only at one of its own. API keys need **Create and change quotes**, and **Create and change customers**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "setup_test_quote",
        "parameters": [
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SetupTestQuoteRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SetupTestQuote"
                }
              }
            },
            "description": "Created"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Create a test quote",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "ORDERS_EDIT",
          "label": "Create and edit quotes and orders"
        },
        "x-required-scopes": ["QUOTES_WRITE"],
        "x-required-scopes-all": ["CUSTOMERS_WRITE"],
        "x-stability": "stable"
      }
    },
    "/signature-exports": {
      "get": {
        "description": "The store’s latest signature evidence exports (up to 10, newest first), as Settings › Account and data › Signature records lists them: what each covers, who asked for it (a key as “API key: <name>”), how far it is (`queued`, `running`, `ready`, `failed`, `expired`), and its finished ZIP parts. Poll it until the export is `ready`, then open each part with `GET /signature-exports/{id}/parts/{part}`. Needs Export and hold signature records (a key: Export signed contracts, a sensitive scope ticked on its own). API keys need **Export signed contracts**. Phones see only what their staff member’s role reaches.",
        "operationId": "signature_exports",
        "parameters": [],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SignatureExportList"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "List signature exports",
        "x-rate-weight": 1,
        "x-required-permission": {
          "id": "SIGNATURE_RECORDS",
          "label": "Export and hold signature records"
        },
        "x-required-scopes": ["CONTRACTS_EXPORT"],
        "x-stability": "stable"
      },
      "post": {
        "description": "Start a signature evidence export, as Settings › Account and data › Signature records’ Export does: every signature signed between two days (the store’s time, inclusive; up to 20,000), or `all: true` for every one, each with its signed PDF, evidence and signature image, in ZIP parts prepared in the background. Recorded as asked for by “API key: <name>”. `400 INVALID_BODY` (the dates), `409 CONFLICT` (two exports already being prepared), `422 RULE_REFUSED` (none signed then, or too many). Answers 201, `queued`. Needs Export and hold signature records (a key: Export signed contracts, a sensitive scope ticked on its own). API keys need **Export signed contracts**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "signature_export_create",
        "parameters": [
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SignatureExportCreate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SignatureExport"
                }
              }
            },
            "description": "Created"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Start a signature export",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "SIGNATURE_RECORDS",
          "label": "Export and hold signature records"
        },
        "x-required-scopes": ["CONTRACTS_EXPORT"],
        "x-stability": "stable"
      }
    },
    "/signature-exports/{id}/parts/{part}": {
      "get": {
        "description": "One finished ZIP part of an export: its name, size, fingerprint and a link to download it through the API (`GET /signature-exports/{id}/parts/{part}/file`), bound to this key: it opens once, within a minute (it stops when the key is revoked; each opening is counted in the key’s usage). `404` (no such export or part not ready yet), `409 CONFLICT` (the export expired: start it again). Needs Export and hold signature records (a key: Export signed contracts, a sensitive scope ticked on its own). API keys need **Export signed contracts**. Phones see only what their staff member’s role reaches.",
        "operationId": "signature_export_part",
        "parameters": [
          {
            "description": "The export’s `id` from `GET /signature-exports`.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "The part’s number (`parts[].part`, from 1) from `GET /signature-exports`.",
            "in": "path",
            "name": "part",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SignatureExportPartLink"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Open a signature export’s part",
        "x-rate-weight": 1,
        "x-required-permission": {
          "id": "SIGNATURE_RECORDS",
          "label": "Export and hold signature records"
        },
        "x-required-scopes": ["CONTRACTS_EXPORT"],
        "x-stability": "stable"
      }
    },
    "/signature-exports/{id}/parts/{part}/file": {
      "get": {
        "description": "An export’s ZIP part, from the `url` `GET /signature-exports/{id}/parts/{part}` answered: no Authorization header, the link’s `t` is the credential. It is bound to the key that asked for it and opens once, within a minute; a revoked or ended key, a store whose API is off, or a key without Export signed contracts any more is refused (`401 UNAUTHORIZED` for the link itself). Answers `302` to a storage address that works for one minute, as the admin’s download does. Each opening is counted in the key’s usage.",
        "operationId": "signature_export_part_file",
        "parameters": [
          {
            "description": "The export’s `id` from `GET /signature-exports`.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "The part’s number (`parts[].part`, from 1) from `GET /signature-exports`.",
            "in": "path",
            "name": "part",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "The link’s token, as the `url` carries it.",
            "in": "query",
            "name": "t",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/zip": {
                "schema": {
                  "$ref": "#/components/schemas/ZipFile"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [],
        "summary": "Download a signature export’s part",
        "x-rate-weight": 1,
        "x-stability": "stable"
      }
    },
    "/signatures/{id}": {
      "get": {
        "description": "One signature record’s evidence, as Signature history’s Download evidence gives it: the record, how that kind of signing works, and the SHA-256 fingerprints of the document as signed, the stored signed PDF and the paper scan. Reading it queues the signed PDF when it isn’t stored yet. Needs View quotes and orders on the record’s quote or order (a key: Read quotes for a quote’s, Read orders for an order’s). API keys need **Read quotes** or **Read orders**. Phones see only what their staff member’s role reaches.",
        "operationId": "signature",
        "parameters": [
          {
            "description": "The signature record’s `id`: an `items[].id` of its quote’s or order’s signature list.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SignatureEvidence"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get a signature’s evidence",
        "x-rate-weight": 1,
        "x-required-permission": {
          "id": "ORDERS_VIEW",
          "label": "View quotes and orders"
        },
        "x-required-scopes": ["QUOTES_READ", "ORDERS_READ"],
        "x-stability": "stable"
      }
    },
    "/signatures/{id}/paper-scan": {
      "get": {
        "description": "A paper signature’s attached scan: its name, type, fingerprint, who attached it and when, and a link to the file through the API (`GET /signatures/{id}/paper-scan/file`), bound to this key: it opens once, within a minute, and only while the key may still read the record, and each opening is counted in the key’s usage. `404` when no scan is attached (`NOT_STORED` when its file can’t be found), `410 SIGNATURE_PURGED` once its files were deleted at the end of the retention period. Needs View quotes and orders on the record’s quote or order (a key: Read quotes for a quote’s, Read orders for an order’s). API keys need **Read quotes** or **Read orders**. Phones see only what their staff member’s role reaches.",
        "operationId": "signature_paper_scan",
        "parameters": [
          {
            "description": "The signature record’s `id`: an `items[].id` of its quote’s or order’s signature list.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SignaturePaperScanLink"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Open a paper signature’s scan",
        "x-rate-weight": 1,
        "x-required-permission": {
          "id": "ORDERS_VIEW",
          "label": "View quotes and orders"
        },
        "x-required-scopes": ["QUOTES_READ", "ORDERS_READ"],
        "x-stability": "stable"
      },
      "post": {
        "description": "Attach the scan or photo of a paper signature, as Signature history’s Attach scan does: send multipart/form-data with the file in a `file` field, a photo (JPEG, PNG, WebP or HEIC) or a PDF by its bytes, up to 10 MB. Not JSON, but an `Idempotency-Key` header is required all the same: the same key with the same file answers the first upload again (`Idempotent-Replayed: true`). A paper record takes one scan, never replaced or removed: the evidence of what the customer signed. Answers 201 with its SHA-256 and who attached it (a key as “API key: <name>”). `422 SCAN_REFUSED` (not on paper), `409 SCAN_EXISTS`, `409 SIGNATURE_PURGED` (files deleted at the end of retention), `422 FILE_TYPE`. Needs Bypass signature and deposit requirements on a quote or order the caller may change, as Record Signed Copy (a key: Prices and exceptions). API keys need **Prices and exceptions**. Phones see only what their staff member’s role reaches.",
        "operationId": "signature_paper_scan_upload",
        "parameters": [
          {
            "description": "The signature record’s `id`: an `items[].id` of its quote’s or order’s signature list.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "multipart/form-data": {
              "schema": {
                "$ref": "#/components/schemas/Object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SignaturePaperScan"
                }
              }
            },
            "description": "Created"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Upload a paper signature’s scan",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "APPROVALS_REQUIREMENTS",
          "label": "Bypass signature and deposit requirements"
        },
        "x-required-scopes": ["PRICING_WRITE"],
        "x-stability": "stable"
      }
    },
    "/signatures/{id}/paper-scan/file": {
      "get": {
        "description": "The paper scan itself, opened from the `url` `GET /signatures/{id}/paper-scan` answered: no Authorization header, the link’s `t` is the credential. It is bound to the key (or phone) that asked for it and opens once, within a minute (opened again, it is refused): a revoked or ended key, a store whose API is off, or a record the key can’t read any more is refused (`401 UNAUTHORIZED` for the link itself). Each opening is counted in the key’s usage. `Content-Type` is the scan’s (a JPEG, PNG, WebP or HEIC photo, or a PDF).",
        "operationId": "signature_paper_scan_file",
        "parameters": [
          {
            "description": "The signature record’s `id`: an `items[].id` of its quote’s or order’s signature list.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "The link’s token, as the `url` carries it.",
            "in": "query",
            "name": "t",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/octet-stream": {
                "schema": {
                  "$ref": "#/components/schemas/ScanFile"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [],
        "summary": "Download a paper signature’s scan",
        "x-rate-weight": 1,
        "x-stability": "stable"
      }
    },
    "/signatures/{id}/paper-scan/from-url": {
      "post": {
        "description": "Attach the scan or photo of a paper signature, as Signature history’s Attach scan does: fetched from a public https address (not a private or local one, nor one that redirects there): a photo (JPEG, PNG, WebP or HEIC) or a PDF by its bytes, up to 10 MB. A paper record takes one scan, never replaced or removed: the evidence of what the customer signed. Answers 201 with its SHA-256 and who attached it (a key as “API key: <name>”). `422 SCAN_REFUSED` (not on paper), `409 SCAN_EXISTS`, `409 SIGNATURE_PURGED` (files deleted at the end of retention), `422 FILE_TYPE`. Needs Bypass signature and deposit requirements on a quote or order the caller may change, as Record Signed Copy (a key: Prices and exceptions). API keys need **Prices and exceptions**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "signature_paper_scan_from_url",
        "parameters": [
          {
            "description": "The signature record’s `id`: an `items[].id` of its quote’s or order’s signature list.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PaperScanFromUrl"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SignaturePaperScan"
                }
              }
            },
            "description": "Created"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Add a paper signature’s scan from a URL",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "APPROVALS_REQUIREMENTS",
          "label": "Bypass signature and deposit requirements"
        },
        "x-required-scopes": ["PRICING_WRITE"],
        "x-stability": "stable"
      }
    },
    "/signatures/{id}/pdf": {
      "get": {
        "description": "The stored signed PDF of a signature record (the document as signed, with its signature certificate page), never made again from the order. `409 PDF_NOT_READY` with `Retry-After` while it is still being made (asking queues it), `410 SIGNATURE_PURGED` once its files were deleted at the end of the retention period. Needs View quotes and orders on the record’s quote or order (a key: Read quotes for a quote’s, Read orders for an order’s). API keys need **Read quotes** or **Read orders**. Phones see only what their staff member’s role reaches.",
        "operationId": "signature_pdf",
        "parameters": [
          {
            "description": "The signature record’s `id`: an `items[].id` of its quote’s or order’s signature list.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/pdf": {
                "schema": {
                  "$ref": "#/components/schemas/Pdf"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Download a signed PDF",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "ORDERS_VIEW",
          "label": "View quotes and orders"
        },
        "x-required-scopes": ["QUOTES_READ", "ORDERS_READ"],
        "x-stability": "stable"
      }
    },
    "/staff": {
      "get": {
        "description": "The staff who can be credited with a sale, for `salesperson_ids`. Up to 200. API keys need **Read quotes** or **Read orders** or **Create and change quotes** or **Change orders**. Phones see only what their staff member’s role reaches.",
        "operationId": "staff",
        "parameters": [],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StaffList"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "List staff",
        "x-rate-weight": 1,
        "x-required-permission": {
          "id": "ORDERS_VIEW",
          "label": "View quotes and orders"
        },
        "x-required-scopes": [
          "QUOTES_READ",
          "ORDERS_READ",
          "QUOTES_WRITE",
          "ORDERS_WRITE"
        ],
        "x-stability": "stable"
      }
    },
    "/staff/access": {
      "get": {
        "description": "Everyone on Settings › Staff and roles, the store owner first, with their role and the locations they work at, whether they are suspended and when they were last active. 25 a page (`limit` up to 50). An API key needs Manage staff. API keys need **Manage staff**.",
        "operationId": "staff_access",
        "parameters": [
          {
            "description": "People per page, 1–50 (default 25). A larger value is clamped to 50.",
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 25,
              "maximum": 50,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "description": "The `next_cursor` of the previous page.",
            "in": "query",
            "name": "cursor",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StaffAccessList"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "List staff access",
        "x-rate-weight": 1,
        "x-required-scopes": ["STAFF_MANAGE"],
        "x-stability": "stable"
      }
    },
    "/staff/pos-staff": {
      "post": {
        "description": "Add someone POS saw sign in with their PIN who has never opened OrderPilot in the Shopify admin (a `not_in_orderpilot` row of `pos_sign_ins` in `GET /staff/rules`), with the name to show (POS shares none). They start without a role (what people without one get, at every location), so adding them needs a caller who could give that. Then give them a role with `PATCH /staff/{id}/access`. An API key adds no one while POS follows the PIN (who a PIN belongs to is a person’s call there: `403 ACCESS_DENIED`); under the device account’s role it may. The app’s own rules hold: nobody gives a role or reach they don’t have themselves (an API key: what its own scopes and locations hold; the Store administrator role holds every permission, so no key gives it). Needs Assign roles and locations (a key: Manage staff). API keys need **Manage staff**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "staff_pos_add",
        "parameters": [
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/StaffPosAdd"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StaffAccess"
                }
              }
            },
            "description": "Created"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Add POS staff",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "ACCESS_ASSIGN",
          "label": "Assign roles and locations"
        },
        "x-required-scopes": ["STAFF_MANAGE"],
        "x-stability": "stable"
      }
    },
    "/staff/preassignments": {
      "post": {
        "description": "Pre-assign a role to someone who hasn’t opened OrderPilot yet, by the email they sign in to Shopify with: it is theirs, at every location, on their first visit. Sent again for the same email, it replaces the role. Someone who has opened OrderPilot is refused (set their role with `PATCH /staff/{id}/access`). Only someone at every location pre-assigns. The app’s own rules hold: nobody gives a role or reach they don’t have themselves (an API key: what its own scopes and locations hold; the Store administrator role holds every permission, so no key gives it). Needs Assign roles and locations (a key: Manage staff). API keys need **Manage staff**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "staff_preassignment_create",
        "parameters": [
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/StaffPreassignmentCreate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StaffPreassignment"
                }
              }
            },
            "description": "Created"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Pre-assign a role",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "ACCESS_ASSIGN",
          "label": "Assign roles and locations"
        },
        "x-required-scopes": ["STAFF_MANAGE"],
        "x-stability": "stable"
      }
    },
    "/staff/preassignments/{id}": {
      "delete": {
        "description": "Remove a pre-assigned role before its person’s first visit. The app’s own rules hold: nobody gives a role or reach they don’t have themselves (an API key: what its own scopes and locations hold; the Store administrator role holds every permission, so no key gives it). Needs Assign roles and locations (a key: Manage staff). API keys need **Manage staff**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "staff_preassignment_delete",
        "parameters": [
          {
            "description": "The pre-assignment’s `id` from `preassignments` of `GET /staff/rules`.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StaffPreassignmentDeleted"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Remove a pre-assigned role",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "ACCESS_ASSIGN",
          "label": "Assign roles and locations"
        },
        "x-required-scopes": ["STAFF_MANAGE"],
        "x-stability": "stable"
      }
    },
    "/staff/rules": {
      "get": {
        "description": "Staff and roles › Access rules, and who is waiting to be let in: what people without a role get, whose role applies on POS and what POS does when it can’t tell who is signed in, what happens when a discount goes over a role’s limit, the roles pre-assigned to an email (given on their first visit), and the last 30 days of POS sign-ins (`not_in_orderpilot`: someone `POST /staff/pos-staff` can add). An API key needs Manage staff. API keys need **Manage staff**.",
        "operationId": "staff_rules",
        "parameters": [],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StaffRules"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "See the access rules",
        "x-rate-weight": 1,
        "x-required-scopes": ["STAFF_MANAGE"],
        "x-stability": "stable"
      },
      "patch": {
        "description": "Change the access rules, as Staff and roles › Access rules saves them: only the fields sent. A role given automatically must be one the caller could give, and only someone at every location chooses it. Changing what happens over a discount limit needs Override prices with no limit of one’s own. A key never loosens the register (`403`): no POS as the device account’s role, no view-only for an unknown POS user, and, while POS follows the PIN, no role that can use POS for people without one. Narrowing is fine. Changed meanwhile: `409 CONFLICT`; read them again. The app’s own rules hold: nobody gives a role or reach they don’t have themselves (an API key: what its own scopes and locations hold; the Store administrator role holds every permission, so no key gives it). Recorded on Staff and roles’ Activity and the change history. Needs Manage roles (a key: Manage staff). API keys need **Manage staff**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "staff_rules_update",
        "parameters": [
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/StaffRulesUpdate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StaffRules"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Change the access rules",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "ACCESS_ROLES",
          "label": "Create and edit roles"
        },
        "x-required-scopes": ["STAFF_MANAGE"],
        "x-stability": "stable"
      }
    },
    "/staff/{id}/access": {
      "get": {
        "description": "One staff member’s role, locations and suspension, as Staff and roles shows them. API keys need **Manage staff**.",
        "operationId": "staff_member_access",
        "parameters": [
          {
            "description": "The staff member’s `id` from `GET /staff/access`.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StaffAccess"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get a person’s access",
        "x-rate-weight": 1,
        "x-required-scopes": ["STAFF_MANAGE"],
        "x-stability": "stable"
      },
      "patch": {
        "description": "Give a staff member a role (`role_id`, null for none) and the locations they work at (`all_locations`, or `location_ids` from `GET /locations`), as the person’s page on Staff and roles saves them. Only what is sent changes. The app’s own rules hold: nobody changes the store owner’s access or their own, and nobody gives a role, a permission or a location they don’t have themselves (an API key: what its own scopes and locations hold). Recorded on Staff and roles’ Activity and the settings change history. Needs Assign roles and locations (a key: Manage staff). API keys need **Manage staff**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "staff_access_edit",
        "parameters": [
          {
            "description": "The staff member’s `id` from `GET /staff/access`.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/StaffAccessEdit"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StaffAccess"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Change a person’s access",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "ACCESS_ASSIGN",
          "label": "Assign roles and locations"
        },
        "x-required-scopes": ["STAFF_MANAGE"],
        "x-stability": "stable"
      }
    },
    "/staff/{id}/restore": {
      "post": {
        "description": "Restore a suspended staff member’s access, as Staff and roles’ Restore: they come back on their role (with none, on the role people without one get). Restoring is handing that access out, so it needs a role the caller could give. The app’s own rules hold: nobody changes the store owner’s access or their own, and nobody gives a role, a permission or a location they don’t have themselves (an API key: what its own scopes and locations hold). Needs Assign roles and locations (a key: Manage staff). API keys need **Manage staff**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "staff_restore",
        "parameters": [
          {
            "description": "The staff member’s `id` from `GET /staff/access`.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Empty"
              }
            }
          },
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StaffAccess"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Restore a staff member",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "ACCESS_ASSIGN",
          "label": "Assign roles and locations"
        },
        "x-required-scopes": ["STAFF_MANAGE"],
        "x-stability": "stable"
      }
    },
    "/staff/{id}/suspend": {
      "post": {
        "description": "Suspend a staff member’s access to OrderPilot, with an optional `reason`, as Staff and roles’ Suspend: they can’t open OrderPilot until restored, and their Inbox conversations go back to Unassigned. The app’s own rules hold: nobody changes the store owner’s access or their own, and nobody gives a role, a permission or a location they don’t have themselves (an API key: what its own scopes and locations hold). Needs Assign roles and locations (a key: Manage staff). API keys need **Manage staff**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "staff_suspend",
        "parameters": [
          {
            "description": "The staff member’s `id` from `GET /staff/access`.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/StaffSuspend"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StaffAccess"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Suspend a staff member",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "ACCESS_ASSIGN",
          "label": "Assign roles and locations"
        },
        "x-required-scopes": ["STAFF_MANAGE"],
        "x-stability": "stable"
      }
    },
    "/statuses": {
      "get": {
        "description": "The store’s order and quote statuses, in their order. API keys need **Read quotes** or **Read orders**. Phones see only what their staff member’s role reaches.",
        "operationId": "statuses",
        "parameters": [],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StatusList"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "List statuses",
        "x-rate-weight": 1,
        "x-required-permission": {
          "id": "ORDERS_VIEW",
          "label": "View quotes and orders"
        },
        "x-required-scopes": ["QUOTES_READ", "ORDERS_READ"],
        "x-stability": "stable"
      }
    },
    "/tags": {
      "get": {
        "description": "The tags in use on quotes and orders, for `tags`. Up to 500. API keys need **Read quotes** or **Read orders** or **Create and change quotes** or **Change orders**. Phones see only what their staff member’s role reaches.",
        "operationId": "tags",
        "parameters": [],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TagList"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "List tags",
        "x-rate-weight": 1,
        "x-required-permission": {
          "id": "ORDERS_VIEW",
          "label": "View quotes and orders"
        },
        "x-required-scopes": [
          "QUOTES_READ",
          "ORDERS_READ",
          "QUOTES_WRITE",
          "ORDERS_WRITE"
        ],
        "x-stability": "stable"
      }
    },
    "/today": {
      "get": {
        "description": "What a person’s first screen shows, in one read: the Inbox (the conversation that waits longest for a reply, the tab counts and the unread badge) and the records that need attention now, counted as the admin’s Home counts them. Every part is read inside the person’s own record scope, and a part their role can’t see is null. Signed-in staff only: an API key is refused (the screen is one person’s). Signed-in staff only: an API key is refused with `STAFF_ONLY`.",
        "operationId": "today",
        "parameters": [],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Today"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "See today’s counts",
        "x-rate-weight": 1,
        "x-stability": "stable",
        "x-staff-only": true
      }
    },
    "/token": {
      "post": {
        "description": "Swap a QR code (with its device_code) or a refresh token for an access token.",
        "operationId": "token",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Token"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [],
        "summary": "Get a token",
        "x-rate-weight": 1,
        "x-stability": "stable"
      }
    },
    "/units/{serial}": {
      "get": {
        "description": "The unit with this serial number, as the POS Lookup’s serial page shows it: the product and its order (and customer), when it was sold and whether it was delivered, the warranty cover by part, open claims (with View warranty claims), and the notes saved on it. Only an order the person’s role reaches is found: `404` otherwise, and when no unit has exactly this serial. Needs View quotes and orders (an API key: Read orders, and Read warranty claims for the claims). API keys need **Read orders**. Phones see only what their staff member’s role reaches.",
        "operationId": "unit",
        "parameters": [
          {
            "description": "The serial number as printed or scanned (up to 100 characters).",
            "in": "path",
            "name": "serial",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Unit"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Look up a unit by serial number",
        "x-rate-weight": 1,
        "x-required-permission": {
          "id": "ORDERS_VIEW",
          "label": "View quotes and orders"
        },
        "x-required-scopes": ["ORDERS_READ"],
        "x-stability": "stable"
      }
    },
    "/units/{serial}/notes": {
      "post": {
        "description": "Add a note to a serial unit, as Lookup’s serial page does: a comment on the unit’s order marked with the serial, so it shows in the order’s activity too, signed with the caller’s name (an API key as “API key: <name>”). Answers the unit as `GET /units/{serial}` reads it, with its notes. `404` (no unit has exactly this serial, or its order is out of the caller’s reach), `403` (an order the caller may see but not change). Needs Create and edit quotes and orders on the unit’s order (a key: Change orders). API keys need **Change orders**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "unit_note_create",
        "parameters": [
          {
            "description": "The serial number as printed or scanned (up to 100 characters).",
            "in": "path",
            "name": "serial",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/NoteCreate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Unit"
                }
              }
            },
            "description": "Created"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Add a note to a unit",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "ORDERS_EDIT",
          "label": "Create and edit quotes and orders"
        },
        "x-required-scopes": ["ORDERS_WRITE"],
        "x-stability": "stable"
      }
    },
    "/vendors": {
      "get": {
        "description": "The store’s vendors, A to Z by the name people see. API keys need **Read purchase orders** or **Manage purchase orders**.",
        "operationId": "vendors",
        "parameters": [
          {
            "description": "Items per page, 1–50 (default 25).",
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 25,
              "maximum": 50,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "description": "The `next_cursor` of the previous page.",
            "in": "query",
            "name": "cursor",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Search name, email, phone or contact (up to 100 characters).",
            "in": "query",
            "name": "q",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "true: only active vendors. Leave it out for every vendor; any other value (false too) is `400 INVALID_PARAMETER`.",
            "in": "query",
            "name": "active",
            "required": false,
            "schema": {
              "type": "string",
              "x-values": ["true", "1"]
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VendorList"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "List vendors",
        "x-rate-weight": 1,
        "x-required-scopes": ["PURCHASING_READ", "PURCHASING_WRITE"],
        "x-stability": "stable"
      },
      "post": {
        "description": "Add a vendor. API keys need **Manage purchase orders**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Use a `vendors` import draft (`POST /imports`) for existing records, even one, unless asked otherwise. Outside an import, create from requests or email signatures directly. Phones see only what their staff member’s role reaches.",
        "operationId": "vendor_create",
        "parameters": [
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/VendorCreate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Vendor"
                }
              }
            },
            "description": "Created"
          },
          "202": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReadBackPending"
                }
              }
            },
            "description": "Accepted: the write is done, but its record couldn’t be read back. Don’t send it again: read it with `read`."
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Create a vendor",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "PURCHASING_VENDORS",
          "label": "Manage vendors"
        },
        "x-required-scopes": ["PURCHASING_WRITE"],
        "x-stability": "stable"
      }
    },
    "/vendors/shopify-sync": {
      "post": {
        "description": "Sync vendors from Shopify, as Settings › Vendors’ Sync from Shopify: every product vendor in Shopify becomes a vendor (existing ones are kept). Queued for the worker (one at a time per store); read its state with `GET /vendors/shopify-sync/{jobId}`. Needs Manage vendors. API keys need **Manage purchase orders**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "vendor_sync",
        "parameters": [
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Empty"
              }
            }
          },
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VendorSync"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Sync vendors from Shopify",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "PURCHASING_VENDORS",
          "label": "Manage vendors"
        },
        "x-required-scopes": ["PURCHASING_WRITE"],
        "x-stability": "stable"
      }
    },
    "/vendors/shopify-sync/{jobId}": {
      "get": {
        "description": "Where a vendor sync stands: `queued`, `running`, `completed`, `failed`, or `unknown` once the finished job is cleared. Then read `GET /vendors`. API keys need **Read purchase orders** or **Manage purchase orders**.",
        "operationId": "vendor_sync_state",
        "parameters": [
          {
            "description": "The `job_id` the sync answered.",
            "in": "path",
            "name": "jobId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VendorSync"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get a vendor sync",
        "x-rate-weight": 1,
        "x-required-scopes": ["PURCHASING_READ", "PURCHASING_WRITE"],
        "x-stability": "stable"
      }
    },
    "/vendors/{id}": {
      "delete": {
        "description": "Delete a vendor, as Settings › Vendors’ Delete does, with its activity. Refused (`422 DELETE_REFUSED`) while purchase orders or order lines name it: make it inactive instead (`PATCH /vendors/{id}` with `is_active: false`). Needs Manage vendors (a key: Manage purchase orders and Delete records). It can’t be undone, and counts against the key’s Deletes per day cap. API keys need **Manage purchase orders**, and **Delete records**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "vendor_delete",
        "parameters": [
          {
            "description": "The id from a list.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VendorDeleted"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Delete a vendor",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "PURCHASING_VENDORS",
          "label": "Manage vendors"
        },
        "x-required-scopes": ["PURCHASING_WRITE"],
        "x-required-scopes-all": ["DELETE"],
        "x-stability": "stable"
      },
      "get": {
        "description": "One vendor. API keys need **Read purchase orders** or **Manage purchase orders**.",
        "operationId": "vendor",
        "parameters": [
          {
            "description": "The id from a list.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Vendor"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get a vendor",
        "x-rate-weight": 1,
        "x-required-scopes": ["PURCHASING_READ", "PURCHASING_WRITE"],
        "x-stability": "stable"
      },
      "patch": {
        "description": "Change a vendor’s details; only the fields sent change. `is_active: false` makes it inactive (Settings › Vendors’ Active switch), `true` active again: a vendor purchase orders or order lines name is made inactive rather than deleted. Changing its `email` needs View costs as well (a key: See costs; `403` without it): a purchase order, prices and all, is emailed to that address, and without View costs only to it. The address as stored, sent back, passes. API keys need **Manage purchase orders**. An `Idempotency-Key` header makes a retry safe: the same key and body returns the first answer. Phones see only what their staff member’s role reaches.",
        "operationId": "vendor_edit",
        "parameters": [
          {
            "description": "The id from a list.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/VendorEdit"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Vendor"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Change a vendor",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "PURCHASING_VENDORS",
          "label": "Manage vendors"
        },
        "x-required-scopes": ["PURCHASING_WRITE"],
        "x-stability": "stable"
      }
    },
    "/warehouses": {
      "get": {
        "description": "The store’s warehouses, A to Z: the delivery addresses a purchase order’s `warehouse_id` names (a store delivery to a warehouse). Needs Prepare purchase orders or Manage purchasing settings (a key: Manage purchase orders or Change settings). API keys need **Manage purchase orders** or **Change settings**.",
        "operationId": "warehouses",
        "parameters": [],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WarehouseList"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "List warehouses",
        "x-rate-weight": 1,
        "x-required-scopes": ["PURCHASING_WRITE", "SETTINGS_WRITE"],
        "x-stability": "stable"
      },
      "post": {
        "description": "Add a warehouse, as a purchase order’s New warehouse… or Settings › Purchasing › Warehouses: a delivery address purchase orders can go to (`warehouse_id`). A store has at most 50 (`422 CAP_REACHED`); a name another warehouse has is `409 CONFLICT`. Answers 201 with the warehouse. Needs Prepare purchase orders or Manage purchasing settings (a key: Manage purchase orders or Change settings). API keys need **Manage purchase orders** or **Change settings**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice.",
        "operationId": "warehouse_create",
        "parameters": [
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WarehouseCreate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Warehouse"
                }
              }
            },
            "description": "Created"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Add a warehouse",
        "x-rate-weight": 5,
        "x-required-scopes": ["PURCHASING_WRITE", "SETTINGS_WRITE"],
        "x-stability": "stable"
      }
    },
    "/warehouses/{id}": {
      "delete": {
        "description": "Delete a warehouse from the list. Purchase orders that delivered there keep their address and stop naming it; a default delivery pointing at it (`default_warehouse_id` in the purchase order settings) is cleared. Needs Manage purchasing settings (a key: Change settings). API keys need **Change settings**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "warehouse_delete",
        "parameters": [
          {
            "description": "The warehouse’s `id` from `GET /warehouses`.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WarehouseDeleted"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Delete a warehouse",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "SETTINGS_PURCHASING",
          "label": "Manage purchasing settings"
        },
        "x-required-scopes": ["SETTINGS_WRITE"],
        "x-stability": "stable"
      },
      "patch": {
        "description": "Rename a warehouse or change its address (send either or both; the other is kept). Purchase orders already delivering there keep the address they were given; new ones take this one. A name another warehouse has is `409 CONFLICT`. Needs Manage purchasing settings (a key: Change settings): every future purchase order takes the change, so it is a setting. API keys need **Change settings**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "warehouse_edit",
        "parameters": [
          {
            "description": "The warehouse’s `id` from `GET /warehouses`.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WarehouseEdit"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Warehouse"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Change a warehouse",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "SETTINGS_PURCHASING",
          "label": "Manage purchasing settings"
        },
        "x-required-scopes": ["SETTINGS_WRITE"],
        "x-stability": "stable"
      }
    },
    "/warranty/claims": {
      "get": {
        "description": "The warranty claims queue the app shows: 25 a page, newest activity first, with the tab counts, for claims on orders the person’s role reaches. Needs View warranty claims. API keys need **Read warranty claims** or **Work warranty claims**. Phones see only what their staff member’s role reaches.",
        "operationId": "warranty_claims",
        "parameters": [
          {
            "description": "The `next_cursor` of the previous page (opaque).",
            "in": "query",
            "name": "cursor",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Page number, from 1 (clamped to 1,000): an alternative to `cursor`.",
            "in": "query",
            "name": "page",
            "required": false,
            "schema": {
              "type": "integer"
            }
          },
          {
            "description": "new, in_review, approved, in_progress, resolved or declined, or waiting_vendor for the Waiting on vendor tab (any case). Any other value is `400 INVALID_PARAMETER`.",
            "in": "query",
            "name": "status",
            "required": false,
            "schema": {
              "type": "string",
              "x-values": [
                "new",
                "in_review",
                "approved",
                "in_progress",
                "resolved",
                "declined",
                "waiting_vendor"
              ]
            }
          },
          {
            "description": "Search (up to 100 characters).",
            "in": "query",
            "name": "q",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "A staff id, or `unassigned`.",
            "in": "query",
            "name": "assigned_to",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Only claims on this vendor’s products (a `vendor_options` id).",
            "in": "query",
            "name": "vendor_id",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "phone, email, in_store, online or pos (any case). Any other value is a 400.",
            "in": "query",
            "name": "channel",
            "required": false,
            "schema": {
              "type": "string",
              "x-values": [
                "phone",
                "email",
                "in_store",
                "online",
                "pos",
                "text",
                "on_delivery"
              ]
            }
          },
          {
            "description": "nobody, customer, vendor, part, visit or delivery (any case). Any other value is a 400.",
            "in": "query",
            "name": "waiting_on",
            "required": false,
            "schema": {
              "type": "string",
              "x-values": [
                "nobody",
                "customer",
                "vendor",
                "part",
                "visit",
                "delivery"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WarrantyClaimList"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "List warranty claims",
        "x-rate-weight": 1,
        "x-required-permission": {
          "id": "WARRANTY_CLAIMS_VIEW",
          "label": "View warranty claims"
        },
        "x-required-scopes": ["WARRANTY_READ", "WARRANTY_WRITE"],
        "x-stability": "stable"
      },
      "post": {
        "description": "Start a claim on an order’s units, as the app’s Start a claim. Needs Take and work warranty claims, an order the role reaches at a billed location, and Email customers to send the “we’ve got your claim” email. An API key sends that email with Send emails, and it counts against the key’s Emails per day cap. API keys need **Work warranty claims**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Use a `warranty_claims` import draft (`POST /imports`) for existing records, even one, unless asked otherwise. Outside an import, create from requests or email signatures directly. Phones see only what their staff member’s role reaches.",
        "operationId": "warranty_claim_create",
        "parameters": [
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WarrantyClaimCreate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WarrantyClaimCreated"
                }
              }
            },
            "description": "Created"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Create a warranty claim",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "WARRANTY_CLAIMS_WORK",
          "label": "Manage warranty claims"
        },
        "x-required-scopes": ["WARRANTY_WRITE"],
        "x-stability": "stable"
      }
    },
    "/warranty/claims/{id}": {
      "get": {
        "description": "One claim as its page shows it: status, the units and their cover, the decision, fixes, costs (left out when the person can’t see costs) and the timeline, where notes appear as events of type note. Needs View warranty claims, on an order the role reaches. An API key sees costs with See costs. API keys need **Read warranty claims** or **Work warranty claims**. Phones see only what their staff member’s role reaches. Preview: this endpoint’s shape may still change inside v1.",
        "operationId": "warranty_claim",
        "parameters": [
          {
            "description": "The claim’s `id` from the list.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WarrantyClaim"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get a warranty claim",
        "x-rate-weight": 1,
        "x-required-permission": {
          "id": "WARRANTY_CLAIMS_VIEW",
          "label": "View warranty claims"
        },
        "x-required-scopes": ["WARRANTY_READ", "WARRANTY_WRITE"],
        "x-stability": "preview"
      },
      "patch": {
        "description": "Change who a claim is assigned to (a staff member who can work claims, or null for nobody) and what it waits on, as the claim page does; a `status` moves it under the same rules as `POST /warranty/claims/{id}/status`, and `email_customer` with `resolved` sends “Your claim is resolved”. Only the fields sent change. Needs Manage warranty claims (and Email customers for the email), on an order the role reaches at a billed location. An API key emails with Send emails, one from its Emails per day cap. API keys need **Work warranty claims**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "warranty_claim_edit",
        "parameters": [
          {
            "description": "The claim’s `id` from the list.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WarrantyClaimEdit"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WarrantyClaimEdited"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Change a claim’s assignee or waiting on",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "WARRANTY_CLAIMS_WORK",
          "label": "Manage warranty claims"
        },
        "x-required-scopes": ["WARRANTY_WRITE"],
        "x-stability": "stable"
      }
    },
    "/warranty/claims/{id}/adopt-plan": {
      "post": {
        "description": "Continue an open claim decided before the claim plan with the updated workflow, as the claim page’s Update claim workflow: its $0 replacement order, or a paid repair’s quote, becomes its warranty order, and its costs and steps stay as they are. Another older claim is refused (`409`): change its decision instead. Needs Approve and decline warranty claims (a key: Refunds and returns), on an order the role reaches at a billed location. API keys need **Refunds and returns**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "warranty_claim_adopt_plan",
        "parameters": [
          {
            "description": "The claim’s `id` from the list.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Empty"
              }
            }
          },
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WarrantyClaimPlanAdopted"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Update a claim’s workflow",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "WARRANTY_CLAIMS_DECIDE",
          "label": "Approve and decline warranty claims"
        },
        "x-required-scopes": ["REFUNDS_WRITE"],
        "x-stability": "stable"
      }
    },
    "/warranty/claims/{id}/attachments": {
      "get": {
        "description": "The claim’s photos and files (up to 30), oldest first, each with the repair visit it was taken at (`fix_id`). Needs View warranty claims, on an order the role reaches. API keys need **Read warranty claims** or **Work warranty claims**. Phones see only what their staff member’s role reaches.",
        "operationId": "warranty_claim_attachments",
        "parameters": [
          {
            "description": "The claim’s `id` from the list.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WarrantyClaimAttachmentList"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "List a claim’s files",
        "x-rate-weight": 1,
        "x-required-permission": {
          "id": "WARRANTY_CLAIMS_VIEW",
          "label": "View warranty claims"
        },
        "x-required-scopes": ["WARRANTY_READ", "WARRANTY_WRITE"],
        "x-stability": "stable"
      },
      "post": {
        "description": "Add a photo or file to the claim, up to 10 MB (a claim holds up to 30). Send multipart/form-data with the file in a `file` field, and `?fix_id=` to tie it to a repair visit. Not JSON, but an `Idempotency-Key` header is required all the same: the same key with the same file answers the first upload again (`Idempotent-Replayed: true`) instead of adding it twice. Answers 201 with the file. Needs Take and work warranty claims, on an order the role reaches at a billed location. API keys need **Work warranty claims**. Phones see only what their staff member’s role reaches.",
        "operationId": "warranty_claim_attachment_upload",
        "parameters": [
          {
            "description": "The claim’s `id` from the list.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "The repair visit the photo was taken at: a fix’s `id` from the claim.",
            "in": "query",
            "name": "fix_id",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "multipart/form-data": {
              "schema": {
                "$ref": "#/components/schemas/Object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WarrantyClaimAttachment"
                }
              }
            },
            "description": "Created"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Upload a file to a claim",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "WARRANTY_CLAIMS_WORK",
          "label": "Manage warranty claims"
        },
        "x-required-scopes": ["WARRANTY_WRITE"],
        "x-stability": "stable"
      }
    },
    "/warranty/claims/{id}/attachments/from-url": {
      "post": {
        "description": "Add a photo or file to the claim from its address, as the upload does (for a caller that can’t send multipart form data, such as an agent on MCP): a photo (JPEG, PNG, WebP or GIF) or a PDF of up to 10 MB, fetched from a public https address (a private or local address is refused, and so is one that redirects there), and `fix_id` to tie it to a repair visit. Answers 201 with the file. Needs Take and work warranty claims, on an order the role reaches at a billed location. API keys need **Work warranty claims**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "warranty_claim_attachment_from_url",
        "parameters": [
          {
            "description": "The claim’s `id` from the list.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WarrantyClaimFileFromUrl"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WarrantyClaimAttachment"
                }
              }
            },
            "description": "Created"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Add a file to a claim from a URL",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "WARRANTY_CLAIMS_WORK",
          "label": "Manage warranty claims"
        },
        "x-required-scopes": ["WARRANTY_WRITE"],
        "x-stability": "stable"
      }
    },
    "/warranty/claims/{id}/attachments/{attachmentId}": {
      "delete": {
        "description": "Remove a file from the claim (its timeline says so). Needs Take and work warranty claims, on an order the role reaches at a billed location. API keys need **Work warranty claims**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "warranty_claim_attachment_delete",
        "parameters": [
          {
            "description": "The claim’s `id` from the list.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "The file’s `id` from the claim’s files.",
            "in": "path",
            "name": "attachmentId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WarrantyClaimAttachmentDeleted"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Delete a claim’s file",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "WARRANTY_CLAIMS_WORK",
          "label": "Manage warranty claims"
        },
        "x-required-scopes": ["WARRANTY_WRITE"],
        "x-stability": "stable"
      },
      "get": {
        "description": "A short-lived link (five minutes) that opens one of the claim’s files. Needs View warranty claims, on an order the role reaches. API keys need **Read warranty claims** or **Work warranty claims**. Phones see only what their staff member’s role reaches.",
        "operationId": "warranty_claim_attachment_url",
        "parameters": [
          {
            "description": "The claim’s `id` from the list.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "The file’s `id` from the claim’s files.",
            "in": "path",
            "name": "attachmentId",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WarrantyClaimAttachmentUrl"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Get a link to a claim’s file",
        "x-rate-weight": 1,
        "x-required-permission": {
          "id": "WARRANTY_CLAIMS_VIEW",
          "label": "View warranty claims"
        },
        "x-required-scopes": ["WARRANTY_READ", "WARRANTY_WRITE"],
        "x-stability": "stable"
      }
    },
    "/warranty/claims/{id}/costs": {
      "post": {
        "description": "Add a cost to a claim, as the claim page’s Costs: what it is (part, labour, shipping, other, replacement), a label, the amount and who pays it (the store, the vendor or the customer). A cost the vendor pays opens or updates the vendor claim. A claim holds up to 100 costs. Needs Manage warranty claims and Enter costs and charges (a key: Enter and correct costs), on an order the role reaches at a billed location. API keys need **Work warranty claims**, and **Enter and correct costs**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "warranty_claim_cost_add",
        "parameters": [
          {
            "description": "The claim’s `id` from the list.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WarrantyClaimCostAdd"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WarrantyClaimCost"
                }
              }
            },
            "description": "Created"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Add a cost to a claim",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "WARRANTY_CLAIMS_WORK",
          "label": "Manage warranty claims"
        },
        "x-required-scopes": ["WARRANTY_WRITE"],
        "x-required-scopes-all": ["COSTS_WRITE"],
        "x-stability": "stable"
      }
    },
    "/warranty/claims/{id}/costs/{costId}": {
      "delete": {
        "description": "Remove a cost from a claim (its timeline says so). Needs Manage warranty claims and Enter costs and charges (a key: Enter and correct costs), on an order the role reaches at a billed location. API keys need **Work warranty claims**, and **Enter and correct costs**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "warranty_claim_cost_delete",
        "parameters": [
          {
            "description": "The claim’s `id` from the list.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "The cost’s `id` from the claim’s `costs`.",
            "in": "path",
            "name": "costId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WarrantyClaimCostDeleted"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Remove a claim’s cost",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "WARRANTY_CLAIMS_WORK",
          "label": "Manage warranty claims"
        },
        "x-required-scopes": ["WARRANTY_WRITE"],
        "x-required-scopes-all": ["COSTS_WRITE"],
        "x-stability": "stable"
      },
      "patch": {
        "description": "Change a claim’s cost: its label, amount or who pays it; only the fields sent change. A vendor claim not sent yet follows the vendor’s costs. Needs Manage warranty claims and Enter costs and charges (a key: Enter and correct costs), on an order the role reaches at a billed location. API keys need **Work warranty claims**, and **Enter and correct costs**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "warranty_claim_cost_edit",
        "parameters": [
          {
            "description": "The claim’s `id` from the list.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "The cost’s `id` from the claim’s `costs`.",
            "in": "path",
            "name": "costId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WarrantyClaimCostEdit"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WarrantyClaimCost"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Change a claim’s cost",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "WARRANTY_CLAIMS_WORK",
          "label": "Manage warranty claims"
        },
        "x-required-scopes": ["WARRANTY_WRITE"],
        "x-required-scopes-all": ["COSTS_WRITE"],
        "x-stability": "stable"
      }
    },
    "/warranty/claims/{id}/decision": {
      "post": {
        "description": "Decide a claim, as the claim page’s Decide: covered, partly covered, goodwill, paid repair or declined (with a decline reason), with the plan (the fix, the goodwill share, the warranty order’s lines): a fix sent without lines gets the lines Decide starts from. Goodwill, a typed delivery date or an uncovered unit need Override warranty coverage; priced lines need Enter costs and charges (a key: Enter and correct costs). With lines the warranty order is created or updated, which needs Prices and exceptions for a key; the decision is saved either way and `order_error` says why. Needs Approve and decline warranty claims (a key: Refunds and returns); emailing the customer needs Send emails and counts against the key’s Emails per day cap. API keys need **Refunds and returns**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "warranty_claim_decision",
        "parameters": [
          {
            "description": "The claim’s `id` from the list.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WarrantyClaimDecision"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WarrantyClaimDecided"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Decide a warranty claim",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "WARRANTY_CLAIMS_DECIDE",
          "label": "Approve and decline warranty claims"
        },
        "x-required-scopes": ["REFUNDS_WRITE"],
        "x-stability": "stable"
      }
    },
    "/warranty/claims/{id}/delivery": {
      "post": {
        "description": "Book the replacement’s delivery to the customer: the day, the time window, who takes it, and whether the old unit is picked up on the same trip. Booked again, the delivery moves to the new day. The replacement must be in first (received, or taken from stock). Needs Manage warranty claims, on an order the role reaches at a billed location, and Email customers to tell the customer. An API key emails with Send emails, counted against its Emails per day cap. API keys need **Work warranty claims**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "warranty_claim_delivery",
        "parameters": [
          {
            "description": "The claim’s `id` from the list.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WarrantyClaimDelivery"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WarrantyClaimStepChanged"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Book a replacement’s delivery",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "WARRANTY_CLAIMS_WORK",
          "label": "Manage warranty claims"
        },
        "x-required-scopes": ["WARRANTY_WRITE"],
        "x-stability": "stable"
      }
    },
    "/warranty/claims/{id}/delivery/delivered": {
      "post": {
        "description": "Mark the replacement delivered on a day (not in the future): the replacement is done, cover stops on the units it replaced and the new units’ cover starts that day; what happens to the old unit is kept. `coverage_error` says when the new cover didn’t start. Needs Manage warranty claims and the order’s change scope, on an order the role reaches at a billed location. API keys need **Work warranty claims**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "warranty_claim_delivered",
        "parameters": [
          {
            "description": "The claim’s `id` from the list.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WarrantyClaimDelivered"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WarrantyClaimStepChanged"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Mark a replacement delivered",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "WARRANTY_CLAIMS_WORK",
          "label": "Manage warranty claims"
        },
        "x-required-scopes": ["WARRANTY_WRITE"],
        "x-stability": "stable"
      }
    },
    "/warranty/claims/{id}/emails": {
      "post": {
        "description": "Email the customer about the claim with one of the claim emails, as the claim page does: more information needed or a day and time that suits them (both then wait on the customer), or the claim received, approved, resolved, its repair visit or its delivery booked, each only once it is true. A decline’s email goes with the decision. Needs Manage warranty claims and Email customers (a key: Work warranty claims and Send emails), on an order the role reaches at a billed location. It counts against an API key’s Emails per day cap. API keys need **Work warranty claims**, and **Send emails**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "warranty_claim_email",
        "parameters": [
          {
            "description": "The claim’s `id` from the list.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WarrantyClaimEmail"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WarrantyClaimEmailSent"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Email the customer about a claim",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "WARRANTY_CLAIMS_WORK",
          "label": "Manage warranty claims"
        },
        "x-required-scopes": ["WARRANTY_WRITE"],
        "x-required-scopes-all": ["EMAILS_SEND"],
        "x-stability": "stable"
      }
    },
    "/warranty/claims/{id}/fixes/{fixId}": {
      "patch": {
        "description": "Change one of the claim’s fixes: mark it done or cancelled (or open again), move a visit to another day, window or technician, or change its notes; only the fields sent change. A replacement or money back marked done stops cover on the units it covers, which needs the order’s change scope. Needs Take and work warranty claims, on an order the role reaches at a billed location. API keys need **Work warranty claims**. An `Idempotency-Key` header makes a retry safe: the same key and body returns the first answer. Phones see only what their staff member’s role reaches.",
        "operationId": "warranty_claim_fix_edit",
        "parameters": [
          {
            "description": "The claim’s `id` from the list.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "The fix’s `id` from the claim’s `fixes`.",
            "in": "path",
            "name": "fixId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WarrantyClaimFixEdit"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WarrantyClaimFixChanged"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Change a claim’s fix",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "WARRANTY_CLAIMS_WORK",
          "label": "Manage warranty claims"
        },
        "x-required-scopes": ["WARRANTY_WRITE"],
        "x-stability": "stable"
      }
    },
    "/warranty/claims/{id}/fixes/{fixId}/finish-setup": {
      "post": {
        "description": "Finish setting up a replacement whose $0 order was made but whose warranty and claim weren’t updated, as the claim page’s Finish setup. A replacement already set up is left as it is. Needs Manage warranty claims and Create and edit quotes and orders, on an order the role reaches at a billed location. API keys need **Work warranty claims**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "warranty_claim_replacement_finish",
        "parameters": [
          {
            "description": "The claim’s `id` from the list.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "The replacement’s `id` from the claim’s `fixes`.",
            "in": "path",
            "name": "fixId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Empty"
              }
            }
          },
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WarrantyClaimStepChanged"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Finish a replacement’s setup",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "WARRANTY_CLAIMS_WORK",
          "label": "Manage warranty claims"
        },
        "x-required-scopes": ["WARRANTY_WRITE"],
        "x-stability": "stable"
      }
    },
    "/warranty/claims/{id}/fixes/{fixId}/visit-result": {
      "post": {
        "description": "Record how a repair visit went (fixed, another visit needed, or not fixed), with the minutes spent and notes; the visit is done either way. Needs Take and work warranty claims, on an order the role reaches at a billed location. API keys need **Work warranty claims**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "warranty_claim_visit_result",
        "parameters": [
          {
            "description": "The claim’s `id` from the list.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "The fix’s `id` from the claim’s `fixes`.",
            "in": "path",
            "name": "fixId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WarrantyClaimVisitResult"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WarrantyClaimFixChanged"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Record a repair visit’s result",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "WARRANTY_CLAIMS_WORK",
          "label": "Manage warranty claims"
        },
        "x-required-scopes": ["WARRANTY_WRITE"],
        "x-stability": "stable"
      }
    },
    "/warranty/claims/{id}/goods": {
      "post": {
        "description": "Order the goods the claim still needs (replacement and parts in the decision’s `lines` not yet ordered or taken from stock; none is `409`) from the product’s vendor on one purchase order to the store, as the claim page’s Order from the vendor. Lines are costed (the original’s cost, the part’s price) only with Enter costs and charges (a key: Enter and correct costs), and not when the vendor pays. With `send` it goes to the vendor straight away; a send that fails leaves the draft and says why in `warning`. Needs Manage warranty claims and Prepare purchase orders (and Send and cancel purchase orders to send), on an order the role reaches at a billed location the caller may create purchase orders at. An API key needs Manage purchase orders, and Send emails to send (one from its Emails per day cap). API keys need **Work warranty claims**, and **Manage purchase orders**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "warranty_claim_goods_order",
        "parameters": [
          {
            "description": "The claim’s `id` from the list.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WarrantyClaimGoodsOrder"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WarrantyClaimGoodsChanged"
                }
              }
            },
            "description": "Created"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Order a claim’s goods",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "WARRANTY_CLAIMS_WORK",
          "label": "Manage warranty claims"
        },
        "x-required-scopes": ["WARRANTY_WRITE"],
        "x-required-scopes-all": ["PURCHASING_WRITE"],
        "x-stability": "stable"
      }
    },
    "/warranty/claims/{id}/goods/from-stock": {
      "post": {
        "description": "Take the goods the claim still needs from the store’s stock instead of ordering them. Needs an open claim whose work can start and Manage warranty claims, on an order the role reaches at a billed location. API keys need **Work warranty claims**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "warranty_claim_goods_from_stock",
        "parameters": [
          {
            "description": "The claim’s `id` from the list.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Empty"
              }
            }
          },
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WarrantyClaimGoodsChanged"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Take a claim’s goods from stock",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "WARRANTY_CLAIMS_WORK",
          "label": "Manage warranty claims"
        },
        "x-required-scopes": ["WARRANTY_WRITE"],
        "x-stability": "stable"
      }
    },
    "/warranty/claims/{id}/goods/{purchaseOrderId}/problem": {
      "post": {
        "description": "The claim’s goods arrived damaged or wrong: their receipt is taken back on the same purchase order (stock out again, the purchase order waits on the vendor again), the claim’s finished part steps open again, and, with `email`, the vendor is emailed to send them again; `email_error` says why that email wasn’t sent. Needs Manage warranty claims and Correct receipts (and Send and cancel purchase orders for the email), on a claim at a billed location and a purchase order the caller reaches. An API key needs Manage purchase orders, and Send emails for the email (one from its Emails per day cap). API keys need **Work warranty claims**, and **Manage purchase orders**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "warranty_claim_goods_problem",
        "parameters": [
          {
            "description": "The claim’s `id` from the list.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "The purchase order’s `id`: a `purchase_order_id` on one of the claim’s `fixes`.",
            "in": "path",
            "name": "purchaseOrderId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WarrantyClaimGoodsProblem"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WarrantyClaimGoodsChanged"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Report a claim’s goods damaged or wrong",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "WARRANTY_CLAIMS_WORK",
          "label": "Manage warranty claims"
        },
        "x-required-scopes": ["WARRANTY_WRITE"],
        "x-required-scopes-all": ["PURCHASING_WRITE"],
        "x-stability": "stable"
      }
    },
    "/warranty/claims/{id}/goods/{purchaseOrderId}/receive": {
      "post": {
        "description": "Receive in full the claim’s goods still to come on its purchase order, as the claim page’s Mark received (the purchase order’s own receive: stock in, its receipt and costs). The purchase order must be sent and not finalized. Needs Manage warranty claims and Receive items, on a claim at a billed location and a purchase order the caller reaches. An API key needs Manage purchase orders. API keys need **Work warranty claims**, and **Manage purchase orders**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "warranty_claim_goods_receive",
        "parameters": [
          {
            "description": "The claim’s `id` from the list.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "The purchase order’s `id`: a `purchase_order_id` on one of the claim’s `fixes`.",
            "in": "path",
            "name": "purchaseOrderId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Empty"
              }
            }
          },
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WarrantyClaimGoodsChanged"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Receive a claim’s goods",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "WARRANTY_CLAIMS_WORK",
          "label": "Manage warranty claims"
        },
        "x-required-scopes": ["WARRANTY_WRITE"],
        "x-required-scopes-all": ["PURCHASING_WRITE"],
        "x-stability": "stable"
      }
    },
    "/warranty/claims/{id}/goods/{purchaseOrderId}/send": {
      "post": {
        "description": "Send the claim’s draft purchase order to its vendor, as the purchase order page’s Send: Draft → Sending → Sent once the email with its PDF is accepted (back to Draft if it can’t be queued), Sent at once when the vendor has no email address. Needs Manage warranty claims and Send and cancel purchase orders, on a claim at a billed location and a purchase order the caller reaches. An API key needs Manage purchase orders and Send emails, and each send counts against its Emails per day cap. API keys need **Work warranty claims**, and **Manage purchase orders** and **Send emails**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "warranty_claim_goods_send",
        "parameters": [
          {
            "description": "The claim’s `id` from the list.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "The purchase order’s `id`: a `purchase_order_id` on one of the claim’s `fixes`.",
            "in": "path",
            "name": "purchaseOrderId",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Empty"
              }
            }
          },
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WarrantyClaimGoodsChanged"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Send a claim’s purchase order",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "WARRANTY_CLAIMS_WORK",
          "label": "Manage warranty claims"
        },
        "x-required-scopes": ["WARRANTY_WRITE"],
        "x-required-scopes-all": ["PURCHASING_WRITE", "EMAILS_SEND"],
        "x-stability": "stable"
      }
    },
    "/warranty/claims/{id}/money-back": {
      "post": {
        "description": "Record a refund or store credit already given in Shopify for the claim, as the claim page’s Record refund: no money moves here (refund the order with `POST /orders/{id}/refunds`, or give store credit with `POST /warranty/claims/{id}/store-credit`). Warranty cover on the claim’s units stops. Needs Manage warranty claims and the order’s change scope, on an order the role reaches at a billed location. API keys need **Work warranty claims**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "warranty_claim_money_back",
        "parameters": [
          {
            "description": "The claim’s `id` from the list.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WarrantyClaimMoneyBack"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WarrantyClaimStepChanged"
                }
              }
            },
            "description": "Created"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Record a claim’s refund or credit",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "WARRANTY_CLAIMS_WORK",
          "label": "Manage warranty claims"
        },
        "x-required-scopes": ["WARRANTY_WRITE"],
        "x-stability": "stable"
      }
    },
    "/warranty/claims/{id}/notes": {
      "post": {
        "description": "Add an internal note to a claim’s timeline. Needs Take and work warranty claims, on an order the role reaches at a billed location. API keys need **Work warranty claims**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "warranty_claim_note",
        "parameters": [
          {
            "description": "The claim’s `id` from the list.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WarrantyClaimNote"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WarrantyClaimNoteAdded"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Add a note to a claim",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "WARRANTY_CLAIMS_WORK",
          "label": "Manage warranty claims"
        },
        "x-required-scopes": ["WARRANTY_WRITE"],
        "x-stability": "stable"
      }
    },
    "/warranty/claims/{id}/parts": {
      "post": {
        "description": "Order a part for the claim from its product’s vendor, on a draft purchase order (“For claim WC-…” in its notes) raised at the order’s location, shipped to the store or straight to the customer. A cost needs Enter costs and charges (a key: Enter and correct costs). Needs Take and work warranty claims and Prepare purchase orders, on an order the role reaches at a billed location. An API key needs Manage purchase orders as well. API keys need **Work warranty claims**, and **Manage purchase orders**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "warranty_claim_part",
        "parameters": [
          {
            "description": "The claim’s `id` from the list.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WarrantyClaimPart"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WarrantyClaimFixChanged"
                }
              }
            },
            "description": "Created"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Order a part for a claim",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "WARRANTY_CLAIMS_WORK",
          "label": "Manage warranty claims"
        },
        "x-required-scopes": ["WARRANTY_WRITE"],
        "x-required-scopes-all": ["PURCHASING_WRITE"],
        "x-stability": "stable"
      }
    },
    "/warranty/claims/{id}/pickup": {
      "post": {
        "description": "Book the pickup of a claim that collects the product first (money back, or a workshop repair): the day, the time window and who collects it. Booked again before it is collected, the same pickup moves to the new day; cancel it with `PATCH /warranty/claims/{id}/fixes/{fixId}` and status cancelled. Needs Manage warranty claims, on an order the role reaches at a billed location. API keys need **Work warranty claims**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "warranty_claim_pickup",
        "parameters": [
          {
            "description": "The claim’s `id` from the list.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WarrantyClaimPickup"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WarrantyClaimStepChanged"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Book a claim’s pickup",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "WARRANTY_CLAIMS_WORK",
          "label": "Manage warranty claims"
        },
        "x-required-scopes": ["WARRANTY_WRITE"],
        "x-stability": "stable"
      }
    },
    "/warranty/claims/{id}/pickup/collected": {
      "post": {
        "description": "Mark the product collected from the customer on a day (not in the future). Before money back the pickup is then done; a workshop repair’s pickup is done once the product is brought back. Needs Manage warranty claims, on an order the role reaches at a billed location. API keys need **Work warranty claims**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "warranty_claim_pickup_collected",
        "parameters": [
          {
            "description": "The claim’s `id` from the list.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WarrantyClaimDay"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WarrantyClaimStepChanged"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Mark a claim’s pickup collected",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "WARRANTY_CLAIMS_WORK",
          "label": "Manage warranty claims"
        },
        "x-required-scopes": ["WARRANTY_WRITE"],
        "x-stability": "stable"
      }
    },
    "/warranty/claims/{id}/pickup/returned": {
      "post": {
        "description": "Mark a workshop repair’s product brought back to the customer on a day (not in the future): the pickup is done. Needs Manage warranty claims, on an order the role reaches at a billed location. API keys need **Work warranty claims**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "warranty_claim_pickup_returned",
        "parameters": [
          {
            "description": "The claim’s `id` from the list.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WarrantyClaimDay"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WarrantyClaimStepChanged"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Mark a claim’s product brought back",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "WARRANTY_CLAIMS_WORK",
          "label": "Manage warranty claims"
        },
        "x-required-scopes": ["WARRANTY_WRITE"],
        "x-stability": "stable"
      }
    },
    "/warranty/claims/{id}/quote/signature-request": {
      "post": {
        "description": "Email the customer the claim’s warranty quote to sign, as the claim page’s Email for signature (the quote’s own request-signature email). Needs Manage warranty claims and Email customers (a key: Work warranty claims and Send emails), on an order the role reaches at a billed location, and the warranty quote’s change scope. It counts against an API key’s Emails per day cap. API keys need **Work warranty claims**, and **Send emails**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "warranty_claim_quote_signature_request",
        "parameters": [
          {
            "description": "The claim’s `id` from the list.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Empty"
              }
            }
          },
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WarrantyClaimQuoteSignatureRequested"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Email a warranty quote to sign",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "WARRANTY_CLAIMS_WORK",
          "label": "Manage warranty claims"
        },
        "x-required-scopes": ["WARRANTY_WRITE"],
        "x-required-scopes-all": ["EMAILS_SEND"],
        "x-stability": "stable"
      }
    },
    "/warranty/claims/{id}/quote/signed-copy": {
      "post": {
        "description": "Record a copy of the warranty quote the customer signed in store, as POS › Record Signed Copy: who signed it, the day and how. A signature that places the order needs Convert quotes to orders as well (a key: Change orders). Needs Manage warranty claims and Bypass signature and deposit requirements (a key: Work warranty claims and Prices and exceptions), on an order the role reaches at a billed location, and the warranty quote’s change scope. API keys need **Work warranty claims**, and **Prices and exceptions**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "warranty_claim_quote_signed",
        "parameters": [
          {
            "description": "The claim’s `id` from the list.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WarrantyClaimQuoteSigned"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WarrantyClaimQuoteSignedRecorded"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Record a signed warranty quote",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "WARRANTY_CLAIMS_WORK",
          "label": "Manage warranty claims"
        },
        "x-required-scopes": ["WARRANTY_WRITE"],
        "x-required-scopes-all": ["PRICING_WRITE"],
        "x-stability": "stable"
      }
    },
    "/warranty/claims/{id}/reopen": {
      "post": {
        "description": "Reopen a resolved or declined claim, as the claim page’s Reopen: it goes back to In review to be decided again, or to In progress when its warranty order still stands. Needs Approve and decline warranty claims (a key: Refunds and returns), on an order the role reaches at a billed location. API keys need **Refunds and returns**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "warranty_claim_reopen",
        "parameters": [
          {
            "description": "The claim’s `id` from the list.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Empty"
              }
            }
          },
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WarrantyClaimReopened"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Reopen a warranty claim",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "WARRANTY_CLAIMS_DECIDE",
          "label": "Approve and decline warranty claims"
        },
        "x-required-scopes": ["REFUNDS_WRITE"],
        "x-stability": "stable"
      }
    },
    "/warranty/claims/{id}/repair-order": {
      "post": {
        "description": "Link a paid repair claim (decided before the plan) to its repair quote or order: one of the claim’s customer’s, which the caller reaches. A claim on the plan makes its own warranty order instead. Needs Manage warranty claims, on an order the role reaches at a billed location. API keys need **Work warranty claims**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "warranty_claim_repair_order",
        "parameters": [
          {
            "description": "The claim’s `id` from the list.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WarrantyClaimRepairOrder"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WarrantyClaimOrderLinked"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Link a claim’s repair quote",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "WARRANTY_CLAIMS_WORK",
          "label": "Manage warranty claims"
        },
        "x-required-scopes": ["WARRANTY_WRITE"],
        "x-stability": "stable"
      }
    },
    "/warranty/claims/{id}/replacement": {
      "post": {
        "description": "Make a free replacement for the claim’s units (all of them unless `unit_ids` says which): a $0 order in Shopify for the new units, at the order’s location, with their warranty. For a claim decided before the claim plan; on the plan the replacement rides on the warranty order (decide the claim with planned_fix replacement). Needs Manage warranty claims, Create and edit quotes and orders, and Override prices and give discounts (a key: Work warranty claims and Prices and exceptions), on an order the role reaches at a billed location. API keys need **Work warranty claims**, and **Prices and exceptions**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "warranty_claim_replacement",
        "parameters": [
          {
            "description": "The claim’s `id` from the list.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WarrantyClaimReplacement"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WarrantyClaimStepChanged"
                }
              }
            },
            "description": "Created"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Make a free replacement",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "WARRANTY_CLAIMS_WORK",
          "label": "Manage warranty claims"
        },
        "x-required-scopes": ["WARRANTY_WRITE"],
        "x-required-scopes-all": ["PRICING_WRITE"],
        "x-stability": "stable"
      }
    },
    "/warranty/claims/{id}/report": {
      "patch": {
        "description": "Correct what was reported on an open claim: what the customer says, the reason, when the problem started and how the claim came in. Only the fields sent change. Needs Manage warranty claims, on an order the role reaches at a billed location. API keys need **Work warranty claims**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "warranty_claim_report",
        "parameters": [
          {
            "description": "The claim’s `id` from the list.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WarrantyClaimReportEdit"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WarrantyClaimReport"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Correct a claim’s report",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "WARRANTY_CLAIMS_WORK",
          "label": "Manage warranty claims"
        },
        "x-required-scopes": ["WARRANTY_WRITE"],
        "x-stability": "stable"
      }
    },
    "/warranty/claims/{id}/status": {
      "post": {
        "description": "Move a claim to a status, under the app’s own rules for which moves are allowed (a closed claim is reopened with `POST /warranty/claims/{id}/reopen`). Needs Take and work warranty claims, on an order the role reaches at a billed location. API keys need **Work warranty claims**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "warranty_claim_status",
        "parameters": [
          {
            "description": "The claim’s `id` from the list.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WarrantyClaimStatus"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WarrantyClaimStatusChanged"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Change a claim’s status",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "WARRANTY_CLAIMS_WORK",
          "label": "Manage warranty claims"
        },
        "x-required-scopes": ["WARRANTY_WRITE"],
        "x-stability": "stable"
      }
    },
    "/warranty/claims/{id}/store-credit": {
      "post": {
        "description": "Give the customer store credit in Shopify for the claim, in the order’s currency, as the claim page’s Issue store credit now; the claim records it and cover on its units stops. Needs Manage warranty claims and Refund payments (a key: Work warranty claims and Refunds and returns), and the order’s change scope, on an order the role reaches at a billed location. An API key’s credit is checked against its Largest refund cap and counts toward its Daily payment and refund limit. API keys need **Work warranty claims**, and **Refunds and returns**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "warranty_claim_store_credit",
        "parameters": [
          {
            "description": "The claim’s `id` from the list.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WarrantyClaimStoreCredit"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WarrantyClaimStepChanged"
                }
              }
            },
            "description": "Created"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Give store credit for a claim",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "WARRANTY_CLAIMS_WORK",
          "label": "Manage warranty claims"
        },
        "x-required-scopes": ["WARRANTY_WRITE"],
        "x-required-scopes-all": ["REFUNDS_WRITE"],
        "x-stability": "stable"
      }
    },
    "/warranty/claims/{id}/units": {
      "patch": {
        "description": "Set the units an undecided claim is about, as the claim page’s Change units before Decide: the list sent replaces the claim’s units (each a line of the claim’s order and the unit’s position on it, from 0), and each unit’s cover is read again. Needs Manage warranty claims, on an order the role reaches at a billed location. API keys need **Work warranty claims**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "warranty_claim_units",
        "parameters": [
          {
            "description": "The claim’s `id` from the list.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WarrantyClaimUnitsEdit"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WarrantyClaimUnits"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Change a claim’s units",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "WARRANTY_CLAIMS_WORK",
          "label": "Manage warranty claims"
        },
        "x-required-scopes": ["WARRANTY_WRITE"],
        "x-stability": "stable"
      }
    },
    "/warranty/claims/{id}/vendor-ask": {
      "post": {
        "description": "Ask the claim’s vendor about it before deciding, by email (or, with `reminder`, remind them): an undecided claim then waits on the vendor until their answer is recorded or the ask is skipped. Needs a product with a vendor, an open claim, Manage warranty claims and Send and cancel purchase orders (vendor email), on an order the role reaches at a billed location. An API key needs Manage purchase orders and Send emails, and each email counts against its Emails per day cap. API keys need **Work warranty claims**, and **Manage purchase orders** and **Send emails**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "warranty_claim_vendor_ask",
        "parameters": [
          {
            "description": "The claim’s `id` from the list.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WarrantyClaimVendorEmail"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WarrantyClaimVendorAskChanged"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Ask the vendor about a claim",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "WARRANTY_CLAIMS_WORK",
          "label": "Manage warranty claims"
        },
        "x-required-scopes": ["WARRANTY_WRITE"],
        "x-required-scopes-all": ["PURCHASING_WRITE", "EMAILS_SEND"],
        "x-stability": "stable"
      }
    },
    "/warranty/claims/{id}/vendor-ask/answer": {
      "post": {
        "description": "Record what the vendor answered, however it came (email, phone, their portal): approved, approved in part or denied, and what they will do (send a replacement, send a part, pay the store back, or nothing). The claim stops waiting on the vendor. Needs a product with a vendor, an open claim and Manage warranty claims, on an order the role reaches at a billed location. API keys need **Work warranty claims**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "warranty_claim_vendor_answer",
        "parameters": [
          {
            "description": "The claim’s `id` from the list.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WarrantyClaimVendorAnswer"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WarrantyClaimVendorAskChanged"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Record the vendor’s answer",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "WARRANTY_CLAIMS_WORK",
          "label": "Manage warranty claims"
        },
        "x-required-scopes": ["WARRANTY_WRITE"],
        "x-stability": "stable"
      }
    },
    "/warranty/claims/{id}/vendor-ask/skip": {
      "post": {
        "description": "Decide without asking the vendor, and say why; asking later is still possible. Refused once the vendor answered. Needs a product with a vendor, an open claim and Manage warranty claims, on an order the role reaches at a billed location. API keys need **Work warranty claims**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "warranty_claim_vendor_ask_skip",
        "parameters": [
          {
            "description": "The claim’s `id` from the list.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WarrantyClaimVendorAskSkip"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WarrantyClaimVendorAskChanged"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Skip asking the vendor",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "WARRANTY_CLAIMS_WORK",
          "label": "Manage warranty claims"
        },
        "x-required-scopes": ["WARRANTY_WRITE"],
        "x-stability": "stable"
      }
    },
    "/warranty/claims/{id}/vendor-claim": {
      "patch": {
        "description": "Save the claim’s vendor claim (Get paid back), as the claim page does: the vendor’s reference, a note, what they answered (approved, credited or denied), how much they credited and how, or `keep_shortfall` when they credited less than asked and the store keeps the rest. Only the fields sent change. Needs Manage warranty claims and View costs (a key: See costs); the amount credited and keeping the rest need Enter costs and charges (a key: Enter and correct costs). On an order the role reaches at a billed location. API keys need **Work warranty claims**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "warranty_claim_vendor_claim",
        "parameters": [
          {
            "description": "The claim’s `id` from the list.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WarrantyClaimVendorClaimSave"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WarrantyClaimVendorClaimChanged"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Save a claim’s vendor claim",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "WARRANTY_CLAIMS_WORK",
          "label": "Manage warranty claims"
        },
        "x-required-scopes": ["WARRANTY_WRITE"],
        "x-stability": "stable"
      }
    },
    "/warranty/claims/{id}/vendor-claim/asked": {
      "post": {
        "description": "Say the vendor was asked to pay the store back some other way than the claim’s email (their warranty portal, a call): how and on which day. The amount asked is fixed then, as when it is emailed. Needs a cost the vendor pays, Manage warranty claims and View costs (a key: See costs), on an order the role reaches at a billed location. API keys need **Work warranty claims**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "warranty_claim_vendor_claim_asked",
        "parameters": [
          {
            "description": "The claim’s `id` from the list.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WarrantyClaimVendorClaimAsked"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WarrantyClaimVendorClaimChanged"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Mark a vendor claim asked",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "WARRANTY_CLAIMS_WORK",
          "label": "Manage warranty claims"
        },
        "x-required-scopes": ["WARRANTY_WRITE"],
        "x-stability": "stable"
      }
    },
    "/warranty/claims/{id}/vendor-claim/send": {
      "post": {
        "description": "Email the vendor the claim for what they pay back (or, with `reminder`, a reminder). The amount asked is fixed from the first email. Needs a cost the vendor pays, Manage warranty claims, View costs and Send and cancel purchase orders (vendor email), on an order the role reaches at a billed location. An API key needs See costs and, for the email, Manage purchase orders and Send emails; each email counts against its Emails per day cap. API keys need **Work warranty claims**, and **Manage purchase orders** and **Send emails**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "warranty_claim_vendor_claim_send",
        "parameters": [
          {
            "description": "The claim’s `id` from the list.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WarrantyClaimVendorEmail"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WarrantyClaimVendorClaimChanged"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Email a vendor claim",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "WARRANTY_CLAIMS_WORK",
          "label": "Manage warranty claims"
        },
        "x-required-scopes": ["WARRANTY_WRITE"],
        "x-required-scopes-all": ["PURCHASING_WRITE", "EMAILS_SEND"],
        "x-stability": "stable"
      }
    },
    "/warranty/claims/{id}/vendor-email": {
      "post": {
        "description": "Email the claim’s vendor from one of its steps (`collect_old_unit`: the old unit is ready to collect); the timeline records it. Needs a product with a vendor, an open claim, Manage warranty claims and Send and cancel purchase orders (vendor email), on an order the role reaches at a billed location. An API key needs Manage purchase orders and Send emails, and each email counts against its Emails per day cap. API keys need **Work warranty claims**, and **Manage purchase orders** and **Send emails**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "warranty_claim_vendor_email",
        "parameters": [
          {
            "description": "The claim’s `id` from the list.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WarrantyClaimVendorStepEmail"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WarrantyClaimVendorEmailed"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Email a claim’s vendor",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "WARRANTY_CLAIMS_WORK",
          "label": "Manage warranty claims"
        },
        "x-required-scopes": ["WARRANTY_WRITE"],
        "x-required-scopes-all": ["PURCHASING_WRITE", "EMAILS_SEND"],
        "x-stability": "stable"
      }
    },
    "/warranty/claims/{id}/visits": {
      "post": {
        "description": "Book a repair visit (a workshop repair when the claim’s product is collected first): the day, the time window and the technician. A paid repair’s visit waits for the customer’s signature or deposit. Needs Take and work warranty claims, on an order the role reaches at a billed location the person may work at, and Email customers to tell the customer. An API key emails with Send emails, counted against its Emails per day cap. API keys need **Work warranty claims**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "warranty_claim_visit",
        "parameters": [
          {
            "description": "The claim’s `id` from the list.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WarrantyClaimVisit"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WarrantyClaimFixChanged"
                }
              }
            },
            "description": "Created"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Book a repair visit",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "WARRANTY_CLAIMS_WORK",
          "label": "Manage warranty claims"
        },
        "x-required-scopes": ["WARRANTY_WRITE"],
        "x-stability": "stable"
      }
    },
    "/warranty/claims/{id}/warranty-order": {
      "post": {
        "description": "Make the claim’s warranty order from its decision’s lines, at the claim order’s location with the covered prices, or bring a live one in line with the lines, as the claim page’s Warranty order (the decision does this too, and says why it couldn’t in `order_error`). Needs Manage warranty claims, Create and edit orders and Override prices (a key: Work warranty claims and Prices and exceptions), on an order the role reaches at a billed location the caller may create orders at; a live warranty order also needs its own change scope. `409` says why the order wasn’t made. API keys need **Work warranty claims**, and **Prices and exceptions**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "warranty_claim_warranty_order",
        "parameters": [
          {
            "description": "The claim’s `id` from the list.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Empty"
              }
            }
          },
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WarrantyClaimOrderLinked"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Make a claim’s warranty order",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "WARRANTY_CLAIMS_WORK",
          "label": "Manage warranty claims"
        },
        "x-required-scopes": ["WARRANTY_WRITE"],
        "x-required-scopes-all": ["PRICING_WRITE"],
        "x-stability": "stable"
      }
    },
    "/warranty/coverage": {
      "get": {
        "description": "Look up warranty cover as Warranty › Coverage does: one order (`order_id`: its lines, delivered or not), one customer (`customer_id`: everything they bought), units whose serial number starts with `serial`, or a search (`q`: an order number, the customer’s name, email or phone, a product or a serial, every word found). Each order line with its units: whether each arrived and when its cover started, its serial, each part’s term and state, the plans sold, and open claims (with View warranty claims). A search reads delivered orders unless `delivered=false`; a customer or serial look-up reads both. Whole orders a page, newest first (at most 50, and 1,000 units): follow `next_cursor` for the rest. Only orders the caller reaches (a quote by `order_id` with Read quotes); customers' emails only with Read customers. Needs View quotes and orders (a key: Read orders or Read warranty claims). API keys need **Read orders** or **Read warranty claims**. Phones see only what their staff member’s role reaches.",
        "operationId": "warranty_coverage",
        "parameters": [
          {
            "description": "One order’s cover, line by line: the order’s `id`. The other filters are then ignored.",
            "in": "query",
            "name": "order_id",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "One customer’s orders, delivered or not: the customer’s `id` (an order’s `customer.id`), or their Shopify id (a claim’s `order.customer_shopify_id`).",
            "in": "query",
            "name": "customer_id",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Orders with a unit whose serial number starts with this (any case), up to 100 characters; delivered or not.",
            "in": "query",
            "name": "serial",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "A search, up to 100 characters: every word must be found in the order number, the customer’s name, email or phone, a line’s product or a unit’s serial.",
            "in": "query",
            "name": "q",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "`true`: only orders with a delivered unit (a search’s default); `false`: delivered or not (the default for `customer_id` and `serial`).",
            "in": "query",
            "name": "delivered",
            "required": false,
            "schema": {
              "enum": ["true", "false"],
              "type": "string"
            }
          },
          {
            "description": "The `next_cursor` of the previous page of this look-up, sent with the same filters. A cursor from another list is `400 INVALID_CURSOR`.",
            "in": "query",
            "name": "cursor",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WarrantyCoverage"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Look up warranty cover",
        "x-rate-weight": 1,
        "x-required-permission": {
          "id": "ORDERS_VIEW",
          "label": "View quotes and orders"
        },
        "x-required-scopes": ["ORDERS_READ", "WARRANTY_READ"],
        "x-stability": "stable"
      }
    },
    "/warranty/coverage/start": {
      "post": {
        "description": "Start warranty cover by hand, as Warranty › Coverage’s Start cover: records the units as delivered on `delivered_on` (today or earlier, at most five years back) where no delivery was recorded (a pickup, a hand-off, a counter sale), so their cover runs from that day and the order’s status moves as a delivery moves it. Units already covered are left as they are (`already_covered`); a quote is `404` (nothing delivered: place it first). It gives cover the order hasn’t got yet, so it needs Override warranty coverage (a key: Refunds and returns), on an order the caller may change. The order’s activity names who started it. API keys need **Refunds and returns**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "warranty_cover_start",
        "parameters": [
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WarrantyCoverStart"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WarrantyCoverStarted"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Start warranty cover by hand",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "APPROVALS_WARRANTY_OVERRIDE",
          "label": "Override warranty coverage"
        },
        "x-required-scopes": ["REFUNDS_WRITE"],
        "x-stability": "stable"
      }
    },
    "/warranty/expected-cost": {
      "get": {
        "description": "What one unit of a product template is expected to cost in warranty while it is covered, as \"Check a product\" works it out: the rate that applies to it (a rate for its category and vendor, then its category or one above it, then its vendor, else the store’s, Settings › Products › Warranty coverage › Expected warranty cost) applied to the template’s product cost or its price, as the store estimates. Analytics › Profit takes the same off a sale until its cover ends. Worked out from the template’s cost: needs View costs (a key: See costs or Enter and correct costs). API keys need **See costs** or **Enter and correct costs**. Phones see only what their staff member’s role reaches.",
        "operationId": "warranty_expected_cost",
        "parameters": [
          {
            "description": "The product template’s `id`, from `GET /product-templates`.",
            "in": "query",
            "name": "template_id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "The vendor it is sold through, an `id` from `GET /vendors`, for a vendor’s own rate. Left out: no vendor’s rate applies.",
            "in": "query",
            "name": "vendor_id",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WarrantyExpectedCost"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Check a product’s expected warranty cost",
        "x-rate-weight": 1,
        "x-required-permission": {
          "id": "COSTS_VIEW",
          "label": "View costs"
        },
        "x-required-scopes": ["COSTS_READ", "COSTS_WRITE"],
        "x-stability": "stable"
      }
    },
    "/warranty/job-sheets": {
      "get": {
        "description": "A job sheet PDF, as Print job sheet makes it: one booked repair visit, pickup or replacement delivery (`fix_id`), or a day’s jobs (`date`, and `technician_staff_id` for one technician’s), with the claim, the customer, the address, the units and their cover, notes and photos. Amounts print only with View costs (a key: See costs). Only claims on orders the caller reaches; a day with nothing booked is `404`. `503 BUSY` with `Retry-After` while PDFs are being made. Needs View warranty claims (a key: Read or Work warranty claims). API keys need **Read warranty claims** or **Work warranty claims**. Phones see only what their staff member’s role reaches.",
        "operationId": "warranty_job_sheet",
        "parameters": [
          {
            "description": "One booked job: a fix’s `id` from `GET /warranty/claims/{id}` (`fixes[].id`). Send this or `date`.",
            "in": "query",
            "name": "fix_id",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "A day’s jobs, YYYY-MM-DD. Send this or `fix_id`.",
            "in": "query",
            "name": "date",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "With `date`: one technician’s jobs (a staff `id` from the claim’s `staff_options`). Left out: every technician’s.",
            "in": "query",
            "name": "technician_staff_id",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/pdf": {
                "schema": {
                  "$ref": "#/components/schemas/Pdf"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Download a job sheet PDF",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "WARRANTY_CLAIMS_VIEW",
          "label": "View warranty claims"
        },
        "x-required-scopes": ["WARRANTY_READ", "WARRANTY_WRITE"],
        "x-stability": "stable"
      }
    },
    "/warranty/preview": {
      "post": {
        "description": "The warranty cover a basket would get before it is saved, as Create order’s Warranty card previews it. Send the lines you would send `POST /quotes` and, per line, `warranty` changes to try (a term, an option’s exception, a lifted exclusion, a plan). Each line answers its parts with their terms and where they come from, a plan’s price (or why it can’t be sold), and the options an exception can be added for; the store’s plans and term presets come with it. Nothing is saved, and the answer holds while the store’s warranty set-up does. A custom item carries no warranty. A key needs Create and change quotes or Change orders. API keys need **Create and change quotes** or **Change orders**. An `Idempotency-Key` header makes a retry safe: the same key and body returns the first answer.",
        "operationId": "warranty_preview",
        "parameters": [
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WarrantyPreviewInput"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WarrantyPreview"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Preview a basket’s warranty",
        "x-rate-weight": 5,
        "x-required-scopes": ["QUOTES_WRITE", "ORDERS_WRITE"],
        "x-stability": "stable"
      }
    },
    "/warranty/units/goodwill": {
      "post": {
        "description": "Give units goodwill cover, as an order’s Warranty card’s goodwill end date: their whole-product cover runs until `ends_on` (after today, at most 1,200 months away, and later than they are covered already: goodwill only extends), with an optional `note`. An excluded unit is refused (it stays excluded); a quote is `404`. `ends_on: null` removes a goodwill end date. It gives cover the terms didn’t, so it needs Override warranty coverage (a key: Refunds and returns), on an order the caller may change. The order’s activity names who did it. API keys need **Refunds and returns**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "warranty_units_goodwill",
        "parameters": [
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WarrantyUnitsGoodwill"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WarrantyUnitsChanged"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Set a goodwill end date",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "APPROVALS_WARRANTY_OVERRIDE",
          "label": "Override warranty coverage"
        },
        "x-required-scopes": ["REFUNDS_WRITE"],
        "x-stability": "stable"
      }
    },
    "/warranty/units/returned": {
      "post": {
        "description": "Mark units returned, as an order’s Warranty card does: their cover stops on `returned_on` (today when left out; not in the future, not before the unit arrived). `returned: false` undoes a return marked by hand and covers them again (not where a refund or a finished claim ended the cover). Units not delivered or already stopped are skipped (`skipped`, `message`); a quote is `404`. The order’s activity names who did it. Needs Create and edit quotes and orders (a key: Change orders), on an order the caller may change. API keys need **Change orders**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. Phones see only what their staff member’s role reaches.",
        "operationId": "warranty_units_returned",
        "parameters": [
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WarrantyUnitsReturned"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WarrantyUnitsChanged"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Mark units returned",
        "x-rate-weight": 5,
        "x-required-permission": {
          "id": "ORDERS_EDIT",
          "label": "Create and edit quotes and orders"
        },
        "x-required-scopes": ["ORDERS_WRITE"],
        "x-stability": "stable"
      }
    },
    "/webhooks": {
      "get": {
        "description": "This key’s webhooks. API keys need **Manage webhooks**.",
        "operationId": "webhooks",
        "parameters": [],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookList"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "List webhooks",
        "x-rate-weight": 1,
        "x-required-scopes": ["WEBHOOKS_MANAGE"],
        "x-stability": "stable"
      },
      "post": {
        "description": "Register an https endpoint to be told when quotes, orders, customers, payments, conversations, purchase orders or warranty claims change. The signing secret is in the answer. API keys need **Manage webhooks**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. A replay leaves out `secret` (shown once) and adds `secret_redacted: true`.",
        "operationId": "webhook_create",
        "parameters": [
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookCreate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookCreated"
                }
              }
            },
            "description": "Created"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Create a webhook",
        "x-rate-weight": 5,
        "x-required-scopes": ["WEBHOOKS_MANAGE"],
        "x-stability": "stable"
      }
    },
    "/webhooks/{id}": {
      "delete": {
        "description": "Remove one of this key’s webhooks. API keys need **Manage webhooks**. An `Idempotency-Key` header makes a retry safe: the same key and body returns the first answer.",
        "operationId": "webhook_delete",
        "parameters": [
          {
            "description": "The id from a list.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Deleted"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Delete a webhook",
        "x-rate-weight": 5,
        "x-required-scopes": ["WEBHOOKS_MANAGE"],
        "x-stability": "stable"
      }
    },
    "/webhooks/{id}/deliveries": {
      "get": {
        "description": "The webhook’s last 50 deliveries and how they went. API keys need **Manage webhooks**.",
        "operationId": "webhook_deliveries",
        "parameters": [
          {
            "description": "The id from a list.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeliveryList"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "List a webhook’s deliveries",
        "x-rate-weight": 1,
        "x-required-scopes": ["WEBHOOKS_MANAGE"],
        "x-stability": "stable"
      }
    },
    "/webhooks/{id}/ping": {
      "post": {
        "description": "Send a `ping` test event to a webhook now. API keys need **Manage webhooks**. An `Idempotency-Key` header makes a retry safe: the same key and body returns the first answer.",
        "operationId": "webhook_ping",
        "parameters": [
          {
            "description": "The id from a list.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Empty"
              }
            }
          },
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Deleted"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Send a test event",
        "x-rate-weight": 5,
        "x-required-scopes": ["WEBHOOKS_MANAGE"],
        "x-stability": "stable"
      }
    },
    "/webhooks/{id}/rotate-secret": {
      "post": {
        "description": "Give a webhook a new signing secret (the old one stops signing at once). API keys need **Manage webhooks**. Send an `Idempotency-Key` header: a retry with the same key and body returns the first answer instead of writing twice. A replay leaves out `secret` (shown once) and adds `secret_redacted: true`.",
        "operationId": "webhook_rotate_secret",
        "parameters": [
          {
            "description": "The id from a list.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Up to 100 characters (letters, digits, - _ : .). Kept for 24 hours.",
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Empty"
              }
            }
          },
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookCreated"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request isn’t valid (see `error.code`), or the API version isn’t supported."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No valid access token or API key."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The store’s subscription isn’t active."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not allowed: the API is off for this store, or the caller lacks the scope or permission."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Not found, or not visible to this caller."
          },
          "405": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Wrong method for this path; `Allow` lists every method the path takes."
          },
          "408": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body didn’t arrive in time."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The same Idempotency-Key is still being processed (`REQUEST_IN_PROGRESS`), its outcome is unknown (`OUTCOME_UNKNOWN`: check the record), or the record changed since it was read."
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request body is too large."
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid JSON but can’t be done (a rule of the store refuses it), or the Idempotency-Key was used with a different body."
          },
          "426": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The app is older than the oldest version still served (`error.code` CLIENT_TOO_OLD); see `error.min_version` and `error.upgrade_url`."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Over a rate limit; wait `Retry-After` seconds."
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on our side. A write may have partly happened: check the record before retrying it."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Busy, switched off, or billing couldn’t be checked; wait `Retry-After` seconds."
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Rotate a webhook’s secret",
        "x-rate-weight": 5,
        "x-required-scopes": ["WEBHOOKS_MANAGE"],
        "x-stability": "stable"
      }
    }
  },
  "servers": [
    {
      "url": "https://api.meetorderpilot.com/connect/v1"
    }
  ]
}
