{
  "openapi": "3.1.0",
  "info": {
    "title": "Poolse Tolk Direct: document translation ordering API",
    "version": "1.0.0",
    "summary": "Price a Polish-Dutch document translation, prepare an order and hand the customer a checkout link.",
    "description": "Public API without login, with rate limits. An AI agent can check prices, upload documents, get a binding quote (our server counts the words) and prepare an order. The agent never pays and never accepts terms: the order response contains checkout_url, a page where the HUMAN customer reads the summary, accepts the terms and the data consents and pays with Mollie (iDEAL, Bancontact or BLIK). Before you upload any file, show your user our privacy policy (https://marcinkowalski.nl/privacyverklaring, Polish: https://marcinkowalski.nl/pl/polityka-prywatnosci) and upload the file only with the user's knowledge. This is information, not consent: the user gives the consents on the checkout page. Every document type, including identity, medical, criminal-record and other_document, is counted and priced the same way. Files that fail our security checks give 422 manual_quote_required. A quote is binding for 2 hours (expires_at). After that, make a new quote. Flow: GET /pricing, POST /uploads, PUT the file to the returned URL, POST /quotes, POST /orders (Idempotency-Key required), give checkout_url to the customer, GET /orders/{id} for the status.",
    "termsOfService": "https://marcinkowalski.nl/algemene-voorwaarden",
    "contact": {
      "name": "Marcin Kowalski, Poolse Tolk Direct",
      "url": "https://marcinkowalski.nl/contact"
    },
    "license": {
      "name": "Proprietary",
      "identifier": "LicenseRef-Proprietary"
    }
  },
  "servers": [
    {
      "url": "https://marcinkowalski.nl"
    }
  ],
  "tags": [
    {
      "name": "pricing",
      "description": "Public prices and rules."
    },
    {
      "name": "quotes",
      "description": "Uploads, estimates and binding quotes (the server counts the words)."
    },
    {
      "name": "orders",
      "description": "Order preparation and status. Payment and consent happen on the checkout page, by the customer."
    }
  ],
  "paths": {
    "/api/v1/pricing": {
      "get": {
        "operationId": "getPricing",
        "security": [],
        "tags": [
          "pricing"
        ],
        "summary": "Prices, shipping, limits, formats, languages and document types",
        "description": "Cached for an hour. Everything needed to explain the price to a customer.",
        "responses": {
          "200": {
            "description": "Pricing and rules.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pricing"
                }
              }
            }
          },
          "404": {
            "description": "The API is not enabled.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/estimate": {
      "post": {
        "operationId": "createEstimate",
        "security": [],
        "tags": [
          "quotes"
        ],
        "summary": "Non-binding estimate from a word count you supply",
        "description": "Marked binding: false. It cannot start an order; use /quotes for a binding price.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EstimateRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Estimate.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Estimate"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Too many words, or shipping not available.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/uploads": {
      "post": {
        "operationId": "createUpload",
        "security": [],
        "tags": [
          "quotes"
        ],
        "summary": "Get a signed URL to upload one document",
        "description": "Before the first upload, show your user our privacy policy (see GET /pricing, privacy) and upload the file only with the user's knowledge. Returns a presigned URL for a private store. Send the raw bytes with an HTTP PUT to upload.url, with the headers in upload.headers. The URL is valid for 15 minutes, for exactly this content type and at most size_bytes, without overwrite. Up to 5 files of 10485760 bytes per quote.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UploadRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Upload prepared.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Upload"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request or unsupported content type.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "File too large.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "manual_quote_required: format (HEIC, WEBP) is not priced automatically.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Uploads temporarily unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/quotes": {
      "post": {
        "operationId": "createQuote",
        "security": [],
        "tags": [
          "quotes"
        ],
        "summary": "Binding quote: the server counts the words of the uploaded files",
        "description": "You never send a word count. The files are checked and counted by our server (text layer or OCR); the quote is binding for 2 hours (expires_at). Files that fail our security checks (macros, active content, wrong file type) and files we cannot verify give 422 manual_quote_required.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/QuoteRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Quote.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Quote"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "A file was not uploaded yet.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "410": {
            "description": "An upload_id has expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "File too large.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "manual_quote_required, or shipping_unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Quote temporarily unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/quotes/{quote_id}": {
      "get": {
        "operationId": "getQuote",
        "security": [],
        "tags": [
          "quotes"
        ],
        "summary": "Read a quote back (stage, pages, words, price)",
        "parameters": [
          {
            "name": "quote_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Quote.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Quote"
                }
              }
            }
          },
          "404": {
            "description": "Unknown quote.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "410": {
            "description": "Quote expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/orders": {
      "post": {
        "operationId": "createOrder",
        "security": [],
        "tags": [
          "orders"
        ],
        "summary": "Prepare an order and get the checkout link for the customer",
        "description": "Creates the order in status awaiting_customer_confirmation. No payment is created and no consent is recorded: the customer does that on checkout_url. A repeated request with the same Idempotency-Key and body returns the same order (header Idempotency-Replayed: true); the same key with a different body gives 422. Limit per IP address: at least 15 minutes between two newly created orders and at most 4 per hour; otherwise 429 with code order_rate_limited, a Retry-After header and checkout_guidance (a repeat of an Idempotency-Key never counts). Several documents of one customer belong in ONE order.",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9_.:-]{8,128}$"
            },
            "description": "A unique key per order attempt, 8 to 128 characters."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OrderRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Same order as before (idempotent repeat).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Order"
                }
              }
            }
          },
          "201": {
            "description": "Order prepared.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrderCreated"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request, customer data or Idempotency-Key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "price_changed: the total differs from expected_total_eur.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "410": {
            "description": "Quote expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Idempotency key reused, VAT number invalid, or shipping not available.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "order_rate_limited (min 15 minutes between new orders, max 4 per hour per IP; see Retry-After and retry_after_seconds) or rate_limited.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Temporarily unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/orders/{order_id}": {
      "get": {
        "operationId": "getOrder",
        "tags": [
          "orders"
        ],
        "summary": "Order status (no personal data)",
        "security": [
          {
            "orderAccessToken": []
          }
        ],
        "parameters": [
          {
            "name": "order_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^ao_[A-Za-z0-9_-]{24}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Order status.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Order"
                }
              }
            }
          },
          "404": {
            "description": "Unknown order or wrong access token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "orderAccessToken": {
        "type": "http",
        "scheme": "bearer",
        "description": "access_token from the createOrder response. Never put it in a URL."
      }
    },
    "schemas": {
      "Error": {
        "type": "object",
        "required": [
          "error",
          "request_id"
        ],
        "properties": {
          "error": {
            "type": "object",
            "required": [
              "code",
              "message"
            ],
            "properties": {
              "code": {
                "type": "string"
              },
              "message": {
                "type": "string"
              },
              "field": {
                "type": "string"
              },
              "reason": {
                "type": "string"
              }
            },
            "additionalProperties": true
          },
          "request_id": {
            "type": "string"
          }
        }
      },
      "Direction": {
        "type": "string",
        "enum": [
          "pl-nl",
          "nl-pl"
        ],
        "description": "pl-nl: Polish to Dutch. nl-pl: Dutch to Polish."
      },
      "ClientType": {
        "type": "string",
        "enum": [
          "private",
          "company"
        ]
      },
      "Delivery": {
        "type": "string",
        "enum": [
          "digital",
          "post"
        ],
        "description": "digital: signed PDF. post: paper original by registered post (shipping fee per country)."
      },
      "PaymentMethod": {
        "type": "string",
        "enum": [
          "ideal",
          "bancontact",
          "blik"
        ]
      },
      "DocumentType": {
        "type": "string",
        "enum": [
          "geboorteakte",
          "huwelijksakte",
          "diploma",
          "arbeidscontract",
          "notariele-akte",
          "verklaring-omtrent-gedrag",
          "echtscheidingsakte",
          "overlijdensakte",
          "erkenningsakte",
          "verklaring-burgerlijke-staat",
          "ouderschapsplan",
          "alimentatie-overeenkomst",
          "geregistreerd-partnerschap",
          "uittreksel-brp",
          "loonstrook",
          "jaaropgave",
          "werkgeversverklaring",
          "poortwachter-dossier",
          "plan-van-aanpak",
          "uwv-beslissing",
          "ontslagbrief",
          "vaststellingsovereenkomst",
          "cao-document",
          "arbeidsverklaring",
          "rapport-bedrijfsarts",
          "verzuimverklaring",
          "arbeidsongeschiktheidsverklaring",
          "medisch-dossier-uwv",
          "medische-verklaring",
          "medische-onderzoeksresultaten",
          "wajong-beschikking",
          "zorgverzekering-document",
          "volmacht",
          "akte-van-levering",
          "hypotheekakte",
          "huurovereenkomst",
          "testament",
          "huwelijkse-voorwaarden",
          "kvk-uittreksel",
          "aandeelhoudersovereenkomst",
          "zakelijke-facturen",
          "bankdocumenten",
          "schooldiploma",
          "inburgering-certificaat",
          "diplomawaardering",
          "beroepskwalificatie",
          "rijbewijs",
          "kentekenbewijs",
          "koopovereenkomst-auto",
          "groene-kaart",
          "rdw-uitvoerverklaring",
          "boete-beschikking",
          "gemeentebeschikking",
          "dagvaarding",
          "vonnis",
          "verhoorverslag",
          "juridisch-verzoekschrift",
          "advocaat-documenten",
          "identity_document",
          "medical_document",
          "criminal_record",
          "other_document"
        ],
        "description": "All types are priced automatically, including other_document for a document that is on no list."
      },
      "Price": {
        "type": "object",
        "required": [
          "currency",
          "translation_eur",
          "shipping_eur",
          "total_eur",
          "vat_mode"
        ],
        "properties": {
          "currency": {
            "const": "EUR"
          },
          "translation_eur": {
            "type": "number",
            "minimum": 0,
            "description": "Amount in EUR."
          },
          "shipping_eur": {
            "oneOf": [
              {
                "type": "number",
                "minimum": 0,
                "description": "Amount in EUR."
              },
              {
                "type": "null"
              }
            ]
          },
          "total_eur": {
            "type": "number",
            "minimum": 0,
            "description": "Amount in EUR."
          },
          "vat_mode": {
            "type": "string",
            "enum": [
              "vat_included",
              "net_reverse_charge"
            ]
          },
          "rounding_step_eur": {
            "type": "number"
          },
          "minimum_price_applied": {
            "type": "boolean"
          }
        }
      },
      "Pricing": {
        "type": "object",
        "description": "Live prices and rules.",
        "properties": {
          "currency": {
            "const": "EUR"
          },
          "pricing": {
            "type": "object",
            "properties": {
              "base_eur": {
                "type": "number",
                "minimum": 0,
                "description": "Amount in EUR."
              },
              "per_word_eur": {
                "type": "number",
                "minimum": 0,
                "description": "Amount in EUR."
              },
              "minimum_translation_eur": {
                "type": "number",
                "minimum": 0,
                "description": "Amount in EUR."
              },
              "formula": {
                "type": "string"
              },
              "rounding": {
                "type": "object"
              },
              "vat": {
                "type": "object"
              },
              "shipping_eur_by_country": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "country": {
                      "type": "string"
                    },
                    "name_nl": {
                      "type": "string"
                    },
                    "name_pl": {
                      "type": "string"
                    },
                    "price_eur": {
                      "type": "number",
                      "minimum": 0,
                      "description": "Amount in EUR."
                    }
                  }
                }
              }
            }
          },
          "limits": {
            "type": "object",
            "properties": {
              "max_files": {
                "const": 5
              },
              "max_file_bytes": {
                "const": 10485760
              },
              "max_words_automatic": {
                "const": 25000
              }
            },
            "additionalProperties": true
          },
          "file_formats": {
            "type": "object"
          },
          "directions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Direction"
            }
          },
          "languages": {
            "type": "object"
          },
          "document_types": {
            "type": "object"
          },
          "payment_methods": {
            "type": "array",
            "items": {
              "type": "object"
            }
          },
          "word_counting": {
            "type": "object"
          },
          "human_steps": {
            "type": "string"
          },
          "terms": {
            "type": "object"
          },
          "manual_quote": {
            "type": "object"
          },
          "openapi": {
            "type": "string",
            "format": "uri"
          }
        },
        "additionalProperties": true
      },
      "EstimateRequest": {
        "type": "object",
        "required": [
          "words",
          "client_type"
        ],
        "additionalProperties": false,
        "properties": {
          "words": {
            "type": "integer",
            "minimum": 1,
            "maximum": 25000
          },
          "client_type": {
            "$ref": "#/components/schemas/ClientType"
          },
          "direction": {
            "$ref": "#/components/schemas/Direction"
          },
          "delivery": {
            "$ref": "#/components/schemas/Delivery"
          },
          "shipping_country": {
            "type": "string",
            "pattern": "^[A-Z]{2}$"
          },
          "vat_number": {
            "type": "string",
            "maxLength": 20
          }
        }
      },
      "Estimate": {
        "type": "object",
        "required": [
          "binding",
          "words",
          "price"
        ],
        "properties": {
          "binding": {
            "const": false
          },
          "basis": {
            "type": "string"
          },
          "notice": {
            "type": "string"
          },
          "words": {
            "type": "integer"
          },
          "price": {
            "$ref": "#/components/schemas/Price"
          }
        }
      },
      "UploadRequest": {
        "type": "object",
        "required": [
          "content_type",
          "size_bytes"
        ],
        "additionalProperties": false,
        "properties": {
          "content_type": {
            "type": "string",
            "enum": [
              "application/pdf",
              "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
              "application/vnd.oasis.opendocument.text",
              "application/msword",
              "image/jpeg",
              "image/png"
            ]
          },
          "size_bytes": {
            "type": "integer",
            "minimum": 1,
            "maximum": 10485760
          },
          "filename": {
            "type": "string",
            "description": "Ignored; the stored name is chosen by the server."
          }
        }
      },
      "Upload": {
        "type": "object",
        "required": [
          "upload_id",
          "upload"
        ],
        "properties": {
          "upload_id": {
            "type": "string"
          },
          "upload": {
            "type": "object",
            "required": [
              "method",
              "url",
              "headers",
              "expires_at"
            ],
            "properties": {
              "method": {
                "const": "PUT"
              },
              "url": {
                "type": "string",
                "format": "uri"
              },
              "headers": {
                "type": "object",
                "additionalProperties": {
                  "type": "string"
                }
              },
              "expires_at": {
                "type": "string",
                "format": "date-time"
              },
              "max_bytes": {
                "type": "integer"
              }
            }
          },
          "next": {
            "type": "string"
          }
        }
      },
      "QuoteRequest": {
        "type": "object",
        "required": [
          "upload_ids",
          "direction",
          "client_type",
          "document_type"
        ],
        "additionalProperties": false,
        "properties": {
          "upload_ids": {
            "type": "array",
            "minItems": 1,
            "maxItems": 5,
            "uniqueItems": true,
            "items": {
              "type": "string"
            }
          },
          "direction": {
            "$ref": "#/components/schemas/Direction"
          },
          "client_type": {
            "$ref": "#/components/schemas/ClientType"
          },
          "document_type": {
            "$ref": "#/components/schemas/DocumentType"
          },
          "delivery": {
            "$ref": "#/components/schemas/Delivery"
          },
          "shipping_country": {
            "type": "string",
            "pattern": "^[A-Z]{2}$",
            "description": "Required when delivery is post."
          },
          "vat_number": {
            "type": "string",
            "maxLength": 20,
            "description": "Companies only; decides net or gross price (a Polish number is gross)."
          }
        }
      },
      "Quote": {
        "type": "object",
        "required": [
          "quote_id",
          "stage",
          "binding",
          "expires_at",
          "words",
          "price"
        ],
        "properties": {
          "quote_id": {
            "type": "string"
          },
          "stage": {
            "const": "priced"
          },
          "binding": {
            "const": true
          },
          "expires_at": {
            "type": "string",
            "format": "date-time",
            "description": "The quote is binding for 2 hours from creation."
          },
          "document_type": {
            "type": "string"
          },
          "direction": {
            "$ref": "#/components/schemas/Direction"
          },
          "client_type": {
            "$ref": "#/components/schemas/ClientType"
          },
          "delivery": {
            "$ref": "#/components/schemas/Delivery"
          },
          "shipping_country": {
            "type": [
              "string",
              "null"
            ]
          },
          "words": {
            "type": "integer"
          },
          "pages": {
            "type": [
              "integer",
              "null"
            ]
          },
          "files": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "index": {
                  "type": "integer"
                },
                "words": {
                  "type": "integer"
                },
                "pages": {
                  "type": [
                    "integer",
                    "null"
                  ]
                },
                "counted_by": {
                  "type": "string",
                  "enum": [
                    "text_layer",
                    "ocr"
                  ]
                }
              }
            }
          },
          "price": {
            "$ref": "#/components/schemas/Price"
          },
          "rules_version": {
            "type": "string"
          },
          "notice": {
            "type": "string"
          }
        }
      },
      "OrderRequest": {
        "type": "object",
        "required": [
          "quote_id",
          "expected_total_eur",
          "language",
          "payment_method",
          "customer",
          "invoice_address"
        ],
        "additionalProperties": false,
        "properties": {
          "quote_id": {
            "type": "string"
          },
          "expected_total_eur": {
            "type": "number",
            "minimum": 0,
            "description": "The total of the quote the customer saw. A different current total gives 409 price_changed."
          },
          "language": {
            "type": "string",
            "enum": [
              "nl",
              "pl"
            ],
            "description": "Language of the customer (checkout page and e-mails)."
          },
          "payment_method": {
            "$ref": "#/components/schemas/PaymentMethod"
          },
          "document_description": {
            "type": "string",
            "maxLength": 500
          },
          "customer": {
            "type": "object",
            "required": [
              "email"
            ],
            "additionalProperties": false,
            "properties": {
              "name": {
                "type": "string",
                "description": "Private customers: first and last name."
              },
              "company_name": {
                "type": "string"
              },
              "vat_number": {
                "type": "string",
                "description": "Companies: EU VAT number, checked in VIES."
              },
              "contact_person": {
                "type": "string"
              },
              "email": {
                "type": "string",
                "format": "email"
              },
              "phone": {
                "type": "string"
              }
            }
          },
          "invoice_address": {
            "type": "object",
            "required": [
              "street",
              "postal_code",
              "city",
              "country"
            ],
            "additionalProperties": false,
            "properties": {
              "street": {
                "type": "string"
              },
              "postal_code": {
                "type": "string"
              },
              "city": {
                "type": "string"
              },
              "country": {
                "type": "string",
                "pattern": "^[A-Z]{2}$"
              }
            }
          },
          "shipping_address": {
            "type": "object",
            "description": "Only when the quote has delivery post and the paper original goes elsewhere than the invoice address.",
            "required": [
              "name",
              "street",
              "postal_code",
              "city"
            ],
            "additionalProperties": false,
            "properties": {
              "name": {
                "type": "string"
              },
              "street": {
                "type": "string"
              },
              "postal_code": {
                "type": "string"
              },
              "city": {
                "type": "string"
              }
            }
          }
        }
      },
      "Order": {
        "type": "object",
        "required": [
          "order_id",
          "status"
        ],
        "properties": {
          "order_id": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "awaiting_customer_confirmation",
              "awaiting_payment",
              "payment_failed",
              "paid",
              "expired",
              "processing"
            ]
          },
          "payment_method": {
            "type": [
              "string",
              "null"
            ]
          },
          "amount_eur": {
            "type": "number",
            "minimum": 0,
            "description": "Amount in EUR."
          },
          "words": {
            "type": [
              "integer",
              "null"
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "expires_at": {
            "type": "string",
            "format": "date-time"
          },
          "paid_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "checkout_url": {
            "type": [
              "string",
              "null"
            ],
            "format": "uri",
            "description": "Present while the order can still be paid."
          }
        }
      },
      "OrderCreated": {
        "allOf": [
          {
            "$ref": "#/components/schemas/Order"
          },
          {
            "type": "object",
            "required": [
              "access_token",
              "checkout_url"
            ],
            "properties": {
              "access_token": {
                "type": "string",
                "description": "Bearer token for GET /orders/{order_id}. Keep it private."
              },
              "checkout_link_valid_until": {
                "type": "string",
                "format": "date-time"
              },
              "next": {
                "type": "string"
              }
            }
          }
        ]
      }
    }
  }
}