{
  "openapi": "3.1.1",
  "info": {
    "title": "UltraEInvoicing Gateway API",
    "description": "Fiscalises sales with the Malawi Revenue Authority's EIS.\n\nTill keys (uei_till_…) sell from one terminal: the Till routes. Management keys (uei_mgmt_…) run one\nbusiness and vendor keys (uei_vend_…) run each of the vendor's businesses, naming one with the\nX-Business-Id header: the Management and Webhooks routes. Send the key in X-Api-Key.\n\nEach key may make a limited number of requests a minute; over it, the answer is 429 with Retry-After.",
    "version": "v1"
  },
  "servers": [
    {
      "url": "https://einvoicing.ultrapos.uk/"
    }
  ],
  "paths": {
    "/v1/webhooks/event-types": {
      "get": {
        "tags": [
          "Webhooks"
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/v1/webhooks": {
      "get": {
        "tags": [
          "Webhooks"
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      },
      "post": {
        "tags": [
          "Webhooks"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/v1/webhooks/{id}": {
      "put": {
        "tags": [
          "Webhooks"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      },
      "delete": {
        "tags": [
          "Webhooks"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/v1/webhooks/{id}/rotate-secret": {
      "post": {
        "tags": [
          "Webhooks"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/v1/webhooks/{id}/test": {
      "post": {
        "tags": [
          "Webhooks"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/v1/webhooks/{id}/deliveries": {
      "get": {
        "tags": [
          "Webhooks"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/v1/webhooks/{id}/deliveries/{deliveryId}/retry": {
      "post": {
        "tags": [
          "Webhooks"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "deliveryId",
            "in": "path",
            "required": true,
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/v1/edge/report": {
      "post": {
        "tags": [
          "Edge link"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EdgeReport"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/v1/malawi/invoices": {
      "post": {
        "tags": [
          "Till"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/InvoiceRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/v1/malawi/invoices/{invoiceNo}": {
      "get": {
        "tags": [
          "Till"
        ],
        "parameters": [
          {
            "name": "invoiceNo",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/v1/malawi/products": {
      "get": {
        "tags": [
          "Till"
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/v1/malawi/status": {
      "get": {
        "tags": [
          "Till"
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/v1/malawi/invoices/{invoiceNo}/adjustment": {
      "post": {
        "tags": [
          "Till"
        ],
        "parameters": [
          {
            "name": "invoiceNo",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AdjustmentRequestDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/v1/malawi/invoices/{invoiceNo}/cancel": {
      "post": {
        "tags": [
          "Till"
        ],
        "parameters": [
          {
            "name": "invoiceNo",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CancelRequestDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/v1/malawi/buyers/{tin}": {
      "get": {
        "tags": [
          "Till"
        ],
        "parameters": [
          {
            "name": "tin",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/v1/malawi/mra/ping": {
      "get": {
        "tags": [
          "Till"
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/v1/malawi/mra/invoices/{number}": {
      "get": {
        "tags": [
          "Till"
        ],
        "parameters": [
          {
            "name": "number",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/v1/malawi/mra/last-transactions": {
      "get": {
        "tags": [
          "Till"
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/v1/malawi/cancellations": {
      "get": {
        "tags": [
          "Till"
        ],
        "parameters": [
          {
            "name": "status",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "from",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "to",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "invoice",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "page",
            "in": "query",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32"
            }
          },
          {
            "name": "page_size",
            "in": "query",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/v1/malawi/invoices/{invoiceNo}/cancel/refresh": {
      "post": {
        "tags": [
          "Till"
        ],
        "parameters": [
          {
            "name": "invoiceNo",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/v1/malawi/buyers/authorization-code": {
      "post": {
        "tags": [
          "Till"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AuthorizationCodeRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/v1/malawi/status/block-check": {
      "post": {
        "tags": [
          "Till"
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/v1/malawi/vat5": {
      "post": {
        "tags": [
          "Till"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Vat5Request"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/v1/malawi/stock/warehouse": {
      "get": {
        "tags": [
          "Till"
        ],
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32"
            }
          },
          {
            "name": "page_size",
            "in": "query",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/v1/malawi/stock/hs-codes": {
      "get": {
        "tags": [
          "Till"
        ],
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "rate",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/v1/malawi/stock/units": {
      "get": {
        "tags": [
          "Till"
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/v1/malawi/stock/products": {
      "post": {
        "tags": [
          "Till"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AddProductRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/v1/malawi/stock/products/{productId}/status": {
      "get": {
        "tags": [
          "Till"
        ],
        "parameters": [
          {
            "name": "productId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/v1/malawi/stock/suppliers": {
      "get": {
        "tags": [
          "Till"
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/v1/malawi/stock/purchases": {
      "post": {
        "tags": [
          "Till"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PurchaseRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/v1/malawi/stock/adjustment-reasons": {
      "get": {
        "tags": [
          "Till"
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/v1/malawi/stock/adjustments": {
      "post": {
        "tags": [
          "Till"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/StockAdjustRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/v1/malawi/stock/transfers": {
      "post": {
        "tags": [
          "Till"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TransferRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/v1/malawi/stock/raw-materials": {
      "get": {
        "tags": [
          "Till"
        ],
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32"
            }
          },
          {
            "name": "page_size",
            "in": "query",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/v1/malawi/stock/conversions": {
      "post": {
        "tags": [
          "Till"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ConversionRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/v1/malawi/stock/initial-inventory": {
      "post": {
        "tags": [
          "Till"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/InitialInventoryRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/v1/malawi/terminals": {
      "get": {
        "tags": [
          "Management"
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      },
      "post": {
        "tags": [
          "Management"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ActivateRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/v1/malawi/terminals/{id}/reactivate": {
      "post": {
        "tags": [
          "Management"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ActivateRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/v1/malawi/terminals/{id}/sync": {
      "post": {
        "tags": [
          "Management"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/v1/malawi/terminals/{id}/ping": {
      "post": {
        "tags": [
          "Management"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/v1/malawi/terminals/{id}/rotate-key": {
      "post": {
        "tags": [
          "Management"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/v1/malawi/terminals/{id}/products": {
      "get": {
        "tags": [
          "Management"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/v1/malawi/terminals/{id}/sales": {
      "get": {
        "tags": [
          "Management"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/v1/malawi/terminals/{id}/test-invoice": {
      "post": {
        "tags": [
          "Management"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/InvoiceRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/v1/malawi/terminals/{id}/raw": {
      "post": {
        "tags": [
          "Management"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RawRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/v1/malawi/terminals/{id}/numbering": {
      "post": {
        "tags": [
          "Management"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/NumberingRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/v1/malawi/terminals/{id}/buyers/{tin}": {
      "get": {
        "tags": [
          "Management"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "tin",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/v1/malawi/terminals/{id}/vat5": {
      "post": {
        "tags": [
          "Management"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Vat5Request"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/v1/malawi/terminals/{id}/sales/{invoiceNo}": {
      "get": {
        "tags": [
          "Management"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "invoiceNo",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/v1/malawi/terminals/{id}/sales/{invoiceNo}/adjustment": {
      "post": {
        "tags": [
          "Management"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "invoiceNo",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AdjustmentRequestDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/v1/malawi/terminals/{id}/sales/{invoiceNo}/cancel": {
      "post": {
        "tags": [
          "Management"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "invoiceNo",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CancelRequestDto"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/v1/malawi/terminals/{id}/disable": {
      "post": {
        "tags": [
          "Management"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/v1/malawi/terminals/{id}/enable": {
      "post": {
        "tags": [
          "Management"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/v1/malawi/terminals/{id}/renew-credentials": {
      "post": {
        "tags": [
          "Management"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/v1/malawi/terminals/{id}/hs-codes": {
      "get": {
        "tags": [
          "Management"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "q",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "rate",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/v1/malawi/terminals/{id}/units": {
      "get": {
        "tags": [
          "Management"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/v1/malawi/terminals/{id}/mra-products": {
      "post": {
        "tags": [
          "Management"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AddProductRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/v1/malawi/terminals/{id}/warehouse": {
      "get": {
        "tags": [
          "Management"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/v1/malawi/terminals/{id}/move-stock": {
      "post": {
        "tags": [
          "Management"
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MoveStockRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/v1/malawi/terminals/{id}/stock/warehouse": {
      "get": {
        "tags": [
          "Management"
        ],
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32"
            }
          },
          {
            "name": "page_size",
            "in": "query",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/v1/malawi/terminals/{id}/stock/hs-codes": {
      "get": {
        "tags": [
          "Management"
        ],
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "rate",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/v1/malawi/terminals/{id}/stock/units": {
      "get": {
        "tags": [
          "Management"
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/v1/malawi/terminals/{id}/stock/products": {
      "post": {
        "tags": [
          "Management"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AddProductRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/v1/malawi/terminals/{id}/stock/products/{productId}/status": {
      "get": {
        "tags": [
          "Management"
        ],
        "parameters": [
          {
            "name": "productId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/v1/malawi/terminals/{id}/stock/suppliers": {
      "get": {
        "tags": [
          "Management"
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/v1/malawi/terminals/{id}/stock/purchases": {
      "post": {
        "tags": [
          "Management"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PurchaseRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/v1/malawi/terminals/{id}/stock/adjustment-reasons": {
      "get": {
        "tags": [
          "Management"
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/v1/malawi/terminals/{id}/stock/adjustments": {
      "post": {
        "tags": [
          "Management"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/StockAdjustRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/v1/malawi/terminals/{id}/stock/transfers": {
      "post": {
        "tags": [
          "Management"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TransferRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/v1/malawi/terminals/{id}/stock/raw-materials": {
      "get": {
        "tags": [
          "Management"
        ],
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32"
            }
          },
          {
            "name": "page_size",
            "in": "query",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/v1/malawi/terminals/{id}/stock/conversions": {
      "post": {
        "tags": [
          "Management"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ConversionRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/v1/malawi/terminals/{id}/stock/initial-inventory": {
      "post": {
        "tags": [
          "Management"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/InitialInventoryRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/v1/malawi/terminals/{id}/mra/ping": {
      "get": {
        "tags": [
          "Management"
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/v1/malawi/terminals/{id}/mra/invoices/{number}": {
      "get": {
        "tags": [
          "Management"
        ],
        "parameters": [
          {
            "name": "number",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/v1/malawi/terminals/{id}/mra/last-transactions": {
      "get": {
        "tags": [
          "Management"
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/v1/malawi/terminals/{id}/cancellations": {
      "get": {
        "tags": [
          "Management"
        ],
        "parameters": [
          {
            "name": "status",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "from",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "to",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "invoice",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "page",
            "in": "query",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32"
            }
          },
          {
            "name": "page_size",
            "in": "query",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/v1/malawi/terminals/{id}/invoices/{invoiceNo}/cancel/refresh": {
      "post": {
        "tags": [
          "Management"
        ],
        "parameters": [
          {
            "name": "invoiceNo",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/v1/malawi/terminals/{id}/buyers/authorization-code": {
      "post": {
        "tags": [
          "Management"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AuthorizationCodeRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/v1/malawi/terminals/{id}/status/block-check": {
      "post": {
        "tags": [
          "Management"
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "ActivateRequest": {
        "required": [
          "name",
          "activation_code",
          "taxpayer_id",
          "terminal_position",
          "site_id",
          "mac_address"
        ],
        "type": "object",
        "properties": {
          "name": {
            "type": [
              "null",
              "string"
            ]
          },
          "activation_code": {
            "type": [
              "null",
              "string"
            ]
          },
          "taxpayer_id": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int64"
          },
          "terminal_position": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "site_id": {
            "type": [
              "null",
              "string"
            ]
          },
          "mac_address": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "AddProductRequest": {
        "required": [
          "barcode",
          "hs_code",
          "name",
          "description",
          "uom"
        ],
        "type": "object",
        "properties": {
          "barcode": {
            "type": [
              "null",
              "string"
            ]
          },
          "hs_code": {
            "type": [
              "null",
              "string"
            ]
          },
          "name": {
            "type": [
              "null",
              "string"
            ]
          },
          "description": {
            "type": [
              "null",
              "string"
            ]
          },
          "uom": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "AdjustmentRequestDto": {
        "required": [
          "reason",
          "lines",
          "payments"
        ],
        "type": "object",
        "properties": {
          "reason": {
            "type": [
              "null",
              "string"
            ]
          },
          "lines": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/LineRequest"
            }
          },
          "payments": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/PaymentRequest"
            }
          }
        }
      },
      "AuthorizationCodeRequest": {
        "required": [
          "code"
        ],
        "type": "object",
        "properties": {
          "code": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "CancelRequestDto": {
        "required": [
          "reason"
        ],
        "type": "object",
        "properties": {
          "reason": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "ConversionRequest": {
        "required": [
          "batch_id",
          "raw_materials",
          "finished_products"
        ],
        "type": "object",
        "properties": {
          "batch_id": {
            "type": [
              "null",
              "string"
            ]
          },
          "raw_materials": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/RawUseLine"
            }
          },
          "finished_products": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/FinishedLine"
            }
          }
        }
      },
      "EdgeReport": {
        "required": [
          "protocol",
          "machine",
          "version",
          "terminals",
          "sales"
        ],
        "type": "object",
        "properties": {
          "protocol": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "machine": {
            "type": [
              "null",
              "string"
            ]
          },
          "version": {
            "type": [
              "null",
              "string"
            ]
          },
          "terminals": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/EdgeTerminalReport"
            }
          },
          "sales": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/EdgeSaleReport"
            }
          }
        }
      },
      "EdgeSaleReport": {
        "required": [
          "terminal_edge_id",
          "invoice_no",
          "mra_invoice_number",
          "day",
          "sequence",
          "status",
          "invoice_total",
          "result_json",
          "last_error",
          "attempts",
          "created_utc",
          "settled_utc",
          "adjustment_number",
          "adjustment_type",
          "adjustment_reason",
          "adjusted_total",
          "adjustment_url",
          "adjusted_utc",
          "void_status",
          "void_reason",
          "void_requested_utc",
          "void_checked_utc",
          "void_rejected_reason",
          "version"
        ],
        "type": "object",
        "properties": {
          "terminal_edge_id": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "invoice_no": {
            "type": "string"
          },
          "mra_invoice_number": {
            "type": "string"
          },
          "day": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "sequence": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int64"
          },
          "status": {
            "$ref": "#/components/schemas/SaleStatus"
          },
          "invoice_total": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "number",
              "string"
            ],
            "format": "double"
          },
          "result_json": {
            "type": [
              "null",
              "string"
            ]
          },
          "last_error": {
            "type": [
              "null",
              "string"
            ]
          },
          "attempts": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "created_utc": {
            "type": "string",
            "format": "date-time"
          },
          "settled_utc": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "adjustment_number": {
            "type": [
              "null",
              "string"
            ]
          },
          "adjustment_type": {
            "type": [
              "null",
              "string"
            ]
          },
          "adjustment_reason": {
            "type": [
              "null",
              "string"
            ]
          },
          "adjusted_total": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "adjustment_url": {
            "type": [
              "null",
              "string"
            ]
          },
          "adjusted_utc": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "void_status": {
            "type": [
              "null",
              "string"
            ]
          },
          "void_reason": {
            "type": [
              "null",
              "string"
            ]
          },
          "void_requested_utc": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "void_checked_utc": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "void_rejected_reason": {
            "type": [
              "null",
              "string"
            ]
          },
          "version": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int64"
          }
        }
      },
      "EdgeTerminalReport": {
        "required": [
          "edge_id",
          "name",
          "disabled",
          "block_reason",
          "description"
        ],
        "type": "object",
        "properties": {
          "edge_id": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "name": {
            "type": "string"
          },
          "disabled": {
            "type": "boolean"
          },
          "block_reason": {
            "type": [
              "null",
              "string"
            ]
          },
          "description": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/JsonElement"
              }
            ]
          }
        }
      },
      "FinishedLine": {
        "required": [
          "barcode",
          "product_description",
          "quantity",
          "unit_of_measure",
          "expiry_date"
        ],
        "type": "object",
        "properties": {
          "barcode": {
            "type": [
              "null",
              "string"
            ]
          },
          "product_description": {
            "type": [
              "null",
              "string"
            ]
          },
          "quantity": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "unit_of_measure": {
            "type": [
              "null",
              "string"
            ]
          },
          "expiry_date": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          }
        }
      },
      "InitialInventoryRequest": {
        "required": [
          "confirm",
          "products"
        ],
        "type": "object",
        "properties": {
          "confirm": {
            "type": [
              "null",
              "boolean"
            ]
          },
          "products": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/InventoryLine"
            }
          }
        }
      },
      "InventoryLine": {
        "required": [
          "barcode",
          "product_name",
          "product_description",
          "quantity_in_stock",
          "unit_price",
          "cost_price",
          "selling_price",
          "reorder_level",
          "over_quantity_stock_level"
        ],
        "type": "object",
        "properties": {
          "barcode": {
            "type": [
              "null",
              "string"
            ]
          },
          "product_name": {
            "type": [
              "null",
              "string"
            ]
          },
          "product_description": {
            "type": [
              "null",
              "string"
            ]
          },
          "quantity_in_stock": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "unit_price": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "cost_price": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "selling_price": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "reorder_level": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "over_quantity_stock_level": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          }
        }
      },
      "InvoiceRequest": {
        "required": [
          "invoice_no",
          "currency",
          "receipt_type",
          "issued_at",
          "buyer_tin",
          "buyer_name",
          "buyer_authorization_code",
          "vat5",
          "lines",
          "payments"
        ],
        "type": "object",
        "properties": {
          "invoice_no": {
            "type": [
              "null",
              "string"
            ]
          },
          "currency": {
            "type": [
              "null",
              "string"
            ]
          },
          "receipt_type": {
            "type": [
              "null",
              "string"
            ]
          },
          "issued_at": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "buyer_tin": {
            "type": [
              "null",
              "string"
            ]
          },
          "buyer_name": {
            "type": [
              "null",
              "string"
            ]
          },
          "buyer_authorization_code": {
            "type": [
              "null",
              "string"
            ]
          },
          "vat5": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/Vat5Request"
              }
            ]
          },
          "lines": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/LineRequest"
            }
          },
          "payments": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/PaymentRequest"
            }
          },
          "is_export": {
            "type": [
              "null",
              "boolean"
            ]
          }
        }
      },
      "JsonElement": { },
      "LineRequest": {
        "required": [
          "name",
          "qty",
          "price",
          "total",
          "tax_percent",
          "hs_code",
          "product_code",
          "discount"
        ],
        "type": "object",
        "properties": {
          "name": {
            "type": [
              "null",
              "string"
            ]
          },
          "qty": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "price": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "total": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "tax_percent": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "hs_code": {
            "type": [
              "null",
              "string"
            ]
          },
          "product_code": {
            "type": [
              "null",
              "string"
            ]
          },
          "discount": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          }
        }
      },
      "MoveStockRequest": {
        "required": [
          "barcode",
          "quantity",
          "price"
        ],
        "type": "object",
        "properties": {
          "barcode": {
            "type": [
              "null",
              "string"
            ]
          },
          "quantity": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "price": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          }
        }
      },
      "NumberingRequest": {
        "required": [
          "taxpayer_id",
          "terminal_position"
        ],
        "type": "object",
        "properties": {
          "taxpayer_id": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int64"
          },
          "terminal_position": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          }
        }
      },
      "PaymentRequest": {
        "required": [
          "amount",
          "type"
        ],
        "type": "object",
        "properties": {
          "amount": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "type": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "PurchaseLine": {
        "required": [
          "item_code",
          "description",
          "quantity_ordered",
          "quantity_received",
          "unit_of_measure",
          "unit_price",
          "is_finished_product"
        ],
        "type": "object",
        "properties": {
          "item_code": {
            "type": [
              "null",
              "string"
            ]
          },
          "description": {
            "type": [
              "null",
              "string"
            ]
          },
          "quantity_ordered": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "quantity_received": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "unit_of_measure": {
            "type": [
              "null",
              "string"
            ]
          },
          "unit_price": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "is_finished_product": {
            "type": [
              "null",
              "boolean"
            ]
          }
        }
      },
      "PurchaseRequest": {
        "required": [
          "supplier_id",
          "received_by",
          "delivery_note_number",
          "purchase_order_number",
          "notes",
          "items"
        ],
        "type": "object",
        "properties": {
          "supplier_id": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "received_by": {
            "type": [
              "null",
              "string"
            ]
          },
          "delivery_note_number": {
            "type": [
              "null",
              "string"
            ]
          },
          "purchase_order_number": {
            "type": [
              "null",
              "string"
            ]
          },
          "notes": {
            "type": [
              "null",
              "string"
            ]
          },
          "items": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/PurchaseLine"
            }
          }
        }
      },
      "RawRequest": {
        "required": [
          "path",
          "body"
        ],
        "type": "object",
        "properties": {
          "path": {
            "type": [
              "null",
              "string"
            ]
          },
          "body": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/JsonElement"
              }
            ]
          }
        }
      },
      "RawUseLine": {
        "required": [
          "product_id",
          "product_name",
          "available_quantity",
          "used_quantity"
        ],
        "type": "object",
        "properties": {
          "product_id": {
            "type": [
              "null",
              "string"
            ]
          },
          "product_name": {
            "type": [
              "null",
              "string"
            ]
          },
          "available_quantity": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "used_quantity": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          }
        }
      },
      "SaleStatus": {
        "enum": [
          "submitting",
          "cleared",
          "pending_offline",
          "rejected",
          "offline_rejected"
        ]
      },
      "StockAdjustRequest": {
        "required": [
          "barcode",
          "quantity",
          "type",
          "reason",
          "at_site",
          "remarks"
        ],
        "type": "object",
        "properties": {
          "barcode": {
            "type": [
              "null",
              "string"
            ]
          },
          "quantity": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "type": {
            "type": [
              "null",
              "string"
            ]
          },
          "reason": {
            "type": [
              "null",
              "string"
            ]
          },
          "at_site": {
            "type": [
              "null",
              "boolean"
            ]
          },
          "remarks": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "TransferLine": {
        "required": [
          "barcode",
          "quantity",
          "price"
        ],
        "type": "object",
        "properties": {
          "barcode": {
            "type": [
              "null",
              "string"
            ]
          },
          "quantity": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "price": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          }
        }
      },
      "TransferRequest": {
        "required": [
          "kind",
          "to_site_id",
          "items"
        ],
        "type": "object",
        "properties": {
          "kind": {
            "type": [
              "null",
              "string"
            ]
          },
          "to_site_id": {
            "type": [
              "null",
              "string"
            ]
          },
          "items": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/TransferLine"
            }
          }
        }
      },
      "Vat5Request": {
        "required": [
          "project_number",
          "certificate_number",
          "quantity"
        ],
        "type": "object",
        "properties": {
          "project_number": {
            "type": [
              "null",
              "string"
            ]
          },
          "certificate_number": {
            "type": [
              "null",
              "string"
            ]
          },
          "quantity": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          }
        }
      },
      "WebhookRequest": {
        "required": [
          "url",
          "events",
          "description",
          "disabled"
        ],
        "type": "object",
        "properties": {
          "url": {
            "type": [
              "null",
              "string"
            ]
          },
          "events": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "type": "string"
            }
          },
          "description": {
            "type": [
              "null",
              "string"
            ]
          },
          "disabled": {
            "type": [
              "null",
              "boolean"
            ]
          }
        }
      }
    },
    "securitySchemes": {
      "ApiKey": {
        "type": "apiKey",
        "description": "A till, management or vendor key.",
        "name": "X-Api-Key",
        "in": "header"
      }
    }
  },
  "security": [
    {
      "ApiKey": [ ]
    }
  ],
  "tags": [
    {
      "name": "Webhooks"
    },
    {
      "name": "Edge link"
    },
    {
      "name": "Till"
    },
    {
      "name": "Management"
    }
  ]
}