{
  "openapi": "3.1.0",
  "info": {
    "title": "Private Plates public API",
    "version": "1.0.0",
    "description": "Search the registration marks on sale at PrivatePlates.co.uk, read one registration with its live price and availability, read the prices of the optional extras and price a basket. These endpoints need no key.\n\nOrdering through the API is available to approved partners with a key, sent in the X-Api-Key header. POST /api/order places the order and answers with the page the buyer pays on; GET /api/order/{reference} says where an order has got to. Nothing is secured before the buyer has paid.\n\nA registration’s price is in pounds with VAT and the DVLA assignment fee inside it; a basket is priced in pence. Read prices and availability live: both move.\n\nTo ask for a key, or about anything here, email Sales@PrivatePlates.co.uk.",
    "contact": {
      "name": "Private Plates",
      "email": "sales@privateplates.co.uk",
      "url": "https://www.privateplates.co.uk/contact"
    }
  },
  "servers": [
    {
      "url": "https://www.privateplates.co.uk"
    }
  ],
  "paths": {
    "/api/search": {
      "post": {
        "operationId": "searchRegistrations",
        "summary": "Search the registrations on sale",
        "description": "Limit: 40 searches a minute for each visitor. Every address under /api shares a limit of 300 requests a minute for each visitor.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SearchRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The registrations found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SearchResponse"
                }
              }
            }
          },
          "400": {
            "description": "The body is not a search.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Over the limit.",
            "headers": {
              "RateLimit-Limit": {
                "schema": {
                  "type": "integer"
                },
                "description": "The requests allowed in the window."
              },
              "RateLimit-Remaining": {
                "schema": {
                  "type": "integer"
                },
                "description": "The requests left in the window."
              },
              "RateLimit-Reset": {
                "schema": {
                  "type": "integer"
                },
                "description": "Seconds until the window starts again."
              },
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "Seconds to wait before asking again."
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "The search is temporarily offline; outage is true. Ask again shortly.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/plate/{reg}": {
      "get": {
        "operationId": "getRegistration",
        "summary": "One registration, with its price and whether it can be bought now",
        "description": "Read it live: prices and availability move. Every address under /api shares a limit of 300 requests a minute for each visitor.",
        "parameters": [
          {
            "name": "reg",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The registration mark; spaces and lower case are accepted."
          }
        ],
        "responses": {
          "200": {
            "description": "The registration, or ok false with a message where the text is not a registration mark.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Registration"
                }
              }
            }
          },
          "429": {
            "description": "Over the limit.",
            "headers": {
              "RateLimit-Limit": {
                "schema": {
                  "type": "integer"
                },
                "description": "The requests allowed in the window."
              },
              "RateLimit-Remaining": {
                "schema": {
                  "type": "integer"
                },
                "description": "The requests left in the window."
              },
              "RateLimit-Reset": {
                "schema": {
                  "type": "integer"
                },
                "description": "Seconds until the window starts again."
              },
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "Seconds to wait before asking again."
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "It could not be loaded just now.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "message"
                  ],
                  "properties": {
                    "ok": {
                      "const": false
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/pricing": {
      "get": {
        "operationId": "getPricing",
        "summary": "The prices of the optional extras",
        "description": "Physical number plates and their options, the assignment service and delivery, in pence. The price of a registration is on the registration itself. Every address under /api shares a limit of 300 requests a minute for each visitor.",
        "responses": {
          "200": {
            "description": "The catalogue.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PricingResponse"
                }
              }
            }
          },
          "429": {
            "description": "Over the limit.",
            "headers": {
              "RateLimit-Limit": {
                "schema": {
                  "type": "integer"
                },
                "description": "The requests allowed in the window."
              },
              "RateLimit-Remaining": {
                "schema": {
                  "type": "integer"
                },
                "description": "The requests left in the window."
              },
              "RateLimit-Reset": {
                "schema": {
                  "type": "integer"
                },
                "description": "Seconds until the window starts again."
              },
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "Seconds to wait before asking again."
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/quote": {
      "post": {
        "operationId": "quoteBasket",
        "summary": "Price a basket of up to nine lines",
        "description": "Nothing is reserved and nothing is charged. With live true every registration in the basket is checked for availability first, and those requests are limited to 30 in 15 minutes for each visitor. Every address under /api shares a limit of 300 requests a minute for each visitor.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/QuoteRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The basket as priced.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/QuoteResponse"
                }
              }
            }
          },
          "400": {
            "description": "The basket cannot be priced: no lines, more than nine, a registration that is not recognised, is no longer available or is priced on application.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problems"
                }
              }
            }
          },
          "429": {
            "description": "Over the limit. The live check answers with problems; the general limit answers with error.",
            "headers": {
              "RateLimit-Limit": {
                "schema": {
                  "type": "integer"
                },
                "description": "The requests allowed in the window."
              },
              "RateLimit-Remaining": {
                "schema": {
                  "type": "integer"
                },
                "description": "The requests left in the window."
              },
              "RateLimit-Reset": {
                "schema": {
                  "type": "integer"
                },
                "description": "Seconds until the window starts again."
              },
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "Seconds to wait before asking again."
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/Problems"
                    },
                    {
                      "$ref": "#/components/schemas/Error"
                    }
                  ]
                }
              }
            }
          },
          "503": {
            "description": "It could not be priced just now. Nothing has been charged.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problems"
                }
              }
            }
          }
        }
      }
    },
    "/api/order": {
      "post": {
        "operationId": "placeOrder",
        "summary": "Place an order for a buyer (approved partners)",
        "description": "For approved partners with a key granted orders. Send the key as X-Api-Key and an Idempotency-Key of your own choosing for each order: the same Idempotency-Key sent again answers with the order the first request made, never a second order. The body is the basket as priced by POST /api/quote with the buyer and what the buyer agreed to. Every check the website's checkout makes is made again, the availability of each registration included. The answer carries payUrl, the page on PrivatePlates.co.uk where the buyer pays by card; nothing is secured until they have. Limit: 20 orders in 15 minutes for each key. Every address under /api shares a limit of 300 requests a minute for each visitor.",
        "security": [
          {
            "partnerKey": []
          }
        ],
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9_-]{8,120}$"
            },
            "description": "One for each order you mean to place."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OrderRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The order, with where the buyer pays and where the order can be read. replayed is true when this Idempotency-Key had already made it.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrderPlaced"
                }
              }
            }
          },
          "400": {
            "description": "The order cannot be taken as sent; each problem names its field.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problems"
                }
              }
            }
          },
          "401": {
            "description": "The key is not valid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/KeyRefused"
                }
              }
            }
          },
          "403": {
            "description": "The key may not place orders.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/KeyRefused"
                }
              }
            }
          },
          "409": {
            "description": "The first request with this Idempotency-Key is still being worked on. Ask again after Retry-After seconds.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/KeyRefused"
                }
              }
            }
          },
          "429": {
            "description": "Over the limit for this key or this address.",
            "headers": {
              "RateLimit-Limit": {
                "schema": {
                  "type": "integer"
                },
                "description": "The requests allowed in the window."
              },
              "RateLimit-Remaining": {
                "schema": {
                  "type": "integer"
                },
                "description": "The requests left in the window."
              },
              "RateLimit-Reset": {
                "schema": {
                  "type": "integer"
                },
                "description": "Seconds until the window starts again."
              },
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "Seconds to wait before asking again."
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/KeyRefused"
                    },
                    {
                      "$ref": "#/components/schemas/Error"
                    }
                  ]
                }
              }
            }
          },
          "500": {
            "description": "The order could not be saved. Nothing has been charged.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problems"
                }
              }
            }
          }
        }
      }
    },
    "/api/order/{reference}": {
      "get": {
        "operationId": "getOrder",
        "summary": "Where an order has got to",
        "description": "The status, lines and totals of one order. No contact details are given. Limited for each address. Every address under /api shares a limit of 300 requests a minute for each visitor.",
        "parameters": [
          {
            "name": "reference",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The reference POST /api/order answered with."
          }
        ],
        "responses": {
          "200": {
            "description": "The order.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "order"
                  ],
                  "additionalProperties": true,
                  "properties": {
                    "ok": {
                      "const": true
                    },
                    "order": {
                      "$ref": "#/components/schemas/OrderSummary"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "No order has that reference.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Over the limit.",
            "headers": {
              "RateLimit-Limit": {
                "schema": {
                  "type": "integer"
                },
                "description": "The requests allowed in the window."
              },
              "RateLimit-Remaining": {
                "schema": {
                  "type": "integer"
                },
                "description": "The requests left in the window."
              },
              "RateLimit-Reset": {
                "schema": {
                  "type": "integer"
                },
                "description": "Seconds until the window starts again."
              },
              "Retry-After": {
                "schema": {
                  "type": "integer"
                },
                "description": "Seconds to wait before asking again."
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Error": {
        "type": "object",
        "required": [
          "ok",
          "error"
        ],
        "properties": {
          "ok": {
            "const": false
          },
          "error": {
            "type": "string",
            "description": "What went wrong, in a sentence a person can read."
          },
          "outage": {
            "type": "boolean",
            "description": "True where the search is temporarily offline."
          }
        }
      },
      "Problems": {
        "type": "object",
        "required": [
          "ok",
          "problems"
        ],
        "properties": {
          "ok": {
            "const": false
          },
          "problems": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "field",
                "message"
              ],
              "properties": {
                "field": {
                  "type": "string",
                  "description": "The part of the request the message is about, or empty."
                },
                "message": {
                  "type": "string"
                }
              }
            }
          }
        }
      },
      "SearchRequest": {
        "type": "object",
        "required": [
          "q"
        ],
        "description": "budgetMin, budgetMax, vehicleYear, vehicleMonth, lanePage, laneSize and lanePages are also read in snake case (budget_max and so on); the camel-case spelling wins where both are sent.",
        "properties": {
          "q": {
            "type": "string",
            "minLength": 1,
            "maxLength": 40,
            "description": "What to look for: a name, initials, a word, a number or a whole registration mark."
          },
          "sort": {
            "type": "string",
            "maxLength": 20
          },
          "page": {
            "type": "integer",
            "minimum": 1,
            "maximum": 200
          },
          "lanePage": {
            "type": "integer",
            "minimum": 1,
            "maximum": 500,
            "description": "The page of a paged group of results, which moves independently of page."
          },
          "laneSize": {
            "enum": [
              25,
              50,
              100,
              200
            ],
            "description": "How many registrations a paged group returns at a time."
          },
          "lanePages": {
            "type": "object",
            "propertyNames": {
              "enum": [
                "word_current",
                "word_prefix",
                "five_current",
                "six_current",
                "tail_current",
                "containing"
              ]
            },
            "additionalProperties": {
              "type": "integer",
              "minimum": 1,
              "maximum": 500
            },
            "description": "A page for each paged group, so paging one does not page the others."
          },
          "budgetMin": {
            "type": "integer",
            "minimum": 0,
            "description": "The lowest price wanted, in whole pounds."
          },
          "budgetMax": {
            "type": "integer",
            "minimum": 0,
            "description": "The highest price wanted, in whole pounds."
          },
          "styles": {
            "type": "array",
            "maxItems": 10,
            "items": {
              "type": "string",
              "maxLength": 20
            },
            "description": "The styles of registration wanted, for example prefix, current or ni."
          },
          "vehicleYear": {
            "type": "integer",
            "minimum": 1900,
            "maximum": 2100,
            "description": "The year the vehicle was first registered. With it, registrations that vehicle cannot carry are left out."
          },
          "vehicleMonth": {
            "type": "integer",
            "minimum": 1,
            "maximum": 12
          }
        }
      },
      "ResultMark": {
        "type": "object",
        "description": "One registration in a search answer.",
        "properties": {
          "registration": {
            "type": "string",
            "description": "The registration mark with its legal spacing, for example A22 GHJ."
          },
          "compact": {
            "type": "string",
            "description": "The mark without spaces, as the registration endpoint and the page at /numberplate/{compact} take it."
          },
          "format": {
            "type": "string",
            "description": "The style of the registration: prefix, current, ni and so on."
          },
          "price": {
            "type": [
              "number",
              "null"
            ],
            "description": "The price in pounds, with VAT and the DVLA assignment fee inside it."
          },
          "in_stock": {
            "type": "boolean",
            "description": "Whether it can be bought now."
          },
          "earliest": {
            "type": [
              "string",
              "null"
            ],
            "format": "date",
            "description": "The first day a vehicle could be registered and still carry this mark; null where the mark carries no age."
          }
        },
        "additionalProperties": true
      },
      "SearchResponse": {
        "type": "object",
        "required": [
          "ok"
        ],
        "description": "The registrations found arrive in named groups, each a list of ResultMark objects, beside the members listed here. Read the price and availability of any one from the registration endpoint before relying on it.",
        "properties": {
          "ok": {
            "const": true
          },
          "query": {
            "type": "string",
            "description": "The search as it was read."
          },
          "interpreted_as": {
            "type": [
              "string",
              "null"
            ],
            "description": "The word a search written with numbers was read as, where it was."
          },
          "age_filter": {
            "type": "object",
            "properties": {
              "applied": {
                "type": "boolean"
              },
              "vehicle_year": {
                "type": [
                  "integer",
                  "null"
                ]
              },
              "hidden": {
                "type": "integer",
                "description": "How many registrations were left out because the vehicle cannot carry them."
              }
            },
            "additionalProperties": true
          }
        },
        "additionalProperties": true
      },
      "Registration": {
        "type": "object",
        "required": [
          "ok"
        ],
        "description": "One registration. Where ok is false only message is given: the text asked for is not a registration mark that can be issued or transferred.",
        "properties": {
          "ok": {
            "type": "boolean"
          },
          "message": {
            "type": "string",
            "description": "Given where ok is false."
          },
          "registration": {
            "type": "string",
            "description": "The mark with its legal spacing."
          },
          "compact": {
            "type": "string",
            "description": "The mark without spaces."
          },
          "category": {
            "type": "string",
            "description": "The style: prefix, current, ni and so on."
          },
          "category_label": {
            "type": "string"
          },
          "category_note": {
            "type": "string"
          },
          "price": {
            "type": [
              "number",
              "null"
            ],
            "description": "The price in pounds, with VAT and the DVLA assignment fee inside it. Null where the registration is not on sale or is priced on application."
          },
          "dvla_price": {
            "type": [
              "number",
              "null"
            ],
            "description": "The DVLA’s own published price for the same mark, in pounds, where the DVLA also offers it."
          },
          "in_stock": {
            "type": "boolean",
            "description": "Whether it can be bought now."
          },
          "sold": {
            "type": "boolean",
            "description": "True, with in_stock false, where it has just been bought by somebody else."
          },
          "vat_free": {
            "type": "boolean"
          },
          "indexable": {
            "type": "boolean"
          },
          "assignable": {
            "description": "A sentence on which vehicles the mark may go on."
          },
          "age_limit": {
            "type": [
              "integer",
              "null"
            ],
            "description": "The earliest year of first registration of a vehicle that may carry it."
          },
          "earliest": {
            "type": [
              "string",
              "null"
            ],
            "format": "date",
            "description": "The first day a vehicle could be registered and still carry it."
          },
          "fees": {
            "type": "object",
            "properties": {
              "dvla_assignment_fee": {
                "type": "number",
                "description": "The DVLA assignment fee in pounds, which is inside price and never added to it."
              },
              "total": {
                "type": [
                  "number",
                  "null"
                ],
                "description": "What the registration costs in pounds, VAT and the DVLA assignment fee included: the same figure as price."
              }
            },
            "additionalProperties": true
          },
          "certificate": {
            "type": [
              "string",
              "null"
            ],
            "description": "The DVLA certificate it comes on, for example a V750 certificate."
          },
          "certificate_held": {
            "type": "boolean"
          },
          "quality": {
            "description": "Where the mark sits on its own merits, out of 100. Not a price."
          }
        },
        "additionalProperties": true
      },
      "Option": {
        "type": "object",
        "required": [
          "label",
          "price",
          "enabled"
        ],
        "properties": {
          "label": {
            "type": "string"
          },
          "note": {
            "type": "string"
          },
          "price": {
            "type": "integer",
            "description": "In pence, VAT included."
          },
          "enabled": {
            "type": "boolean",
            "description": "Whether it is on sale."
          },
          "fixed": {
            "type": "boolean"
          },
          "only": {
            "const": "plates"
          }
        }
      },
      "PricingResponse": {
        "type": "object",
        "required": [
          "ok",
          "catalogue",
          "vatRate",
          "sizes"
        ],
        "properties": {
          "ok": {
            "const": true
          },
          "catalogue": {
            "type": "object",
            "description": "The prices of the optional extras: physical number plates and their options, the assignment service and delivery. Each member is one Option or a group of them by key.",
            "additionalProperties": {
              "anyOf": [
                {
                  "$ref": "#/components/schemas/Option"
                },
                {
                  "type": "object",
                  "additionalProperties": {
                    "$ref": "#/components/schemas/Option"
                  }
                }
              ]
            }
          },
          "vatRate": {
            "type": "number",
            "description": "The rate of VAT, per cent."
          },
          "sizes": {
            "type": "object",
            "description": "Every size of physical number plate made, by the key the size group of the catalogue prices.",
            "additionalProperties": {
              "type": "object",
              "required": [
                "label",
                "width",
                "height",
                "group",
                "vehicles",
                "file"
              ],
              "properties": {
                "label": {
                  "type": "string"
                },
                "width": {
                  "type": "integer",
                  "description": "Millimetres."
                },
                "height": {
                  "type": "integer",
                  "description": "Millimetres."
                },
                "group": {
                  "enum": [
                    "Standard",
                    "Oversized",
                    "Import",
                    "Hex",
                    "Shaped"
                  ]
                },
                "vehicles": {
                  "type": "string"
                },
                "file": {
                  "type": "string"
                },
                "single": {
                  "type": "boolean"
                }
              }
            }
          }
        }
      },
      "Design": {
        "type": "object",
        "description": "The physical number plates wanted with a line. Every key is one the catalogue prices; no price is ever sent.",
        "additionalProperties": false,
        "properties": {
          "finish": {
            "type": "string",
            "maxLength": 20
          },
          "flag": {
            "type": "string",
            "maxLength": 20
          },
          "border": {
            "type": "string",
            "maxLength": 20
          },
          "material": {
            "type": "string",
            "maxLength": 20
          },
          "size": {
            "type": "string",
            "maxLength": 20
          },
          "sizeFront": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 20
          },
          "mono": {
            "type": "boolean"
          },
          "fixings": {
            "type": "array",
            "maxItems": 3,
            "items": {
              "type": "string",
              "maxLength": 20
            }
          },
          "frame": {
            "type": "string",
            "maxLength": 20
          },
          "wrap": {
            "type": "boolean"
          },
          "splitSizes": {
            "type": "boolean"
          },
          "car": {
            "type": "string",
            "maxLength": 24
          },
          "gelBadge": {
            "type": "boolean"
          },
          "capColour": {
            "enum": [
              "black",
              "white",
              "yellow"
            ]
          },
          "firstRegistered": {
            "type": "integer",
            "minimum": 1900,
            "maximum": 2100
          }
        }
      },
      "Line": {
        "type": "object",
        "required": [
          "compact"
        ],
        "properties": {
          "compact": {
            "type": "string",
            "minLength": 1,
            "maxLength": 12,
            "description": "The registration mark without spaces."
          },
          "platesOnly": {
            "type": "boolean",
            "description": "Physical number plates alone, for a registration mark the buyer already holds."
          },
          "plates": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Design"
              },
              {
                "type": "null"
              }
            ]
          },
          "assign": {
            "type": "object",
            "description": "The vehicle this mark is going on and in whose name. Not needed to price a basket.",
            "properties": {
              "keeper": {
                "type": "string",
                "maxLength": 120
              },
              "reg": {
                "type": "string",
                "maxLength": 10
              },
              "year": {
                "type": "string",
                "maxLength": 8
              },
              "later": {
                "type": "boolean"
              },
              "docRef": {
                "type": "string",
                "pattern": "^\\d{11}$|^$"
              },
              "keeperPostcode": {
                "type": "string",
                "maxLength": 12
              },
              "v5cLater": {
                "type": "boolean"
              },
              "acknowledged": {
                "type": "array",
                "maxItems": 8,
                "description": "The buyer's tick for each vehicle check finding of severity blocks or action: its code and its acknowledgement sentence, word for word. An order missing one is refused.",
                "items": {
                  "type": "object",
                  "required": [
                    "code",
                    "wording"
                  ],
                  "properties": {
                    "code": {
                      "type": "string",
                      "maxLength": 40
                    },
                    "wording": {
                      "type": "string",
                      "maxLength": 400
                    }
                  }
                }
              },
              "newlyBought": {
                "type": "boolean",
                "description": "The buyer has just bought the vehicle."
              }
            }
          },
          "assignService": {
            "type": "boolean",
            "description": "This line takes the optional assignment service."
          }
        }
      },
      "QuoteRequest": {
        "type": "object",
        "required": [
          "lines"
        ],
        "properties": {
          "lines": {
            "type": "array",
            "minItems": 1,
            "maxItems": 9,
            "items": {
              "$ref": "#/components/schemas/Line"
            }
          },
          "assignment": {
            "type": "boolean",
            "description": "The optional assignment service on every line."
          },
          "delivery": {
            "type": "string",
            "maxLength": 30,
            "description": "The key of a delivery choice from the catalogue."
          },
          "live": {
            "type": "boolean",
            "description": "True asks for a live availability check of every registration in the basket before it is priced. Where one has gone the answer is 400 with a problem on lines."
          }
        }
      },
      "Postage": {
        "type": "object",
        "required": [
          "key",
          "label",
          "amount"
        ],
        "properties": {
          "key": {
            "type": "string"
          },
          "label": {
            "type": "string"
          },
          "note": {
            "type": "string"
          },
          "amount": {
            "type": "integer",
            "description": "In pence."
          },
          "included": {
            "type": "boolean"
          }
        }
      },
      "PricedLine": {
        "type": "object",
        "description": "One line as priced. Every amount is in pence.",
        "properties": {
          "compact": {
            "type": "string"
          },
          "registration": {
            "type": "string"
          },
          "category": {
            "type": "string"
          },
          "priceRegistration": {
            "type": "integer",
            "description": "The registration, with VAT and the DVLA assignment fee inside it."
          },
          "priceDvlaFee": {
            "type": "integer",
            "description": "The DVLA assignment fee inside priceRegistration. Stated, never added."
          },
          "pricePlates": {
            "type": "integer",
            "description": "The physical number plates on this line, if any."
          },
          "plateLines": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "label",
                "amount"
              ],
              "properties": {
                "label": {
                  "type": "string"
                },
                "amount": {
                  "type": "integer"
                }
              }
            }
          },
          "design": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Design"
              },
              {
                "type": "null"
              }
            ]
          },
          "platesOnly": {
            "type": "boolean"
          },
          "assignService": {
            "type": "boolean"
          },
          "vatFree": {
            "type": "boolean"
          },
          "feeVat": {
            "type": "boolean"
          },
          "total": {
            "type": "integer"
          },
          "vehicleCheck": {
            "type": "object",
            "description": "Where the line names a vehicle: what the DVLA's and DVSA's records show about it taking the mark, as findings with a code, a severity (blocks, action or hint), a message and an acknowledgement sentence."
          }
        },
        "additionalProperties": true
      },
      "QuoteResponse": {
        "type": "object",
        "required": [
          "ok",
          "order"
        ],
        "properties": {
          "ok": {
            "const": true
          },
          "order": {
            "type": "object",
            "description": "The basket as priced. Every amount is in pence.",
            "properties": {
              "lines": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/PricedLine"
                }
              },
              "totals": {
                "type": "object",
                "properties": {
                  "registrations": {
                    "type": "integer"
                  },
                  "dvlaFees": {
                    "type": "integer",
                    "description": "Already inside registrations; stated, not added to the total."
                  },
                  "plates": {
                    "type": "integer"
                  },
                  "service": {
                    "type": "integer"
                  },
                  "delivery": {
                    "type": "integer"
                  },
                  "vat": {
                    "type": "integer",
                    "description": "The VAT inside the total."
                  },
                  "total": {
                    "type": "integer"
                  }
                }
              },
              "assignment": {
                "type": "boolean"
              },
              "serviceFee": {
                "type": "integer",
                "description": "The assignment service for one registration."
              },
              "serviceMarks": {
                "type": "integer",
                "description": "How many registrations take the assignment service."
              },
              "delivery": {
                "$ref": "#/components/schemas/Postage"
              },
              "deliveryOptions": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/Postage"
                }
              },
              "supply": {
                "type": "object",
                "properties": {
                  "key": {
                    "enum": [
                      "in_full",
                      "forthcoming",
                      "hold",
                      "held"
                    ]
                  },
                  "message": {
                    "type": "string",
                    "description": "What the buyer is told about payment."
                  }
                }
              }
            }
          }
        }
      },
      "KeyRefused": {
        "type": "object",
        "required": [
          "ok",
          "message"
        ],
        "properties": {
          "ok": {
            "const": false
          },
          "message": {
            "type": "string"
          },
          "retryAfterSeconds": {
            "type": "integer"
          }
        }
      },
      "OrderRequest": {
        "type": "object",
        "required": [
          "lines",
          "buyer",
          "consents"
        ],
        "description": "lines, assignment and delivery are exactly as sent to POST /api/quote.",
        "properties": {
          "lines": {
            "type": "array",
            "minItems": 1,
            "maxItems": 9,
            "items": {
              "type": "object",
              "additionalProperties": true
            }
          },
          "assignment": {
            "type": "boolean",
            "description": "True adds the service that assigns the registration to the vehicle."
          },
          "delivery": {
            "type": "string",
            "description": "A postage key from GET /api/pricing; otherwise the free standard."
          },
          "buyer": {
            "type": "object",
            "required": [
              "name",
              "email",
              "phone"
            ],
            "properties": {
              "name": {
                "type": "string",
                "maxLength": 120
              },
              "email": {
                "type": "string",
                "maxLength": 160
              },
              "phone": {
                "type": "string",
                "description": "A UK mobile number."
              },
              "address": {
                "type": "string",
                "maxLength": 300
              },
              "postcode": {
                "type": "string",
                "maxLength": 12
              }
            }
          },
          "consents": {
            "type": "object",
            "required": [
              "terms",
              "startNow"
            ],
            "description": "What the buyer agreed to. Send true only where the buyer was shown the terms at https://www.privateplates.co.uk/terms and asked for the work to start straight away.",
            "properties": {
              "terms": {
                "type": "boolean"
              },
              "startNow": {
                "type": "boolean"
              },
              "startNowWording": {
                "type": "string",
                "maxLength": 400,
                "description": "The words the buyer was shown."
              },
              "thirdParty": {
                "type": "boolean"
              },
              "thirdPartyName": {
                "type": "string",
                "maxLength": 120
              }
            }
          }
        }
      },
      "OrderSummary": {
        "type": "object",
        "required": [
          "reference",
          "status"
        ],
        "additionalProperties": true,
        "properties": {
          "reference": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "description": "awaiting_payment until the buyer has paid."
          },
          "totals": {
            "type": "object",
            "additionalProperties": true,
            "description": "In pence."
          }
        }
      },
      "OrderPlaced": {
        "type": "object",
        "required": [
          "ok",
          "order",
          "payUrl",
          "statusUrl"
        ],
        "properties": {
          "ok": {
            "const": true
          },
          "replayed": {
            "type": "boolean"
          },
          "order": {
            "$ref": "#/components/schemas/OrderSummary"
          },
          "payUrl": {
            "type": "string",
            "format": "uri",
            "description": "Give this to the buyer: the page where they pay by card."
          },
          "statusUrl": {
            "type": "string",
            "format": "uri"
          }
        }
      }
    },
    "securitySchemes": {
      "partnerKey": {
        "type": "apiKey",
        "in": "header",
        "name": "X-Api-Key",
        "description": "For approved partners placing orders. Not needed to search, read a registration or price a basket."
      }
    }
  }
}