{
  "components": {
    "schemas": {
      "Address": {
        "description": "The shopper's delivery address. It goes to the sites that ship the order, never to sellers.",
        "properties": {
          "city": {
            "type": "string"
          },
          "country": {
            "description": "Must match the quote's country.",
            "pattern": "^[A-Z]{2}$",
            "type": "string"
          },
          "lines": {
            "items": {
              "type": "string"
            },
            "maxItems": 4,
            "minItems": 1,
            "type": "array"
          },
          "name": {
            "type": "string"
          },
          "phone": {
            "type": "string"
          },
          "postcode": {
            "description": "Must match the quote's postcode.",
            "type": "string"
          }
        },
        "required": [
          "name",
          "lines",
          "city",
          "postcode",
          "country"
        ],
        "type": "object"
      },
      "CancelRequest": {
        "properties": {
          "reason": {
            "description": "Why, in a sentence. Optional. The site and the sellers whose packs were in the order see it with the cancellation, which tells them it was the shop that sold it (never which shop): leave out the shopper's name and details.",
            "maxLength": 500,
            "type": "string"
          }
        },
        "type": "object"
      },
      "CatalogueItem": {
        "description": "A live listing: a pack offered in a market from one origin.",
        "properties": {
          "alcohol": {
            "type": "boolean"
          },
          "alcohol_abv": {
            "description": "Alcohol by volume, percent. Present only for alcohol.",
            "type": "number"
          },
          "available": {
            "description": "Packs that can be ordered now. 0 when the origin's stock data is over an hour old.",
            "type": "integer"
          },
          "brand": {
            "type": "string"
          },
          "country_of_origin": {
            "type": "string"
          },
          "dimensions_mm": {
            "$ref": "#/components/schemas/Dimensions"
          },
          "gross_weight_g": {
            "type": "integer"
          },
          "gtin": {
            "description": "The consumer unit's GTIN, if it has one.",
            "type": "string"
          },
          "hs_code": {
            "type": "string"
          },
          "labels": {
            "items": {
              "$ref": "#/components/schemas/Label"
            },
            "type": "array"
          },
          "listing_id": {
            "description": "Quote and order with this id.",
            "format": "uuid",
            "type": "string"
          },
          "market": {
            "type": "string"
          },
          "net_quantity": {
            "description": "The net quantity of one unit, as its label states it: 40 g for a case of 12 bars of 40 g, where units_per_pack is 12. Food sold by number gives a count, such as 6 eggs.",
            "examples": [
              "40 g"
            ],
            "type": "string"
          },
          "origin": {
            "$ref": "#/components/schemas/Origin"
          },
          "pack_gtin": {
            "description": "The pack's own GTIN, if it has one.",
            "type": "string"
          },
          "pack_name": {
            "examples": [
              "Oat bars, case of 12"
            ],
            "type": "string"
          },
          "product_name": {
            "type": "string"
          },
          "sku": {
            "type": "string"
          },
          "stock_fresh": {
            "description": "False when the origin's stock data is over an hour old.",
            "type": "boolean"
          },
          "temperature": {
            "enum": [
              "ambient",
              "chilled",
              "frozen"
            ],
            "type": "string"
          },
          "unit_price": {
            "$ref": "#/components/schemas/Money",
            "description": "Per pack: the seller's price plus Kiuki's 10% fee."
          },
          "units_per_pack": {
            "description": "Size: consumer units in one pack.",
            "type": "integer"
          },
          "vat_rate_bp": {
            "description": "VAT rate in basis points (2000 = 20%).",
            "type": "integer"
          }
        },
        "required": [
          "listing_id",
          "market",
          "sku",
          "pack_name",
          "product_name",
          "brand",
          "units_per_pack",
          "gross_weight_g",
          "dimensions_mm",
          "temperature",
          "alcohol",
          "labels",
          "unit_price",
          "vat_rate_bp",
          "available",
          "stock_fresh",
          "origin"
        ],
        "type": "object"
      },
      "CataloguePage": {
        "properties": {
          "currency": {
            "type": "string"
          },
          "items": {
            "items": {
              "$ref": "#/components/schemas/CatalogueItem"
            },
            "type": "array"
          },
          "market": {
            "type": "string"
          },
          "next_cursor": {
            "description": "Pass as cursor for the next page. Absent on the last page.",
            "type": "string"
          }
        },
        "required": [
          "market",
          "currency",
          "items"
        ],
        "type": "object"
      },
      "Charge": {
        "properties": {
          "amount": {
            "$ref": "#/components/schemas/Money"
          },
          "code": {
            "examples": [
              "carriage"
            ],
            "type": "string"
          },
          "label": {
            "examples": [
              "Carriage"
            ],
            "type": "string"
          }
        },
        "required": [
          "code",
          "label",
          "amount"
        ],
        "type": "object"
      },
      "Complaint": {
        "properties": {
          "date_mark": {
            "format": "date",
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "external_ref": {
            "type": "string"
          },
          "id": {
            "format": "uuid",
            "type": "string"
          },
          "kind": {
            "enum": [
              "allergen",
              "label",
              "safety",
              "damaged",
              "missing",
              "other"
            ],
            "type": "string"
          },
          "listing_id": {
            "format": "uuid",
            "type": "string"
          },
          "listing_paused": {
            "description": "The listing was taken off sale for this complaint (allergen, label and safety reports). It comes back on sale only when Kiuki says so.",
            "type": "boolean"
          },
          "lot_code": {
            "type": "string"
          },
          "order_id": {
            "format": "uuid",
            "type": "string"
          },
          "order_line_id": {
            "format": "uuid",
            "type": "string"
          },
          "outcome": {
            "description": "Once resolved: upheld (the problem was real) or not_upheld.",
            "enum": [
              "upheld",
              "not_upheld"
            ],
            "type": "string"
          },
          "reported_at": {
            "format": "date-time",
            "type": "string"
          },
          "resolution": {
            "description": "Once resolved: what Kiuki found and what happens next.",
            "type": "string"
          },
          "resolved_at": {
            "format": "date-time",
            "type": "string"
          },
          "status": {
            "description": "open: Kiuki is looking into it. disputed: the seller answered it and Kiuki is deciding. resolved: Kiuki decided (outcome, resolution).",
            "enum": [
              "open",
              "disputed",
              "resolved"
            ],
            "type": "string"
          }
        },
        "required": [
          "id",
          "order_id",
          "order_line_id",
          "listing_id",
          "kind",
          "description",
          "status",
          "listing_paused",
          "reported_at"
        ],
        "type": "object"
      },
      "ComplaintRequest": {
        "properties": {
          "date_mark": {
            "description": "The best-before or use-by date printed on the pack, if the shopper gave it.",
            "format": "date",
            "type": "string"
          },
          "description": {
            "description": "What the shopper found, in a sentence or two. No names or contact details: the seller reads it.",
            "maxLength": 2000,
            "type": "string"
          },
          "external_ref": {
            "description": "Your own reference for the complaint (your ticket number, say). Makes retries safe.",
            "maxLength": 100,
            "type": "string"
          },
          "kind": {
            "description": "allergen: an allergen the label doesn't declare, or a reaction. label: the label is wrong, unreadable or missing mandatory information. safety: something in the food that shouldn't be, spoiled or unsafe food, or another risk to health. damaged: arrived damaged or leaking. missing: not in the parcel, or the parcel never arrived. other: anything else.",
            "enum": [
              "allergen",
              "label",
              "safety",
              "damaged",
              "missing",
              "other"
            ],
            "type": "string"
          },
          "lot_code": {
            "description": "The lot or batch code printed on the pack, if the shopper gave it.",
            "maxLength": 64,
            "type": "string"
          },
          "order_line_id": {
            "description": "A line of one of your orders (lines[].id in GET /v1/orders/{id}).",
            "format": "uuid",
            "type": "string"
          }
        },
        "required": [
          "order_line_id",
          "kind",
          "description"
        ],
        "type": "object"
      },
      "Contact": {
        "description": "For delivery updates: an email, a phone number, or both.",
        "properties": {
          "email": {
            "format": "email",
            "type": "string"
          },
          "phone": {
            "type": "string"
          }
        },
        "type": "object"
      },
      "Destination": {
        "description": "Where to deliver: country and postcode only.",
        "properties": {
          "country": {
            "examples": [
              "GB"
            ],
            "pattern": "^[A-Z]{2}$",
            "type": "string"
          },
          "postcode": {
            "examples": [
              "SW1A 1AA"
            ],
            "type": "string"
          }
        },
        "required": [
          "country",
          "postcode"
        ],
        "type": "object"
      },
      "Dimensions": {
        "properties": {
          "height": {
            "type": "integer"
          },
          "length": {
            "type": "integer"
          },
          "width": {
            "type": "integer"
          }
        },
        "required": [
          "length",
          "width",
          "height"
        ],
        "type": "object"
      },
      "Error": {
        "properties": {
          "error": {
            "description": "A stable code to branch on: bad_request, not_signed_in, forbidden, not_found, conflict, market_closed, unavailable, quote_expired, quote_blocked, quote_used, external_ref_used, origin_unavailable, out_of_stock, payment_refused, payment_used, not_cancellable, too_large, internal, stripe_unavailable, payments_unavailable. too_large comes with 413 (a body over the endpoint's limit). The last two come with 503: nothing was done, and the same request can be sent again. rate_limited comes with 429: the key sent requests faster than its rate (Retry-After says when to send it again).",
            "type": "string"
          },
          "lines": {
            "description": "Quotes only: every line that can't be bought, and why.",
            "items": {
              "$ref": "#/components/schemas/LineProblem"
            },
            "type": "array"
          },
          "message": {
            "description": "What is wrong and what to do about it, in plain English. Safe to show to a person.",
            "type": "string"
          }
        },
        "required": [
          "error",
          "message"
        ],
        "type": "object"
      },
      "Label": {
        "description": "Mandatory food information for one market, in one language.",
        "properties": {
          "allergens": {
            "items": {
              "enum": [
                "celery",
                "cereals_gluten",
                "crustaceans",
                "eggs",
                "fish",
                "lupin",
                "milk",
                "molluscs",
                "mustard",
                "nuts",
                "peanuts",
                "sesame",
                "soya",
                "sulphites"
              ],
              "type": "string"
            },
            "type": "array"
          },
          "business_name_address": {
            "type": "string"
          },
          "country_of_origin_statement": {
            "type": "string"
          },
          "ingredients": {
            "description": "Allergens are emphasised with **...**.",
            "type": "string"
          },
          "legal_name": {
            "description": "The name of the food.",
            "type": "string"
          },
          "locale": {
            "examples": [
              "en-GB"
            ],
            "type": "string"
          },
          "may_contain": {
            "type": "string"
          },
          "net_quantity": {
            "description": "The net quantity of one unit, as printed on it (40 g, not the 12 x 40 g of a case of 12).",
            "examples": [
              "500 g"
            ],
            "type": "string"
          },
          "nutrition": {
            "description": "Per 100 g or ml: energy_kj, energy_kcal, fat and so on.",
            "type": "object"
          },
          "storage": {
            "type": "string"
          },
          "use_instructions": {
            "type": "string"
          }
        },
        "required": [
          "locale",
          "legal_name",
          "ingredients",
          "allergens",
          "net_quantity",
          "business_name_address"
        ],
        "type": "object"
      },
      "LineProblem": {
        "properties": {
          "code": {
            "enum": [
              "invalid",
              "duplicate",
              "not_on_sale",
              "wrong_market",
              "no_price",
              "stock_stale",
              "not_enough_stock"
            ],
            "type": "string"
          },
          "line": {
            "description": "1-based position of the line in the request.",
            "type": "integer"
          },
          "listing_id": {
            "type": "string"
          },
          "message": {
            "examples": [
              "Line 2 (OATS-12, Oat bars 12 x 40 g): 5 wanted, only 3 available."
            ],
            "type": "string"
          }
        },
        "required": [
          "line",
          "listing_id",
          "code",
          "message"
        ],
        "type": "object"
      },
      "Market": {
        "properties": {
          "active": {
            "description": "Only active markets can be quoted and ordered.",
            "type": "boolean"
          },
          "code": {
            "description": "Great Britain and Northern Ireland are separate markets.",
            "examples": [
              "GB",
              "GB-NIR"
            ],
            "type": "string"
          },
          "country": {
            "pattern": "^[A-Z]{2}$",
            "type": "string"
          },
          "currency": {
            "pattern": "^[A-Z]{3}$",
            "type": "string"
          },
          "locales": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "name": {
            "type": "string"
          },
          "timezone": {
            "examples": [
              "Europe/London"
            ],
            "type": "string"
          }
        },
        "required": [
          "code",
          "name",
          "country",
          "currency",
          "locales",
          "timezone",
          "active"
        ],
        "type": "object"
      },
      "MarketList": {
        "properties": {
          "markets": {
            "items": {
              "$ref": "#/components/schemas/Market"
            },
            "type": "array"
          }
        },
        "required": [
          "markets"
        ],
        "type": "object"
      },
      "Money": {
        "description": "An amount in integer minor units of a currency (pence for GBP). Never a float.",
        "properties": {
          "currency": {
            "examples": [
              "GBP"
            ],
            "pattern": "^[A-Z]{3}$",
            "type": "string"
          },
          "minor": {
            "examples": [
              4950
            ],
            "format": "int64",
            "type": "integer"
          }
        },
        "required": [
          "minor",
          "currency"
        ],
        "type": "object"
      },
      "OneOriginAlternative": {
        "description": "A quote's basket with every pack from one site, priced in full: that site's unit prices for the same packs, and its fulfilment from its rate card (one shipment per temperature). Lines asking for the same pack from different sites become one line here.",
        "properties": {
          "dispatch_days": {
            "description": "The site's dispatch promise, in working days.",
            "type": "integer"
          },
          "fulfilment": {
            "$ref": "#/components/schemas/Money"
          },
          "goods": {
            "$ref": "#/components/schemas/Money"
          },
          "lines": {
            "items": {
              "$ref": "#/components/schemas/OneOriginLine"
            },
            "type": "array"
          },
          "parcels": {
            "description": "Parcels the site would pack the basket into. Compare with the quote's parcels.",
            "type": "integer"
          },
          "saving": {
            "$ref": "#/components/schemas/Money",
            "description": "The quote's total less this total: what taking this alternative saves. Negative when it costs more."
          },
          "shipments": {
            "description": "One per temperature: chilled and frozen travel apart from ambient.",
            "type": "integer"
          },
          "site_id": {
            "description": "Send it to POST /v1/quotes/{id}/one-origin to quote this alternative.",
            "format": "uuid",
            "type": "string"
          },
          "site_name": {
            "type": "string"
          },
          "total": {
            "$ref": "#/components/schemas/Money",
            "description": "goods + fulfilment."
          }
        },
        "required": [
          "site_id",
          "site_name",
          "dispatch_days",
          "shipments",
          "parcels",
          "goods",
          "fulfilment",
          "total",
          "saving",
          "lines"
        ],
        "type": "object"
      },
      "OneOriginLine": {
        "properties": {
          "line_total": {
            "$ref": "#/components/schemas/Money"
          },
          "listing_id": {
            "description": "The pack's listing at the alternative's site.",
            "format": "uuid",
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "pack_id": {
            "format": "uuid",
            "type": "string"
          },
          "qty": {
            "description": "Packs.",
            "type": "integer"
          },
          "quote_lines": {
            "description": "The quote's lines this one takes the place of: one, or several lines of the same pack.",
            "items": {
              "type": "integer"
            },
            "type": "array"
          },
          "sku": {
            "type": "string"
          },
          "unit_price": {
            "$ref": "#/components/schemas/Money",
            "description": "Per pack at that site: its seller's price + Kiuki's fee."
          }
        },
        "required": [
          "quote_lines",
          "listing_id",
          "pack_id",
          "sku",
          "name",
          "qty",
          "unit_price",
          "line_total"
        ],
        "type": "object"
      },
      "OneOriginRequest": {
        "properties": {
          "site_id": {
            "description": "The site to take every pack from: the site_id of one of the quote's one_origin_alternatives.",
            "format": "uuid",
            "type": "string"
          }
        },
        "required": [
          "site_id"
        ],
        "type": "object"
      },
      "OpenAPIDocument": {
        "description": "An OpenAPI 3.1 document: this one.",
        "type": "object"
      },
      "Order": {
        "properties": {
          "cancelled_at": {
            "format": "date-time",
            "type": "string"
          },
          "contact": {
            "$ref": "#/components/schemas/Contact"
          },
          "currency": {
            "type": "string"
          },
          "external_ref": {
            "type": "string"
          },
          "fee": {
            "$ref": "#/components/schemas/Money",
            "description": "Kiuki's distribution fee, included in goods."
          },
          "fulfilment": {
            "$ref": "#/components/schemas/Money"
          },
          "goods": {
            "$ref": "#/components/schemas/Money"
          },
          "id": {
            "format": "uuid",
            "type": "string"
          },
          "market": {
            "type": "string"
          },
          "paid_at": {
            "format": "date-time",
            "type": "string"
          },
          "payment_ref": {
            "description": "The payment the order was placed with (kiuki.com's orders: the shopper's PaymentIntent).",
            "type": "string"
          },
          "placed_at": {
            "format": "date-time",
            "type": "string"
          },
          "quote_id": {
            "format": "uuid",
            "type": "string"
          },
          "ship_to": {
            "$ref": "#/components/schemas/Address"
          },
          "shipments": {
            "items": {
              "$ref": "#/components/schemas/Shipment"
            },
            "type": "array"
          },
          "status": {
            "description": "placed, then paid once payment is taken; in_progress once any shipment is acknowledged; completed once every shipment is dispatched, delivered or cancelled and at least one went; cancelled once every shipment is. Never moves back.",
            "enum": [
              "placed",
              "paid",
              "in_progress",
              "completed",
              "cancelled"
            ],
            "type": "string"
          },
          "total": {
            "$ref": "#/components/schemas/Money"
          }
        },
        "required": [
          "id",
          "external_ref",
          "market",
          "currency",
          "status",
          "ship_to",
          "contact",
          "goods",
          "fee",
          "fulfilment",
          "total",
          "placed_at",
          "shipments"
        ],
        "type": "object"
      },
      "OrderLine": {
        "properties": {
          "cancelled_qty": {
            "type": "integer"
          },
          "id": {
            "format": "uuid",
            "type": "string"
          },
          "line_total": {
            "$ref": "#/components/schemas/Money"
          },
          "listing_id": {
            "format": "uuid",
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "qty": {
            "type": "integer"
          },
          "sku": {
            "type": "string"
          },
          "unit_price": {
            "$ref": "#/components/schemas/Money"
          },
          "vat_rate_bp": {
            "type": "integer"
          }
        },
        "required": [
          "id",
          "listing_id",
          "qty",
          "cancelled_qty",
          "unit_price",
          "line_total",
          "vat_rate_bp"
        ],
        "type": "object"
      },
      "OrderPage": {
        "properties": {
          "next_cursor": {
            "description": "Pass as cursor for the next page. Absent on the last page.",
            "type": "string"
          },
          "orders": {
            "items": {
              "$ref": "#/components/schemas/OrderSummary"
            },
            "type": "array"
          }
        },
        "required": [
          "orders"
        ],
        "type": "object"
      },
      "OrderSummary": {
        "properties": {
          "cancelled_at": {
            "format": "date-time",
            "type": "string"
          },
          "currency": {
            "type": "string"
          },
          "external_ref": {
            "type": "string"
          },
          "fulfilment": {
            "$ref": "#/components/schemas/Money"
          },
          "goods": {
            "$ref": "#/components/schemas/Money"
          },
          "id": {
            "format": "uuid",
            "type": "string"
          },
          "placed_at": {
            "format": "date-time",
            "type": "string"
          },
          "shipments": {
            "items": {
              "$ref": "#/components/schemas/ShipmentSummary"
            },
            "type": "array"
          },
          "status": {
            "type": "string"
          },
          "total": {
            "$ref": "#/components/schemas/Money"
          }
        },
        "required": [
          "id",
          "external_ref",
          "status",
          "currency",
          "goods",
          "fulfilment",
          "total",
          "placed_at",
          "shipments"
        ],
        "type": "object"
      },
      "OrderWithAgeChecks": {
        "allOf": [
          {
            "$ref": "#/components/schemas/Order"
          }
        ],
        "description": "An order, as placing, reading and cancelling it answer: everything in Order, each shipment saying whether it is delivered with an age check.",
        "properties": {
          "shipments": {
            "items": {
              "$ref": "#/components/schemas/ShipmentWithAgeCheck"
            },
            "type": "array"
          }
        },
        "type": "object"
      },
      "Origin": {
        "description": "The site a listing ships from.",
        "properties": {
          "country": {
            "type": "string"
          },
          "dispatch_days": {
            "description": "The site's dispatch promise in working days (at most 3).",
            "type": "integer"
          },
          "name": {
            "type": "string"
          },
          "site_id": {
            "format": "uuid",
            "type": "string"
          }
        },
        "required": [
          "site_id",
          "name",
          "country",
          "dispatch_days"
        ],
        "type": "object"
      },
      "PlaceOrderRequest": {
        "properties": {
          "contact": {
            "$ref": "#/components/schemas/Contact"
          },
          "external_ref": {
            "description": "Your own order id. Sending it again returns the same order.",
            "maxLength": 100,
            "minLength": 1,
            "type": "string"
          },
          "payment_ref": {
            "description": "kiuki.com only, and required from it: the PaymentIntent the shopper paid with on kiuki.com's checkout, on the platform's Stripe account. It is checked (succeeded, same currency, covers the quote's total, not used for another order) before anything is ordered; a refusal is 402 payment_refused or 409 payment_used. Every other aggregator leaves it out (400 if sent): Kiuki takes their payment from their saved payment method, per shipment.",
            "examples": [
              "pi_3Nx1aB2eZvKYlo2C0abc1234"
            ],
            "pattern": "^pi_[A-Za-z0-9_]+$",
            "type": "string"
          },
          "quote_id": {
            "format": "uuid",
            "type": "string"
          },
          "ship_to": {
            "$ref": "#/components/schemas/Address"
          }
        },
        "required": [
          "quote_id",
          "external_ref",
          "ship_to",
          "contact"
        ],
        "type": "object"
      },
      "Quote": {
        "properties": {
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "currency": {
            "type": "string"
          },
          "expires_at": {
            "description": "10 minutes after created_at.",
            "format": "date-time",
            "type": "string"
          },
          "fulfilment": {
            "$ref": "#/components/schemas/Money"
          },
          "goods": {
            "$ref": "#/components/schemas/Money"
          },
          "id": {
            "description": "Order with this id before expires_at.",
            "format": "uuid",
            "type": "string"
          },
          "market": {
            "type": "string"
          },
          "orderable": {
            "description": "False when an origin is blocked.",
            "type": "boolean"
          },
          "origins": {
            "items": {
              "$ref": "#/components/schemas/QuoteOrigin"
            },
            "type": "array"
          },
          "ship_to": {
            "$ref": "#/components/schemas/Destination"
          },
          "total": {
            "$ref": "#/components/schemas/Money",
            "description": "goods + fulfilment: what the order will cost."
          }
        },
        "required": [
          "id",
          "market",
          "currency",
          "ship_to",
          "origins",
          "goods",
          "fulfilment",
          "total",
          "orderable",
          "expires_at",
          "created_at"
        ],
        "type": "object"
      },
      "QuoteLine": {
        "properties": {
          "brand": {
            "type": "string"
          },
          "fee": {
            "$ref": "#/components/schemas/Money",
            "description": "Per pack: Kiuki's 10% distribution fee, VAT included."
          },
          "line": {
            "type": "integer"
          },
          "line_total": {
            "$ref": "#/components/schemas/Money"
          },
          "listing_id": {
            "format": "uuid",
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "pack_id": {
            "format": "uuid",
            "type": "string"
          },
          "price_id": {
            "format": "uuid",
            "type": "string"
          },
          "qty": {
            "type": "integer"
          },
          "seller_org_id": {
            "format": "uuid",
            "type": "string"
          },
          "seller_price": {
            "$ref": "#/components/schemas/Money",
            "description": "Per pack: what the seller receives."
          },
          "sku": {
            "type": "string"
          },
          "unit_price": {
            "$ref": "#/components/schemas/Money",
            "description": "Per pack: seller_price + fee."
          },
          "vat_rate_bp": {
            "type": "integer"
          }
        },
        "required": [
          "line",
          "listing_id",
          "pack_id",
          "seller_org_id",
          "sku",
          "name",
          "brand",
          "qty",
          "unit_price",
          "seller_price",
          "fee",
          "line_total",
          "vat_rate_bp",
          "price_id"
        ],
        "type": "object"
      },
      "QuoteOrigin": {
        "description": "One future shipment: one origin site and one temperature.",
        "properties": {
          "blocked": {
            "description": "Present when the origin refuses this shipment: its minimum order isn't met, it has no delivery service to the address or no rate card in force, a pack is too big for its boxes. The quote can't be ordered until the basket changes.",
            "type": "string"
          },
          "charges": {
            "description": "Itemised fulfilment charges from the origin's rate card, at cost: order handling, picking, packaging, coolant, carriage, surcharges.",
            "examples": [
              [
                {
                  "amount": {
                    "currency": "GBP",
                    "minor": 150
                  },
                  "code": "per_order",
                  "label": "Order handling"
                },
                {
                  "amount": {
                    "currency": "GBP",
                    "minor": 495
                  },
                  "code": "carriage",
                  "label": "Carriage: Standard, 2 to 3 working days to UK mainland, 1 parcel"
                }
              ]
            ],
            "items": {
              "$ref": "#/components/schemas/Charge"
            },
            "type": "array"
          },
          "dispatch_days": {
            "type": "integer"
          },
          "fulfilment": {
            "$ref": "#/components/schemas/Money"
          },
          "lines": {
            "items": {
              "$ref": "#/components/schemas/QuoteLine"
            },
            "type": "array"
          },
          "parcels": {
            "description": "Parcels the origin will pack this shipment into.",
            "type": "integer"
          },
          "rate_card_id": {
            "description": "The version of the origin's rate card priced on. The order keeps it.",
            "format": "uuid",
            "type": "string"
          },
          "service": {
            "description": "The delivery service priced, as the origin's rate card names it. Absent when the origin is blocked.",
            "examples": [
              "STD"
            ],
            "type": "string"
          },
          "service_name": {
            "examples": [
              "Standard, 2 to 3 working days"
            ],
            "type": "string"
          },
          "site_id": {
            "format": "uuid",
            "type": "string"
          },
          "site_name": {
            "type": "string"
          },
          "subtotal": {
            "$ref": "#/components/schemas/Money",
            "description": "Goods from this origin."
          },
          "temperature": {
            "enum": [
              "ambient",
              "chilled",
              "frozen"
            ],
            "type": "string"
          },
          "total": {
            "$ref": "#/components/schemas/Money",
            "description": "subtotal + fulfilment."
          }
        },
        "required": [
          "site_id",
          "site_name",
          "temperature",
          "dispatch_days",
          "lines",
          "charges",
          "fulfilment",
          "parcels",
          "subtotal",
          "total"
        ],
        "type": "object"
      },
      "QuoteRequest": {
        "properties": {
          "lines": {
            "description": "One line per listing.",
            "items": {
              "$ref": "#/components/schemas/QuoteRequestLine"
            },
            "maxItems": 100,
            "minItems": 1,
            "type": "array"
          },
          "market": {
            "examples": [
              "GB"
            ],
            "type": "string"
          },
          "ship_to": {
            "$ref": "#/components/schemas/Destination"
          }
        },
        "required": [
          "market",
          "ship_to",
          "lines"
        ],
        "type": "object"
      },
      "QuoteRequestLine": {
        "properties": {
          "listing_id": {
            "format": "uuid",
            "type": "string"
          },
          "qty": {
            "description": "Packs.",
            "maximum": 10000,
            "minimum": 1,
            "type": "integer"
          }
        },
        "required": [
          "listing_id",
          "qty"
        ],
        "type": "object"
      },
      "QuoteWithAlternatives": {
        "allOf": [
          {
            "$ref": "#/components/schemas/Quote"
          }
        ],
        "description": "A quote, as POST /v1/quotes and POST /v1/quotes/{id}/one-origin answer it: everything in Quote, plus how many parcels the basket makes (show it in the cart before checkout) and, when its shipments come from more than one site, its one-origin alternatives: the same basket with every pack from one site, so one delivery instead of several. An alternative is offered only when that site lists every pack live in the market, has fresh stock for the whole quantity of each, sells each at a price it may (the legal minimum price of alcohol included) and takes the whole basket (no shipment blocked by its rate card); it is priced in full, at that site's own unit prices and fulfilment. At most 3 are offered, the cheapest total first. Only this quote can be ordered: to take an alternative, send its site_id to POST /v1/quotes/{id}/one-origin, which quotes the basket again from that site, and order the quote that returns.",
        "properties": {
          "one_origin_alternatives": {
            "description": "The same basket from one site each, the cheapest total first. Empty when the quote's shipments all come from one site, or no other single site can send the whole basket.",
            "items": {
              "$ref": "#/components/schemas/OneOriginAlternative"
            },
            "type": "array"
          },
          "parcels": {
            "description": "Parcels the basket makes: every origin's parcels added up.",
            "type": "integer"
          }
        },
        "required": [
          "parcels",
          "one_origin_alternatives"
        ],
        "type": "object"
      },
      "Shipment": {
        "description": "One origin's part of an order. pending -\u003e acknowledged -\u003e picking -\u003e packed -\u003e dispatched -\u003e delivered; or cancelled, or failed. A shipment starts out awaiting payment: its site doesn't have it until its payment is secured (your payment authorised; for kiuki.com, the shopper's payment recorded).",
        "properties": {
          "ack_deadline": {
            "description": "The site acknowledges within its working hours by then. Counted again when a shipment awaiting payment goes to its site.",
            "format": "date-time",
            "type": "string"
          },
          "acknowledged_at": {
            "format": "date-time",
            "type": "string"
          },
          "awaiting_payment": {
            "description": "true while the shipment is held because its payment isn't secured yet: it stays pending, its site doesn't have it, and nothing leaves the site. It goes to the site once the payment is secured, and its deadlines are then counted again from that moment. A declined payment keeps it held until the payment succeeds, the order is cancelled, or 24 hours after the order, when Kiuki cancels it (see status).",
            "type": "boolean"
          },
          "cancel_reason": {
            "description": "Why Kiuki cancelled the shipment, when it did: \"payment not secured within 24 hours\"; for kiuki.com's own orders also \"the shopper's payment was refunded\" or \"the shopper's payment was disputed\" (still unpaid 10 minutes after Stripe said so, and its site hadn't started picking it). Absent otherwise.",
            "type": "string"
          },
          "cancelled_at": {
            "format": "date-time",
            "type": "string"
          },
          "carrier": {
            "type": "string"
          },
          "charges": {
            "items": {
              "$ref": "#/components/schemas/Charge"
            },
            "type": "array"
          },
          "delivered_at": {
            "format": "date-time",
            "type": "string"
          },
          "dispatch_deadline": {
            "description": "The site dispatches by then (its promise, in working days). Counted again when a shipment awaiting payment goes to its site.",
            "format": "date-time",
            "type": "string"
          },
          "dispatched_at": {
            "format": "date-time",
            "type": "string"
          },
          "fulfilment": {
            "$ref": "#/components/schemas/Money"
          },
          "id": {
            "format": "uuid",
            "type": "string"
          },
          "lines": {
            "items": {
              "$ref": "#/components/schemas/OrderLine"
            },
            "type": "array"
          },
          "parcels": {
            "type": "integer"
          },
          "service": {
            "description": "The delivery service the shipment was priced with, as the origin's rate card names it.",
            "type": "string"
          },
          "site_id": {
            "format": "uuid",
            "type": "string"
          },
          "site_name": {
            "type": "string"
          },
          "status": {
            "description": "pending -\u003e acknowledged -\u003e picking -\u003e packed -\u003e dispatched -\u003e delivered. cancelled: by you (while pending or acknowledged), by the site, or by Kiuki, which says why in cancel_reason. Kiuki cancels your shipment when its payment isn't secured within 24 hours of the order (cancel_reason \"payment not secured within 24 hours\"): its stock goes back on sale and nothing is taken from your card. kiuki.com's shipments are never cancelled that way. failed: Kiuki staff gave up on it.",
            "enum": [
              "pending",
              "acknowledged",
              "picking",
              "packed",
              "dispatched",
              "delivered",
              "cancelled",
              "failed"
            ],
            "type": "string"
          },
          "temperature": {
            "enum": [
              "ambient",
              "chilled",
              "frozen"
            ],
            "type": "string"
          },
          "tracking_number": {
            "type": "string"
          },
          "tracking_url": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "site_id",
          "temperature",
          "status",
          "awaiting_payment",
          "parcels",
          "charges",
          "fulfilment",
          "ack_deadline",
          "dispatch_deadline",
          "lines"
        ],
        "type": "object"
      },
      "ShipmentSummary": {
        "properties": {
          "carrier": {
            "type": "string"
          },
          "id": {
            "format": "uuid",
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "temperature": {
            "enum": [
              "ambient",
              "chilled",
              "frozen"
            ],
            "type": "string"
          },
          "tracking_number": {
            "type": "string"
          },
          "tracking_url": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "temperature",
          "status"
        ],
        "type": "object"
      },
      "ShipmentWithAgeCheck": {
        "allOf": [
          {
            "$ref": "#/components/schemas/Shipment"
          }
        ],
        "description": "A shipment, as an order shows it: everything in Shipment, plus whether it is delivered with an age check.",
        "properties": {
          "age_checked": {
            "description": "true when the shipment holds alcohol: it is delivered with an age check, and the courier hands it over only to someone 18 or over. Tell your shopper before checkout. The site's rate card may charge for it, per parcel holding alcohol (charge code alcohol).",
            "type": "boolean"
          }
        },
        "required": [
          "age_checked"
        ],
        "type": "object"
      },
      "WebhookAttempt": {
        "properties": {
          "at": {
            "format": "date-time",
            "type": "string"
          },
          "attempt": {
            "type": "integer"
          },
          "duration_ms": {
            "type": "integer"
          },
          "error": {
            "type": "string"
          },
          "response": {
            "description": "The start of the endpoint's answer.",
            "type": "string"
          },
          "status_code": {
            "type": "integer"
          }
        },
        "required": [
          "attempt",
          "at",
          "duration_ms"
        ],
        "type": "object"
      },
      "WebhookDelivery": {
        "description": "One event's delivery to one endpoint.",
        "properties": {
          "attempts": {
            "type": "integer"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "delivered_at": {
            "format": "date-time",
            "type": "string"
          },
          "endpoint_id": {
            "format": "uuid",
            "type": "string"
          },
          "event_id": {
            "format": "uuid",
            "type": "string"
          },
          "event_type": {
            "type": "string"
          },
          "id": {
            "format": "uuid",
            "type": "string"
          },
          "last_attempt_at": {
            "format": "date-time",
            "type": "string"
          },
          "last_error": {
            "description": "Why the last attempt failed, in plain words.",
            "type": "string"
          },
          "last_status": {
            "description": "The HTTP status of the last answer, when there was one.",
            "type": "integer"
          },
          "next_attempt_at": {
            "format": "date-time",
            "type": "string"
          },
          "status": {
            "description": "pending: waiting for its next attempt; delivered: answered 2xx; failed: no attempt succeeded within a day; skipped: not sent because the endpoint is or was off. Turning the endpoint on sends up to 100 of those skipped in the last 30 days, the oldest first; any other can be sent again (resend).",
            "enum": [
              "pending",
              "delivered",
              "failed",
              "skipped"
            ],
            "type": "string"
          }
        },
        "required": [
          "id",
          "endpoint_id",
          "event_id",
          "event_type",
          "status",
          "attempts",
          "created_at"
        ],
        "type": "object"
      },
      "WebhookDeliveryDetail": {
        "properties": {
          "attempt_log": {
            "items": {
              "$ref": "#/components/schemas/WebhookAttempt"
            },
            "type": "array"
          },
          "attempts": {
            "type": "integer"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "delivered_at": {
            "format": "date-time",
            "type": "string"
          },
          "endpoint_id": {
            "format": "uuid",
            "type": "string"
          },
          "event_id": {
            "format": "uuid",
            "type": "string"
          },
          "event_type": {
            "type": "string"
          },
          "id": {
            "format": "uuid",
            "type": "string"
          },
          "last_attempt_at": {
            "format": "date-time",
            "type": "string"
          },
          "last_error": {
            "type": "string"
          },
          "last_status": {
            "type": "integer"
          },
          "next_attempt_at": {
            "format": "date-time",
            "type": "string"
          },
          "payload": {
            "description": "The body every attempt sends, exactly.",
            "type": "string"
          },
          "status": {
            "enum": [
              "pending",
              "delivered",
              "failed",
              "skipped"
            ],
            "type": "string"
          }
        },
        "required": [
          "id",
          "endpoint_id",
          "event_id",
          "event_type",
          "status",
          "attempts",
          "created_at",
          "payload",
          "attempt_log"
        ],
        "type": "object"
      },
      "WebhookDeliveryList": {
        "properties": {
          "deliveries": {
            "items": {
              "$ref": "#/components/schemas/WebhookDelivery"
            },
            "type": "array"
          }
        },
        "required": [
          "deliveries"
        ],
        "type": "object"
      },
      "WebhookEndpoint": {
        "description": "An https address Kiuki sends events to, signed with its secret.",
        "properties": {
          "consecutive_failures": {
            "description": "Failed attempts since the last success.",
            "type": "integer"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "disabled_at": {
            "format": "date-time",
            "type": "string"
          },
          "disabled_reason": {
            "description": "Who turned it off, and, when Kiuki did, why.",
            "type": "string"
          },
          "enabled": {
            "description": "false: nothing is sent to it.",
            "type": "boolean"
          },
          "events": {
            "description": "The events it wants; * is all of them, including any added later.",
            "items": {
              "enum": [
                "*",
                "order.placed",
                "order.paid",
                "shipment.released",
                "shipment.acknowledged",
                "shipment.dispatched",
                "shipment.delivered",
                "shipment.cancelled",
                "shipment.failed",
                "order.completed",
                "order.cancelled"
              ],
              "type": "string"
            },
            "type": "array"
          },
          "id": {
            "format": "uuid",
            "type": "string"
          },
          "last_failure_at": {
            "format": "date-time",
            "type": "string"
          },
          "last_success_at": {
            "format": "date-time",
            "type": "string"
          },
          "sandbox": {
            "description": "true for the sandbox's endpoints, which get the sandbox's events.",
            "type": "boolean"
          },
          "secret_hint": {
            "description": "The last characters of its secret, to tell secrets apart.",
            "type": "string"
          },
          "turned_off_by_kiuki": {
            "description": "Kiuki turned it off because every attempt to deliver to it failed for a day (and 10 in a row). Turn it on again once it is fixed.",
            "type": "boolean"
          },
          "url": {
            "examples": [
              "https://example.com/kiuki/webhooks"
            ],
            "type": "string"
          }
        },
        "required": [
          "id",
          "url",
          "events",
          "enabled",
          "turned_off_by_kiuki",
          "secret_hint",
          "consecutive_failures",
          "sandbox",
          "created_at"
        ],
        "type": "object"
      },
      "WebhookEndpointCreated": {
        "description": "A new endpoint, with its secret. The secret is shown this once only: store it now.",
        "properties": {
          "consecutive_failures": {
            "type": "integer"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "enabled": {
            "type": "boolean"
          },
          "events": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "id": {
            "format": "uuid",
            "type": "string"
          },
          "sandbox": {
            "type": "boolean"
          },
          "secret": {
            "description": "Signs every delivery to this endpoint (Kiuki-Signature). Shown once.",
            "pattern": "^whsec_[a-z2-7]+$",
            "type": "string"
          },
          "secret_hint": {
            "type": "string"
          },
          "turned_off_by_kiuki": {
            "type": "boolean"
          },
          "url": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "url",
          "events",
          "enabled",
          "secret",
          "secret_hint",
          "sandbox",
          "created_at"
        ],
        "type": "object"
      },
      "WebhookEndpointDeleted": {
        "properties": {
          "deleted": {
            "type": "boolean"
          },
          "id": {
            "format": "uuid",
            "type": "string"
          }
        },
        "required": [
          "id",
          "deleted"
        ],
        "type": "object"
      },
      "WebhookEndpointList": {
        "properties": {
          "endpoints": {
            "items": {
              "$ref": "#/components/schemas/WebhookEndpoint"
            },
            "type": "array"
          }
        },
        "required": [
          "endpoints"
        ],
        "type": "object"
      },
      "WebhookEndpointRequest": {
        "properties": {
          "description": {
            "maxLength": 200,
            "type": "string"
          },
          "events": {
            "description": "The events to send; leave out (or [\"*\"]) for all. An empty list is refused.",
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "url": {
            "description": "https:// and a public host name. No user name or password in it.",
            "maxLength": 500,
            "type": "string"
          }
        },
        "required": [
          "url"
        ],
        "type": "object"
      },
      "WebhookEndpointUpdate": {
        "properties": {
          "description": {
            "maxLength": 200,
            "type": "string"
          },
          "enabled": {
            "description": "false turns the endpoint off; true turns it on again and sends it up to 100 of the deliveries skipped meanwhile, the oldest of the last 30 days. Any more stay skipped.",
            "type": "boolean"
          },
          "events": {
            "description": "The events to send instead ([\"*\"] for all). Left out, they stay as they are; an empty list is refused.",
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "url": {
            "maxLength": 500,
            "type": "string"
          }
        },
        "type": "object"
      },
      "WebhookOrder": {
        "description": "The order as GET /v1/orders/{id} shows it, without addresses and lines. order.placed, order.completed and order.cancelled add its shipments.",
        "properties": {
          "cancelled_at": {
            "format": "date-time",
            "type": "string"
          },
          "currency": {
            "type": "string"
          },
          "external_ref": {
            "type": "string"
          },
          "fulfilment": {
            "$ref": "#/components/schemas/Money"
          },
          "goods": {
            "$ref": "#/components/schemas/Money"
          },
          "id": {
            "format": "uuid",
            "type": "string"
          },
          "market": {
            "type": "string"
          },
          "paid_at": {
            "format": "date-time",
            "type": "string"
          },
          "placed_at": {
            "format": "date-time",
            "type": "string"
          },
          "shipments": {
            "description": "order.placed, order.completed and order.cancelled: every shipment of the order as it stands, so the end of an order says which shipments went and which were cancelled or failed.",
            "items": {
              "$ref": "#/components/schemas/WebhookShipment"
            },
            "type": "array"
          },
          "status": {
            "enum": [
              "placed",
              "paid",
              "in_progress",
              "completed",
              "cancelled"
            ],
            "type": "string"
          },
          "total": {
            "$ref": "#/components/schemas/Money"
          }
        },
        "required": [
          "id",
          "external_ref",
          "status",
          "currency",
          "total",
          "placed_at"
        ],
        "type": "object"
      },
      "WebhookOrderEvent": {
        "description": "order.placed, order.paid, order.completed or order.cancelled.",
        "properties": {
          "created_at": {
            "description": "When it happened.",
            "format": "date-time",
            "type": "string"
          },
          "data": {
            "properties": {
              "order": {
                "$ref": "#/components/schemas/WebhookOrder"
              }
            },
            "required": [
              "order"
            ],
            "type": "object"
          },
          "id": {
            "description": "The event's id: the same in every delivery of it. Handle each id once.",
            "format": "uuid",
            "type": "string"
          },
          "sandbox": {
            "description": "true for the sandbox's events.",
            "type": "boolean"
          },
          "type": {
            "enum": [
              "order.placed",
              "order.paid",
              "order.completed",
              "order.cancelled"
            ],
            "type": "string"
          }
        },
        "required": [
          "id",
          "type",
          "created_at",
          "sandbox",
          "data"
        ],
        "type": "object"
      },
      "WebhookShipment": {
        "description": "The shipment as GET /v1/orders/{id} shows it, without its lines and charges.",
        "properties": {
          "acknowledged_at": {
            "format": "date-time",
            "type": "string"
          },
          "awaiting_payment": {
            "type": "boolean"
          },
          "cancel_reason": {
            "description": "Why Kiuki cancelled it, when it did.",
            "type": "string"
          },
          "cancelled_at": {
            "format": "date-time",
            "type": "string"
          },
          "cancelled_by": {
            "description": "shipment.cancelled only: who cancelled it (aggregator: you).",
            "enum": [
              "aggregator",
              "site",
              "kiuki"
            ],
            "type": "string"
          },
          "carrier": {
            "type": "string"
          },
          "delivered_at": {
            "format": "date-time",
            "type": "string"
          },
          "dispatched_at": {
            "format": "date-time",
            "type": "string"
          },
          "id": {
            "format": "uuid",
            "type": "string"
          },
          "order_id": {
            "format": "uuid",
            "type": "string"
          },
          "parcels": {
            "type": "integer"
          },
          "reason": {
            "description": "shipment.cancelled and shipment.failed only. shipment.cancelled: why, in plain words. shipment.failed: that Kiuki gave up on it, in plain words; Kiuki's own notes about it aren't shared.",
            "type": "string"
          },
          "service": {
            "type": "string"
          },
          "site_id": {
            "format": "uuid",
            "type": "string"
          },
          "site_name": {
            "type": "string"
          },
          "status": {
            "enum": [
              "pending",
              "acknowledged",
              "picking",
              "packed",
              "dispatched",
              "delivered",
              "cancelled",
              "failed"
            ],
            "type": "string"
          },
          "temperature": {
            "enum": [
              "ambient",
              "chilled",
              "frozen"
            ],
            "type": "string"
          },
          "tracking_number": {
            "type": "string"
          },
          "tracking_url": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "order_id",
          "site_id",
          "temperature",
          "status",
          "awaiting_payment"
        ],
        "type": "object"
      },
      "WebhookShipmentEvent": {
        "description": "shipment.released, shipment.acknowledged, shipment.dispatched, shipment.delivered, shipment.cancelled or shipment.failed.",
        "properties": {
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "data": {
            "properties": {
              "order": {
                "description": "The shipment's order: its id and your external_ref.",
                "properties": {
                  "external_ref": {
                    "type": "string"
                  },
                  "id": {
                    "format": "uuid",
                    "type": "string"
                  }
                },
                "type": "object"
              },
              "shipment": {
                "$ref": "#/components/schemas/WebhookShipment"
              }
            },
            "required": [
              "order",
              "shipment"
            ],
            "type": "object"
          },
          "id": {
            "description": "The event's id: the same in every delivery of it. Handle each id once.",
            "format": "uuid",
            "type": "string"
          },
          "sandbox": {
            "type": "boolean"
          },
          "type": {
            "enum": [
              "shipment.released",
              "shipment.acknowledged",
              "shipment.dispatched",
              "shipment.delivered",
              "shipment.cancelled",
              "shipment.failed"
            ],
            "type": "string"
          }
        },
        "required": [
          "id",
          "type",
          "created_at",
          "sandbox",
          "data"
        ],
        "type": "object"
      },
      "WhoAmI": {
        "properties": {
          "key": {
            "description": "The key's name.",
            "type": "string"
          },
          "org_id": {
            "format": "uuid",
            "type": "string"
          },
          "sandbox": {
            "description": "true for a sandbox key: it sees only the sandbox's listings and orders.",
            "type": "boolean"
          },
          "scopes": {
            "items": {
              "enum": [
                "catalogue:read",
                "quote:write",
                "order:write",
                "order:read",
                "webhooks:write",
                "complaint:write"
              ],
              "type": "string"
            },
            "type": "array"
          }
        },
        "required": [
          "org_id",
          "key",
          "scopes",
          "sandbox"
        ],
        "type": "object"
      }
    },
    "securitySchemes": {
      "apiKey": {
        "bearerFormat": "kp_\u003cprefix\u003e_\u003csecret\u003e",
        "description": "A platform API key, issued by Kiuki to an approved aggregator. Its scopes decide what it can do.",
        "scheme": "bearer",
        "type": "http"
      }
    }
  },
  "info": {
    "description": "The Kiuki platform API lets aggregators (kiuki.com, other shops and AI assistants) sell packs from many sellers, shipped by the sites that hold them.\n\nHow buying works:\n\n1. `GET /v1/markets`, then `GET /v1/catalogue?market=GB` for what is on sale: packs, food labels, unit prices and availability.\n2. `POST /v1/quotes` with listing ids, quantities and the delivery country and postcode. The quote is itemised per origin (one shipment per origin site and temperature: chilled and frozen travel apart from ambient) and holds for 10 minutes.\n3. `POST /v1/orders` with the quote id, your own order reference (`external_ref`) and the address. Sending the same `external_ref` again returns the same order, so retries are safe. kiuki.com also sends `payment_ref`, the PaymentIntent its shopper paid with; other aggregators are charged by Kiuki per shipment and leave it out.\n4. `GET /v1/orders/{id}` for status and tracking; `POST /v1/orders/{id}/cancel` while its shipments haven't started.\n5. `POST /v1/complaints` when a shopper reports a problem with a line whose shipment has left the site (allergen, label, safety, damaged, missing); Kiuki follows it up with the seller.\n\nPrices: a unit price is the seller's own price per pack plus Kiuki's 10% distribution fee (VAT included), rounded half up per pack. Fulfilment is each origin's rate card, at cost. Money is always integer minor units with an ISO 4217 currency, never a float.\n\nAuthentication: send `Authorization: Bearer kp_...` with a platform API key. Each operation names the scope it needs (catalogue:read, quote:write, order:write, order:read, webhooks:write, complaint:write); a key without it gets HTTP 403 with a message naming the scope. A key whose organisation isn't approved (or is suspended) gets 403 on every operation. Each key may send 20 requests a second on average, in bursts of up to 100; beyond that it gets 429 rate_limited.\n\nSandbox: a sandbox key works exactly like a live one, at the same address, in a world of its own: invented producers and a site whose orders move on by themselves within minutes, paid with a pretend card. It never sees live listings, and live keys never see it. Make sandbox keys in the developer portal (/dashboard).\n\nWebhooks: register https endpoints (`POST /v1/webhook-endpoints`) to be told as your orders and shipments move, in signed POSTs (Kiuki-Signature). The webhooks section of this document lists the events. Guides: /docs.\n\nErrors are JSON: `{\"error\": \"\u003ccode\u003e\", \"message\": \"\u003cplain English\u003e\"}`. Branch on error; show message to people. A 503 means nothing was done: send the same request again in a moment.",
    "title": "Kiuki platform API",
    "version": "1.0.0"
  },
  "openapi": "3.1.0",
  "paths": {
    "/healthz": {
      "get": {
        "description": "Answers \"ok\" while the API is up.",
        "operationId": "health",
        "responses": {
          "200": {
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "OK"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on Kiuki's side. It has been logged; try again later."
          }
        },
        "security": [],
        "summary": "Health check",
        "tags": [
          "meta"
        ]
      }
    },
    "/v1/catalogue": {
      "get": {
        "description": "Live listings in a market, a page at a time: pack name, brand, size, GTINs, temperature, alcohol, food labels for the market, unit price per pack and availability. Listings without a current price aren't shown. Alcohol from an origin in Scotland or Wales has a legal minimum price (minimum unit pricing): the platform keeps unit_price at or above it, and takes a listing off sale before a new rate would put it below. An aggregator that sells to its shoppers at any other price is responsible for its own compliance with minimum pricing law.\n\nNeeds a key with the `catalogue:read` scope.",
        "operationId": "listCatalogue",
        "parameters": [
          {
            "description": "Market code, e.g. GB.",
            "in": "query",
            "name": "market",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "next_cursor from the previous page.",
            "in": "query",
            "name": "cursor",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Items per page, 1 to 200 (default 50).",
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CataloguePage"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is malformed. The message says what to fix."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No API key was sent, or it isn't a valid one. Send Authorization: Bearer kp_..."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "This key can't do this: it lacks the scope the message names, or its organisation can't use the API (not approved yet, or suspended), or it is another app's key. The message says which."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid but can't be done now. The error code and message say why."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "rate_limited: this key sent requests faster than its rate (20 a second on average, in bursts of up to 100), so nothing was done. Send it again once as many seconds as Retry-After says have passed.",
            "headers": {
              "Retry-After": {
                "description": "How many seconds to wait before sending the request again.",
                "schema": {
                  "minimum": 1,
                  "type": "integer"
                }
              }
            }
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on Kiuki's side. It has been logged; try again later."
          }
        },
        "summary": "What is on sale in a market",
        "tags": [
          "catalogue"
        ],
        "x-required-scope": "catalogue:read"
      }
    },
    "/v1/catalogue/{listing_id}": {
      "get": {
        "description": "A live listing with its labels, unit price and availability.\n\nNeeds a key with the `catalogue:read` scope.",
        "operationId": "getCatalogueItem",
        "parameters": [
          {
            "description": "The listing's id.",
            "in": "path",
            "name": "listing_id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CatalogueItem"
                }
              }
            },
            "description": "OK"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No API key was sent, or it isn't a valid one. Send Authorization: Bearer kp_..."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "This key can't do this: it lacks the scope the message names, or its organisation can't use the API (not approved yet, or suspended), or it is another app's key. The message says which."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "There is no such record for your organisation."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "rate_limited: this key sent requests faster than its rate (20 a second on average, in bursts of up to 100), so nothing was done. Send it again once as many seconds as Retry-After says have passed.",
            "headers": {
              "Retry-After": {
                "description": "How many seconds to wait before sending the request again.",
                "schema": {
                  "minimum": 1,
                  "type": "integer"
                }
              }
            }
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on Kiuki's side. It has been logged; try again later."
          }
        },
        "summary": "One listing",
        "tags": [
          "catalogue"
        ],
        "x-required-scope": "catalogue:read"
      }
    },
    "/v1/complaints": {
      "post": {
        "description": "Reports what a shopper found wrong with a line of one of your orders, once its shipment has left the site (dispatched or delivered; 409 before that). kind is one of allergen, label, safety, damaged, missing or other.\n\nAn allergen, label or safety report takes the listing off sale at once (listing_paused true), alerts Kiuki and tells the seller, who may answer it; Kiuki staff then resolve it (status resolved, with an outcome: upheld or not_upheld, and what Kiuki found in resolution). Other kinds are recorded and dealt with the same way, without taking the listing off sale. Don't put the shopper's name or contact details in description: the seller reads it.\n\nIdempotent on external_ref, your own reference for the complaint: sending it again returns the complaint already recorded with 200 instead of 201 (409 if that reference is a complaint about another line or of another kind). One open complaint of a kind per line: another of the same kind is refused with 409 until Kiuki resolves the first.\n\nNeeds a key with the `complaint:write` scope.",
        "operationId": "reportComplaint",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ComplaintRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Complaint"
                }
              }
            },
            "description": "OK"
          },
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Complaint"
                }
              }
            },
            "description": "Created"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is malformed. The message says what to fix."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No API key was sent, or it isn't a valid one. Send Authorization: Bearer kp_..."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "This key can't do this: it lacks the scope the message names, or its organisation can't use the API (not approved yet, or suspended), or it is another app's key. The message says which."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "There is no such record for your organisation."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid but can't be done now. The error code and message say why."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "rate_limited: this key sent requests faster than its rate (20 a second on average, in bursts of up to 100), so nothing was done. Send it again once as many seconds as Retry-After says have passed.",
            "headers": {
              "Retry-After": {
                "description": "How many seconds to wait before sending the request again.",
                "schema": {
                  "minimum": 1,
                  "type": "integer"
                }
              }
            }
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on Kiuki's side. It has been logged; try again later."
          }
        },
        "summary": "Report a problem with an order line",
        "tags": [
          "complaints"
        ],
        "x-required-scope": "complaint:write"
      }
    },
    "/v1/complaints/{id}": {
      "get": {
        "description": "A complaint you reported, with where it stands: open, disputed (the seller answered it; Kiuki is deciding) or resolved, with Kiuki's outcome.\n\nNeeds a key with the `complaint:write` scope.",
        "operationId": "getComplaint",
        "parameters": [
          {
            "description": "The complaint's id.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Complaint"
                }
              }
            },
            "description": "OK"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No API key was sent, or it isn't a valid one. Send Authorization: Bearer kp_..."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "This key can't do this: it lacks the scope the message names, or its organisation can't use the API (not approved yet, or suspended), or it is another app's key. The message says which."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "There is no such record for your organisation."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "rate_limited: this key sent requests faster than its rate (20 a second on average, in bursts of up to 100), so nothing was done. Send it again once as many seconds as Retry-After says have passed.",
            "headers": {
              "Retry-After": {
                "description": "How many seconds to wait before sending the request again.",
                "schema": {
                  "minimum": 1,
                  "type": "integer"
                }
              }
            }
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on Kiuki's side. It has been logged; try again later."
          }
        },
        "summary": "One of your complaints",
        "tags": [
          "complaints"
        ],
        "x-required-scope": "complaint:write"
      }
    },
    "/v1/markets": {
      "get": {
        "description": "Every market with its country, currency, languages and time zone. Only active markets can be quoted and ordered. Any valid key may call it.",
        "operationId": "listMarkets",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MarketList"
                }
              }
            },
            "description": "OK"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No API key was sent, or it isn't a valid one. Send Authorization: Bearer kp_..."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "This key can't do this: it lacks the scope the message names, or its organisation can't use the API (not approved yet, or suspended), or it is another app's key. The message says which."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "rate_limited: this key sent requests faster than its rate (20 a second on average, in bursts of up to 100), so nothing was done. Send it again once as many seconds as Retry-After says have passed.",
            "headers": {
              "Retry-After": {
                "description": "How many seconds to wait before sending the request again.",
                "schema": {
                  "minimum": 1,
                  "type": "integer"
                }
              }
            }
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on Kiuki's side. It has been logged; try again later."
          }
        },
        "summary": "Markets",
        "tags": [
          "catalogue"
        ]
      }
    },
    "/v1/openapi.json": {
      "get": {
        "description": "Describes every endpoint, its scope, request and response. Needs no key.",
        "operationId": "getOpenAPI",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpenAPIDocument"
                }
              }
            },
            "description": "OK"
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on Kiuki's side. It has been logged; try again later."
          }
        },
        "security": [],
        "summary": "This API description (OpenAPI 3.1)",
        "tags": [
          "meta"
        ]
      }
    },
    "/v1/orders": {
      "get": {
        "description": "Your organisation's orders, newest first, with each shipment's status and tracking.\n\nNeeds a key with the `order:read` scope.",
        "operationId": "listOrders",
        "parameters": [
          {
            "description": "Only the order with your reference.",
            "in": "query",
            "name": "external_ref",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Only orders with this status: placed, paid, in_progress, completed or cancelled.",
            "in": "query",
            "name": "status",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "next_cursor from the previous page.",
            "in": "query",
            "name": "cursor",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Orders per page, 1 to 200 (default 50).",
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrderPage"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is malformed. The message says what to fix."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No API key was sent, or it isn't a valid one. Send Authorization: Bearer kp_..."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "This key can't do this: it lacks the scope the message names, or its organisation can't use the API (not approved yet, or suspended), or it is another app's key. The message says which."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "rate_limited: this key sent requests faster than its rate (20 a second on average, in bursts of up to 100), so nothing was done. Send it again once as many seconds as Retry-After says have passed.",
            "headers": {
              "Retry-After": {
                "description": "How many seconds to wait before sending the request again.",
                "schema": {
                  "minimum": 1,
                  "type": "integer"
                }
              }
            }
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on Kiuki's side. It has been logged; try again later."
          }
        },
        "summary": "Your orders",
        "tags": [
          "orders"
        ],
        "x-required-scope": "order:read"
      },
      "post": {
        "description": "Places an order from one of your quotes before it expires, with your own reference and the delivery address (same country and postcode as the quote). Stock is allocated for every shipment, or nothing is ordered (409 out_of_stock). Idempotent on external_ref: sending the same request again returns the same order with 200 instead of 201. A quote can be ordered once.\n\nkiuki.com sends payment_ref, the PaymentIntent its shopper paid with on kiuki.com's checkout: it is checked before anything is ordered (402 payment_refused when it can't pay for the order, 409 payment_used when it already paid for another), and an order without it is refused (400). Other aggregators must leave it out: Kiuki takes their payment per shipment.\n\nEach shipment starts out awaiting payment (awaiting_payment true): its site gets it only once its payment is secured, and its deadlines then count from that moment.\n\nNeeds a key with the `order:write` scope.",
        "operationId": "placeOrder",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PlaceOrderRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrderWithAgeChecks"
                }
              }
            },
            "description": "OK"
          },
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrderWithAgeChecks"
                }
              }
            },
            "description": "Created"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is malformed. The message says what to fix."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No API key was sent, or it isn't a valid one. Send Authorization: Bearer kp_..."
          },
          "402": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The payment named can't pay for this. The message says why."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "This key can't do this: it lacks the scope the message names, or its organisation can't use the API (not approved yet, or suspended), or it is another app's key. The message says which."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "There is no such record for your organisation."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid but can't be done now. The error code and message say why."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "rate_limited: this key sent requests faster than its rate (20 a second on average, in bursts of up to 100), so nothing was done. Send it again once as many seconds as Retry-After says have passed.",
            "headers": {
              "Retry-After": {
                "description": "How many seconds to wait before sending the request again.",
                "schema": {
                  "minimum": 1,
                  "type": "integer"
                }
              }
            }
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on Kiuki's side. It has been logged; try again later."
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "A service the request needs couldn't be reached (stripe_unavailable), or isn't set up on this server (payments_unavailable), so nothing was done. Safe to retry in a moment with the same request."
          }
        },
        "summary": "Place an order from a quote",
        "tags": [
          "orders"
        ],
        "x-required-scope": "order:write"
      }
    },
    "/v1/orders/{id}": {
      "get": {
        "description": "An order with its shipments: status, deadlines, charges, lines and tracking.\n\nNeeds a key with the `order:read` scope.",
        "operationId": "getOrder",
        "parameters": [
          {
            "description": "The order's id.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrderWithAgeChecks"
                }
              }
            },
            "description": "OK"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No API key was sent, or it isn't a valid one. Send Authorization: Bearer kp_..."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "This key can't do this: it lacks the scope the message names, or its organisation can't use the API (not approved yet, or suspended), or it is another app's key. The message says which."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "There is no such record for your organisation."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "rate_limited: this key sent requests faster than its rate (20 a second on average, in bursts of up to 100), so nothing was done. Send it again once as many seconds as Retry-After says have passed.",
            "headers": {
              "Retry-After": {
                "description": "How many seconds to wait before sending the request again.",
                "schema": {
                  "minimum": 1,
                  "type": "integer"
                }
              }
            }
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on Kiuki's side. It has been logged; try again later."
          }
        },
        "summary": "One order",
        "tags": [
          "orders"
        ],
        "x-required-scope": "order:read"
      }
    },
    "/v1/orders/{id}/cancel": {
      "post": {
        "description": "Cancels the order's shipments that are still pending or acknowledged and gives their stock back. Shipments already being picked, or gone, can't be cancelled and stay as they are; when every shipment is cancelled, so is the order. Payment for a cancelled shipment is released (or, for kiuki.com, its sellers and site aren't paid for it). Cancelling a cancelled order returns it unchanged. 409 not_cancellable when nothing can be cancelled.\n\nNeeds a key with the `order:write` scope.",
        "operationId": "cancelOrder",
        "parameters": [
          {
            "description": "The order's id.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CancelRequest"
              }
            }
          },
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrderWithAgeChecks"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is malformed. The message says what to fix."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No API key was sent, or it isn't a valid one. Send Authorization: Bearer kp_..."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "This key can't do this: it lacks the scope the message names, or its organisation can't use the API (not approved yet, or suspended), or it is another app's key. The message says which."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "There is no such record for your organisation."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid but can't be done now. The error code and message say why."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "rate_limited: this key sent requests faster than its rate (20 a second on average, in bursts of up to 100), so nothing was done. Send it again once as many seconds as Retry-After says have passed.",
            "headers": {
              "Retry-After": {
                "description": "How many seconds to wait before sending the request again.",
                "schema": {
                  "minimum": 1,
                  "type": "integer"
                }
              }
            }
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on Kiuki's side. It has been logged; try again later."
          }
        },
        "summary": "Cancel an order",
        "tags": [
          "orders"
        ],
        "x-required-scope": "order:write"
      }
    },
    "/v1/orders/{id}/shipments/{shipment_id}/cancel": {
      "post": {
        "description": "Cancels one shipment of the order while it is still pending or acknowledged, and gives its stock back. The order's other shipments go on as they are. The rules are those of cancelling the whole order: a shipment already being picked, or gone, can't be cancelled (409 not_cancellable); payment for a cancelled shipment is released (or, for kiuki.com, its sellers and site aren't paid for it, and kiuki.com refunds its shopper for it); when no shipment of the order is left that isn't cancelled, the order is cancelled too. Cancelling a cancelled shipment returns the order unchanged, so sending the request again is safe. 404 when the order isn't yours or the shipment isn't the order's.\n\nNeeds a key with the `order:write` scope.",
        "operationId": "cancelShipment",
        "parameters": [
          {
            "description": "The order's id.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "The id of the order's shipment to cancel.",
            "in": "path",
            "name": "shipment_id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CancelRequest"
              }
            }
          },
          "required": false
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrderWithAgeChecks"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is malformed. The message says what to fix."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No API key was sent, or it isn't a valid one. Send Authorization: Bearer kp_..."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "This key can't do this: it lacks the scope the message names, or its organisation can't use the API (not approved yet, or suspended), or it is another app's key. The message says which."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "There is no such record for your organisation."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid but can't be done now. The error code and message say why."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "rate_limited: this key sent requests faster than its rate (20 a second on average, in bursts of up to 100), so nothing was done. Send it again once as many seconds as Retry-After says have passed.",
            "headers": {
              "Retry-After": {
                "description": "How many seconds to wait before sending the request again.",
                "schema": {
                  "minimum": 1,
                  "type": "integer"
                }
              }
            }
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on Kiuki's side. It has been logged; try again later."
          }
        },
        "summary": "Cancel one shipment of an order",
        "tags": [
          "orders"
        ],
        "x-required-scope": "order:write"
      }
    },
    "/v1/quotes": {
      "post": {
        "description": "Prices listings for delivery to a country and postcode. Each pack costs its unit price (the seller's price plus Kiuki's 10% fee). Lines are grouped into future shipments, one per origin site and temperature, and each is charged fulfilment from its origin's rate card, at cost: itemised charges, parcels and the delivery service. The quote holds for 10 minutes. A line above the available quantity, or from an origin whose stock data is over an hour old, is refused with a 409 naming the line; an origin that refuses its shipment (its minimum order isn't met, it can't deliver to the postcode, it has no rate card in force) is marked blocked with the reason, and the quote can't be ordered. The quote says how many parcels the basket makes and, when its shipments come from more than one site, offers its one-origin alternatives (see QuoteWithAlternatives).\n\nNeeds a key with the `quote:write` scope.",
        "operationId": "createQuote",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/QuoteRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/QuoteWithAlternatives"
                }
              }
            },
            "description": "Created"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is malformed. The message says what to fix."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No API key was sent, or it isn't a valid one. Send Authorization: Bearer kp_..."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "This key can't do this: it lacks the scope the message names, or its organisation can't use the API (not approved yet, or suspended), or it is another app's key. The message says which."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid but can't be done now. The error code and message say why."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "rate_limited: this key sent requests faster than its rate (20 a second on average, in bursts of up to 100), so nothing was done. Send it again once as many seconds as Retry-After says have passed.",
            "headers": {
              "Retry-After": {
                "description": "How many seconds to wait before sending the request again.",
                "schema": {
                  "minimum": 1,
                  "type": "integer"
                }
              }
            }
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on Kiuki's side. It has been logged; try again later."
          }
        },
        "summary": "Price a basket, delivered",
        "tags": [
          "quotes"
        ],
        "x-required-scope": "quote:write"
      }
    },
    "/v1/quotes/{id}/one-origin": {
      "post": {
        "description": "Quotes the basket of one of your quotes again with every pack from one site (one of its one_origin_alternatives): the same packs, listed live at that site, in the same quantities, for delivery to the same country and postcode. Lines of the same pack become one, under the number of the first; every line keeps the number it had on the quote. The answer is a new quote, priced and checked as POST /v1/quotes prices one (it holds for 10 minutes): order that one with POST /v1/orders. The quote asked from may have expired. A pack the site doesn't sell, or can't sell now, is refused with a 409 naming the line; a site that isn't taking orders is a 409 origin_unavailable.\n\nNeeds a key with the `quote:write` scope.",
        "operationId": "quoteOneOrigin",
        "parameters": [
          {
            "description": "The id of one of your quotes.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OneOriginRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/QuoteWithAlternatives"
                }
              }
            },
            "description": "Created"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is malformed. The message says what to fix."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No API key was sent, or it isn't a valid one. Send Authorization: Bearer kp_..."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "This key can't do this: it lacks the scope the message names, or its organisation can't use the API (not approved yet, or suspended), or it is another app's key. The message says which."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "There is no such record for your organisation."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid but can't be done now. The error code and message say why."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "rate_limited: this key sent requests faster than its rate (20 a second on average, in bursts of up to 100), so nothing was done. Send it again once as many seconds as Retry-After says have passed.",
            "headers": {
              "Retry-After": {
                "description": "How many seconds to wait before sending the request again.",
                "schema": {
                  "minimum": 1,
                  "type": "integer"
                }
              }
            }
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on Kiuki's side. It has been logged; try again later."
          }
        },
        "summary": "Quote a basket again from one origin",
        "tags": [
          "quotes"
        ],
        "x-required-scope": "quote:write"
      }
    },
    "/v1/webhook-endpoints": {
      "get": {
        "description": "Every endpoint of your organisation (a sandbox key's: the sandbox's), oldest first. Secrets are never shown again.\n\nNeeds a key with the `webhooks:write` scope.",
        "operationId": "listWebhookEndpoints",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookEndpointList"
                }
              }
            },
            "description": "OK"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No API key was sent, or it isn't a valid one. Send Authorization: Bearer kp_..."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "This key can't do this: it lacks the scope the message names, or its organisation can't use the API (not approved yet, or suspended), or it is another app's key. The message says which."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "rate_limited: this key sent requests faster than its rate (20 a second on average, in bursts of up to 100), so nothing was done. Send it again once as many seconds as Retry-After says have passed.",
            "headers": {
              "Retry-After": {
                "description": "How many seconds to wait before sending the request again.",
                "schema": {
                  "minimum": 1,
                  "type": "integer"
                }
              }
            }
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on Kiuki's side. It has been logged; try again later."
          }
        },
        "summary": "Your webhook endpoints",
        "tags": [
          "webhooks"
        ],
        "x-required-scope": "webhooks:write"
      },
      "post": {
        "description": "Registers an https address to be sent the events it wants (all of them when events is left out; an empty list is refused, 400). The address must be public: one that can't be found, or that leads to a private, loopback, link-local or other non-public address, is refused (400). The answer holds the endpoint's secret, which signs every delivery (the Kiuki-Signature header): it is shown this once only. An organisation has at most 10 endpoints (409).\n\nNeeds a key with the `webhooks:write` scope.",
        "operationId": "createWebhookEndpoint",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookEndpointRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookEndpointCreated"
                }
              }
            },
            "description": "Created"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is malformed. The message says what to fix."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No API key was sent, or it isn't a valid one. Send Authorization: Bearer kp_..."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "This key can't do this: it lacks the scope the message names, or its organisation can't use the API (not approved yet, or suspended), or it is another app's key. The message says which."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid but can't be done now. The error code and message say why."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "rate_limited: this key sent requests faster than its rate (20 a second on average, in bursts of up to 100), so nothing was done. Send it again once as many seconds as Retry-After says have passed.",
            "headers": {
              "Retry-After": {
                "description": "How many seconds to wait before sending the request again.",
                "schema": {
                  "minimum": 1,
                  "type": "integer"
                }
              }
            }
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on Kiuki's side. It has been logged; try again later."
          }
        },
        "summary": "Register a webhook endpoint",
        "tags": [
          "webhooks"
        ],
        "x-required-scope": "webhooks:write"
      }
    },
    "/v1/webhook-endpoints/{id}": {
      "delete": {
        "description": "Deletes the endpoint and its delivery log.\n\nNeeds a key with the `webhooks:write` scope.",
        "operationId": "deleteWebhookEndpoint",
        "parameters": [
          {
            "description": "The endpoint's id.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookEndpointDeleted"
                }
              }
            },
            "description": "OK"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No API key was sent, or it isn't a valid one. Send Authorization: Bearer kp_..."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "This key can't do this: it lacks the scope the message names, or its organisation can't use the API (not approved yet, or suspended), or it is another app's key. The message says which."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "There is no such record for your organisation."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "rate_limited: this key sent requests faster than its rate (20 a second on average, in bursts of up to 100), so nothing was done. Send it again once as many seconds as Retry-After says have passed.",
            "headers": {
              "Retry-After": {
                "description": "How many seconds to wait before sending the request again.",
                "schema": {
                  "minimum": 1,
                  "type": "integer"
                }
              }
            }
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on Kiuki's side. It has been logged; try again later."
          }
        },
        "summary": "Delete a webhook endpoint",
        "tags": [
          "webhooks"
        ],
        "x-required-scope": "webhooks:write"
      },
      "get": {
        "description": "An endpoint, whether it is on, and how its deliveries are going.\n\nNeeds a key with the `webhooks:write` scope.",
        "operationId": "getWebhookEndpoint",
        "parameters": [
          {
            "description": "The endpoint's id.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookEndpoint"
                }
              }
            },
            "description": "OK"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No API key was sent, or it isn't a valid one. Send Authorization: Bearer kp_..."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "This key can't do this: it lacks the scope the message names, or its organisation can't use the API (not approved yet, or suspended), or it is another app's key. The message says which."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "There is no such record for your organisation."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "rate_limited: this key sent requests faster than its rate (20 a second on average, in bursts of up to 100), so nothing was done. Send it again once as many seconds as Retry-After says have passed.",
            "headers": {
              "Retry-After": {
                "description": "How many seconds to wait before sending the request again.",
                "schema": {
                  "minimum": 1,
                  "type": "integer"
                }
              }
            }
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on Kiuki's side. It has been logged; try again later."
          }
        },
        "summary": "One webhook endpoint",
        "tags": [
          "webhooks"
        ],
        "x-required-scope": "webhooks:write"
      },
      "patch": {
        "description": "Changes the fields sent and leaves the others. enabled false turns the endpoint off: nothing is sent to it, its waiting deliveries are skipped, and the events from while it is off wait in its delivery log, skipped. enabled true turns it on again, afresh, after you or Kiuki turned it off, and sends it up to 100 of the deliveries skipped in the last 30 days, the oldest first, each with a day of retries (only the events it still wants). Any more stay skipped: send the ones you need again one by one (resend), or read GET /v1/orders. An empty events list is refused (400): leave events out to keep them as they are.\n\nNeeds a key with the `webhooks:write` scope.",
        "operationId": "updateWebhookEndpoint",
        "parameters": [
          {
            "description": "The endpoint's id.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookEndpointUpdate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookEndpoint"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is malformed. The message says what to fix."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No API key was sent, or it isn't a valid one. Send Authorization: Bearer kp_..."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "This key can't do this: it lacks the scope the message names, or its organisation can't use the API (not approved yet, or suspended), or it is another app's key. The message says which."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "There is no such record for your organisation."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "rate_limited: this key sent requests faster than its rate (20 a second on average, in bursts of up to 100), so nothing was done. Send it again once as many seconds as Retry-After says have passed.",
            "headers": {
              "Retry-After": {
                "description": "How many seconds to wait before sending the request again.",
                "schema": {
                  "minimum": 1,
                  "type": "integer"
                }
              }
            }
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on Kiuki's side. It has been logged; try again later."
          }
        },
        "summary": "Change a webhook endpoint",
        "tags": [
          "webhooks"
        ],
        "x-required-scope": "webhooks:write"
      }
    },
    "/v1/webhook-endpoints/{id}/deliveries": {
      "get": {
        "description": "The endpoint's most recent deliveries, newest first: each event sent to it, whether it was delivered, and its last attempt. Kept 30 days.\n\nNeeds a key with the `webhooks:write` scope.",
        "operationId": "listWebhookDeliveries",
        "parameters": [
          {
            "description": "The endpoint's id.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "How many, 1 to 200 (default 50).",
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookDeliveryList"
                }
              }
            },
            "description": "OK"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is malformed. The message says what to fix."
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No API key was sent, or it isn't a valid one. Send Authorization: Bearer kp_..."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "This key can't do this: it lacks the scope the message names, or its organisation can't use the API (not approved yet, or suspended), or it is another app's key. The message says which."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "There is no such record for your organisation."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "rate_limited: this key sent requests faster than its rate (20 a second on average, in bursts of up to 100), so nothing was done. Send it again once as many seconds as Retry-After says have passed.",
            "headers": {
              "Retry-After": {
                "description": "How many seconds to wait before sending the request again.",
                "schema": {
                  "minimum": 1,
                  "type": "integer"
                }
              }
            }
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on Kiuki's side. It has been logged; try again later."
          }
        },
        "summary": "An endpoint's deliveries",
        "tags": [
          "webhooks"
        ],
        "x-required-scope": "webhooks:write"
      }
    },
    "/v1/webhook-endpoints/{id}/deliveries/{delivery_id}": {
      "get": {
        "description": "What the delivery sends (the event, exactly as each attempt sent it) and every attempt: when, the answer's status, and the start of its body.\n\nNeeds a key with the `webhooks:write` scope.",
        "operationId": "getWebhookDelivery",
        "parameters": [
          {
            "description": "The endpoint's id.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "The delivery's id.",
            "in": "path",
            "name": "delivery_id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookDeliveryDetail"
                }
              }
            },
            "description": "OK"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No API key was sent, or it isn't a valid one. Send Authorization: Bearer kp_..."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "This key can't do this: it lacks the scope the message names, or its organisation can't use the API (not approved yet, or suspended), or it is another app's key. The message says which."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "There is no such record for your organisation."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "rate_limited: this key sent requests faster than its rate (20 a second on average, in bursts of up to 100), so nothing was done. Send it again once as many seconds as Retry-After says have passed.",
            "headers": {
              "Retry-After": {
                "description": "How many seconds to wait before sending the request again.",
                "schema": {
                  "minimum": 1,
                  "type": "integer"
                }
              }
            }
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on Kiuki's side. It has been logged; try again later."
          }
        },
        "summary": "One delivery, with its attempts",
        "tags": [
          "webhooks"
        ],
        "x-required-scope": "webhooks:write"
      }
    },
    "/v1/webhook-endpoints/{id}/deliveries/{delivery_id}/resend": {
      "post": {
        "description": "Sends the event again now, with a day of retries from now: one that failed, was skipped while the endpoint was off, or was delivered and needs handling again. The endpoint must be on (409), and a delivery is sent again at most 20 times (409).\n\nNeeds a key with the `webhooks:write` scope.",
        "operationId": "resendWebhookDelivery",
        "parameters": [
          {
            "description": "The endpoint's id.",
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "The delivery's id.",
            "in": "path",
            "name": "delivery_id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "202": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookDelivery"
                }
              }
            },
            "description": "Accepted"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No API key was sent, or it isn't a valid one. Send Authorization: Bearer kp_..."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "This key can't do this: it lacks the scope the message names, or its organisation can't use the API (not approved yet, or suspended), or it is another app's key. The message says which."
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "There is no such record for your organisation."
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "The request is valid but can't be done now. The error code and message say why."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "rate_limited: this key sent requests faster than its rate (20 a second on average, in bursts of up to 100), so nothing was done. Send it again once as many seconds as Retry-After says have passed.",
            "headers": {
              "Retry-After": {
                "description": "How many seconds to wait before sending the request again.",
                "schema": {
                  "minimum": 1,
                  "type": "integer"
                }
              }
            }
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on Kiuki's side. It has been logged; try again later."
          }
        },
        "summary": "Send a delivery again",
        "tags": [
          "webhooks"
        ],
        "x-required-scope": "webhooks:write"
      }
    },
    "/v1/whoami": {
      "get": {
        "description": "Shows which organisation the key acts for and the scopes it holds. Any valid key may call it.",
        "operationId": "whoAmI",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WhoAmI"
                }
              }
            },
            "description": "OK"
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "No API key was sent, or it isn't a valid one. Send Authorization: Bearer kp_..."
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "This key can't do this: it lacks the scope the message names, or its organisation can't use the API (not approved yet, or suspended), or it is another app's key. The message says which."
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "rate_limited: this key sent requests faster than its rate (20 a second on average, in bursts of up to 100), so nothing was done. Send it again once as many seconds as Retry-After says have passed.",
            "headers": {
              "Retry-After": {
                "description": "How many seconds to wait before sending the request again.",
                "schema": {
                  "minimum": 1,
                  "type": "integer"
                }
              }
            }
          },
          "500": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "Something went wrong on Kiuki's side. It has been logged; try again later."
          }
        },
        "summary": "The organisation and key in use",
        "tags": [
          "meta"
        ]
      }
    }
  },
  "security": [
    {
      "apiKey": []
    }
  ],
  "servers": [
    {
      "description": "Kiuki platform (not public yet)",
      "url": "https://platform.kiuki.com"
    }
  ],
  "tags": [
    {
      "description": "Markets and what is on sale in them.",
      "name": "catalogue"
    },
    {
      "description": "Reporting a problem with a line of one of your orders, and following what Kiuki decides.",
      "name": "complaints"
    },
    {
      "description": "The key in use, health, and this description.",
      "name": "meta"
    },
    {
      "description": "Placing, following and cancelling orders.",
      "name": "orders"
    },
    {
      "description": "Itemised prices for a basket, delivered.",
      "name": "quotes"
    },
    {
      "description": "Endpoints that are told as orders and shipments move, and their deliveries.",
      "name": "webhooks"
    }
  ],
  "webhooks": {
    "order.cancelled": {
      "post": {
        "description": "Every shipment of the order was cancelled or failed. shipments says which, and why.\n\nKiuki POSTs it to each of your endpoints that wants it, signed. Answer 2xx within 10 seconds; anything else (or no answer) is tried again later, for a day. The same event can come more than once: handle each id once.",
        "operationId": "webhookOrderCancelled",
        "parameters": [
          {
            "description": "t=\u003cunix time\u003e,v1=\u003chex HMAC-SHA256 of t.body under the endpoint's secret\u003e. Check it before trusting the body: /docs/webhooks.",
            "in": "header",
            "name": "Kiuki-Signature",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "The event's id, also in the body. Handle each once.",
            "in": "header",
            "name": "Kiuki-Event-Id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "The event's type, also in the body.",
            "in": "header",
            "name": "Kiuki-Event-Type",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "This delivery (the event, to this endpoint).",
            "in": "header",
            "name": "Kiuki-Delivery-Id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "1 for the first attempt, then 2, 3 ...",
            "in": "header",
            "name": "Kiuki-Delivery-Attempt",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookOrderEvent"
              }
            }
          },
          "required": true
        },
        "responses": {
          "2XX": {
            "description": "Received. The body of the answer is ignored."
          }
        },
        "security": [],
        "summary": "order.cancelled",
        "tags": [
          "webhooks"
        ]
      }
    },
    "order.completed": {
      "post": {
        "description": "Every shipment of the order went, was cancelled or failed, and at least one went. shipments says which.\n\nKiuki POSTs it to each of your endpoints that wants it, signed. Answer 2xx within 10 seconds; anything else (or no answer) is tried again later, for a day. The same event can come more than once: handle each id once.",
        "operationId": "webhookOrderCompleted",
        "parameters": [
          {
            "description": "t=\u003cunix time\u003e,v1=\u003chex HMAC-SHA256 of t.body under the endpoint's secret\u003e. Check it before trusting the body: /docs/webhooks.",
            "in": "header",
            "name": "Kiuki-Signature",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "The event's id, also in the body. Handle each once.",
            "in": "header",
            "name": "Kiuki-Event-Id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "The event's type, also in the body.",
            "in": "header",
            "name": "Kiuki-Event-Type",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "This delivery (the event, to this endpoint).",
            "in": "header",
            "name": "Kiuki-Delivery-Id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "1 for the first attempt, then 2, 3 ...",
            "in": "header",
            "name": "Kiuki-Delivery-Attempt",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookOrderEvent"
              }
            }
          },
          "required": true
        },
        "responses": {
          "2XX": {
            "description": "Received. The body of the answer is ignored."
          }
        },
        "security": [],
        "summary": "order.completed",
        "tags": [
          "webhooks"
        ]
      }
    },
    "order.paid": {
      "post": {
        "description": "The order's payment is secured.\n\nKiuki POSTs it to each of your endpoints that wants it, signed. Answer 2xx within 10 seconds; anything else (or no answer) is tried again later, for a day. The same event can come more than once: handle each id once.",
        "operationId": "webhookOrderPaid",
        "parameters": [
          {
            "description": "t=\u003cunix time\u003e,v1=\u003chex HMAC-SHA256 of t.body under the endpoint's secret\u003e. Check it before trusting the body: /docs/webhooks.",
            "in": "header",
            "name": "Kiuki-Signature",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "The event's id, also in the body. Handle each once.",
            "in": "header",
            "name": "Kiuki-Event-Id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "The event's type, also in the body.",
            "in": "header",
            "name": "Kiuki-Event-Type",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "This delivery (the event, to this endpoint).",
            "in": "header",
            "name": "Kiuki-Delivery-Id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "1 for the first attempt, then 2, 3 ...",
            "in": "header",
            "name": "Kiuki-Delivery-Attempt",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookOrderEvent"
              }
            }
          },
          "required": true
        },
        "responses": {
          "2XX": {
            "description": "Received. The body of the answer is ignored."
          }
        },
        "security": [],
        "summary": "order.paid",
        "tags": [
          "webhooks"
        ]
      }
    },
    "order.placed": {
      "post": {
        "description": "An order was placed. Its shipments wait for their payment (awaiting_payment is true).\n\nKiuki POSTs it to each of your endpoints that wants it, signed. Answer 2xx within 10 seconds; anything else (or no answer) is tried again later, for a day. The same event can come more than once: handle each id once.",
        "operationId": "webhookOrderPlaced",
        "parameters": [
          {
            "description": "t=\u003cunix time\u003e,v1=\u003chex HMAC-SHA256 of t.body under the endpoint's secret\u003e. Check it before trusting the body: /docs/webhooks.",
            "in": "header",
            "name": "Kiuki-Signature",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "The event's id, also in the body. Handle each once.",
            "in": "header",
            "name": "Kiuki-Event-Id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "The event's type, also in the body.",
            "in": "header",
            "name": "Kiuki-Event-Type",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "This delivery (the event, to this endpoint).",
            "in": "header",
            "name": "Kiuki-Delivery-Id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "1 for the first attempt, then 2, 3 ...",
            "in": "header",
            "name": "Kiuki-Delivery-Attempt",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookOrderEvent"
              }
            }
          },
          "required": true
        },
        "responses": {
          "2XX": {
            "description": "Received. The body of the answer is ignored."
          }
        },
        "security": [],
        "summary": "order.placed",
        "tags": [
          "webhooks"
        ]
      }
    },
    "shipment.acknowledged": {
      "post": {
        "description": "The site has the shipment and will pick it.\n\nKiuki POSTs it to each of your endpoints that wants it, signed. Answer 2xx within 10 seconds; anything else (or no answer) is tried again later, for a day. The same event can come more than once: handle each id once.",
        "operationId": "webhookShipmentAcknowledged",
        "parameters": [
          {
            "description": "t=\u003cunix time\u003e,v1=\u003chex HMAC-SHA256 of t.body under the endpoint's secret\u003e. Check it before trusting the body: /docs/webhooks.",
            "in": "header",
            "name": "Kiuki-Signature",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "The event's id, also in the body. Handle each once.",
            "in": "header",
            "name": "Kiuki-Event-Id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "The event's type, also in the body.",
            "in": "header",
            "name": "Kiuki-Event-Type",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "This delivery (the event, to this endpoint).",
            "in": "header",
            "name": "Kiuki-Delivery-Id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "1 for the first attempt, then 2, 3 ...",
            "in": "header",
            "name": "Kiuki-Delivery-Attempt",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookShipmentEvent"
              }
            }
          },
          "required": true
        },
        "responses": {
          "2XX": {
            "description": "Received. The body of the answer is ignored."
          }
        },
        "security": [],
        "summary": "shipment.acknowledged",
        "tags": [
          "webhooks"
        ]
      }
    },
    "shipment.cancelled": {
      "post": {
        "description": "The shipment was cancelled: cancelled_by (aggregator, site or kiuki) and reason say by whom and why.\n\nKiuki POSTs it to each of your endpoints that wants it, signed. Answer 2xx within 10 seconds; anything else (or no answer) is tried again later, for a day. The same event can come more than once: handle each id once.",
        "operationId": "webhookShipmentCancelled",
        "parameters": [
          {
            "description": "t=\u003cunix time\u003e,v1=\u003chex HMAC-SHA256 of t.body under the endpoint's secret\u003e. Check it before trusting the body: /docs/webhooks.",
            "in": "header",
            "name": "Kiuki-Signature",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "The event's id, also in the body. Handle each once.",
            "in": "header",
            "name": "Kiuki-Event-Id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "The event's type, also in the body.",
            "in": "header",
            "name": "Kiuki-Event-Type",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "This delivery (the event, to this endpoint).",
            "in": "header",
            "name": "Kiuki-Delivery-Id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "1 for the first attempt, then 2, 3 ...",
            "in": "header",
            "name": "Kiuki-Delivery-Attempt",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookShipmentEvent"
              }
            }
          },
          "required": true
        },
        "responses": {
          "2XX": {
            "description": "Received. The body of the answer is ignored."
          }
        },
        "security": [],
        "summary": "shipment.cancelled",
        "tags": [
          "webhooks"
        ]
      }
    },
    "shipment.delivered": {
      "post": {
        "description": "The shipment was delivered.\n\nKiuki POSTs it to each of your endpoints that wants it, signed. Answer 2xx within 10 seconds; anything else (or no answer) is tried again later, for a day. The same event can come more than once: handle each id once.",
        "operationId": "webhookShipmentDelivered",
        "parameters": [
          {
            "description": "t=\u003cunix time\u003e,v1=\u003chex HMAC-SHA256 of t.body under the endpoint's secret\u003e. Check it before trusting the body: /docs/webhooks.",
            "in": "header",
            "name": "Kiuki-Signature",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "The event's id, also in the body. Handle each once.",
            "in": "header",
            "name": "Kiuki-Event-Id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "The event's type, also in the body.",
            "in": "header",
            "name": "Kiuki-Event-Type",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "This delivery (the event, to this endpoint).",
            "in": "header",
            "name": "Kiuki-Delivery-Id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "1 for the first attempt, then 2, 3 ...",
            "in": "header",
            "name": "Kiuki-Delivery-Attempt",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookShipmentEvent"
              }
            }
          },
          "required": true
        },
        "responses": {
          "2XX": {
            "description": "Received. The body of the answer is ignored."
          }
        },
        "security": [],
        "summary": "shipment.delivered",
        "tags": [
          "webhooks"
        ]
      }
    },
    "shipment.dispatched": {
      "post": {
        "description": "The shipment left the site; carrier and tracking are set when the site gave them.\n\nKiuki POSTs it to each of your endpoints that wants it, signed. Answer 2xx within 10 seconds; anything else (or no answer) is tried again later, for a day. The same event can come more than once: handle each id once.",
        "operationId": "webhookShipmentDispatched",
        "parameters": [
          {
            "description": "t=\u003cunix time\u003e,v1=\u003chex HMAC-SHA256 of t.body under the endpoint's secret\u003e. Check it before trusting the body: /docs/webhooks.",
            "in": "header",
            "name": "Kiuki-Signature",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "The event's id, also in the body. Handle each once.",
            "in": "header",
            "name": "Kiuki-Event-Id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "The event's type, also in the body.",
            "in": "header",
            "name": "Kiuki-Event-Type",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "This delivery (the event, to this endpoint).",
            "in": "header",
            "name": "Kiuki-Delivery-Id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "1 for the first attempt, then 2, 3 ...",
            "in": "header",
            "name": "Kiuki-Delivery-Attempt",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookShipmentEvent"
              }
            }
          },
          "required": true
        },
        "responses": {
          "2XX": {
            "description": "Received. The body of the answer is ignored."
          }
        },
        "security": [],
        "summary": "shipment.dispatched",
        "tags": [
          "webhooks"
        ]
      }
    },
    "shipment.failed": {
      "post": {
        "description": "Kiuki gave up on the shipment: it won't be sent, as if it had been cancelled. reason says so in plain words; Kiuki's own notes about it aren't shared.\n\nKiuki POSTs it to each of your endpoints that wants it, signed. Answer 2xx within 10 seconds; anything else (or no answer) is tried again later, for a day. The same event can come more than once: handle each id once.",
        "operationId": "webhookShipmentFailed",
        "parameters": [
          {
            "description": "t=\u003cunix time\u003e,v1=\u003chex HMAC-SHA256 of t.body under the endpoint's secret\u003e. Check it before trusting the body: /docs/webhooks.",
            "in": "header",
            "name": "Kiuki-Signature",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "The event's id, also in the body. Handle each once.",
            "in": "header",
            "name": "Kiuki-Event-Id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "The event's type, also in the body.",
            "in": "header",
            "name": "Kiuki-Event-Type",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "This delivery (the event, to this endpoint).",
            "in": "header",
            "name": "Kiuki-Delivery-Id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "1 for the first attempt, then 2, 3 ...",
            "in": "header",
            "name": "Kiuki-Delivery-Attempt",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookShipmentEvent"
              }
            }
          },
          "required": true
        },
        "responses": {
          "2XX": {
            "description": "Received. The body of the answer is ignored."
          }
        },
        "security": [],
        "summary": "shipment.failed",
        "tags": [
          "webhooks"
        ]
      }
    },
    "shipment.released": {
      "post": {
        "description": "A shipment's payment is secured and it has gone to its site.\n\nKiuki POSTs it to each of your endpoints that wants it, signed. Answer 2xx within 10 seconds; anything else (or no answer) is tried again later, for a day. The same event can come more than once: handle each id once.",
        "operationId": "webhookShipmentReleased",
        "parameters": [
          {
            "description": "t=\u003cunix time\u003e,v1=\u003chex HMAC-SHA256 of t.body under the endpoint's secret\u003e. Check it before trusting the body: /docs/webhooks.",
            "in": "header",
            "name": "Kiuki-Signature",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "The event's id, also in the body. Handle each once.",
            "in": "header",
            "name": "Kiuki-Event-Id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "The event's type, also in the body.",
            "in": "header",
            "name": "Kiuki-Event-Type",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "This delivery (the event, to this endpoint).",
            "in": "header",
            "name": "Kiuki-Delivery-Id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "1 for the first attempt, then 2, 3 ...",
            "in": "header",
            "name": "Kiuki-Delivery-Attempt",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookShipmentEvent"
              }
            }
          },
          "required": true
        },
        "responses": {
          "2XX": {
            "description": "Received. The body of the answer is ignored."
          }
        },
        "security": [],
        "summary": "shipment.released",
        "tags": [
          "webhooks"
        ]
      }
    }
  }
}