{
  "openapi": "3.0.3",
  "info": {
    "title": "LedgerSMB API",
    "version": "0.0.1",
    "contact": {
      "name": "LedgerSMB API Support",
      "url": "https://github.com/ledgersmb/LedgerSMB/issues",
      "email": "devel@lists.ledgersmb.org"
    },
    "description": "LedgerSMB comes with a web service API. The version number assigned follows\nthe [rules of semantic versioning](https://semver.org/). The current major\nversion is 0 (zero), meaning that it's not considered to have stabilized\nyet. The main reason is that not all functions have been ironed out yet:\nfiltering, sorting and pagination are to be specified and implemented.\n\nThe API is hosted on `erp/api/v0`, on the same root as `login.pl`. That is\nto say that if LedgerSMB's login screen is hosted at\n`https://example.org/login.pl` then the API can be found at\n`https://example.org/erp/api/v0`. All paths mentioned in this document will\nbe appended to that. E.g. the items in the menu for the authenticated user\ncan be accessed through `https://example.org/erp/api/v0/menu-nodes`.\n",
    "license": {
      "name": "GPL-2.0-or-later",
      "url": "https://spdx.org/licenses/GPL-2.0-or-later.html"
    }
  },
  "servers": [
    {
      "url": "http://lsmb/erp/api/v0"
    }
  ],
  "security": [
    {
      "cookieAuth": []
    }
  ],
  "paths": {
    "/contacts/sic": {
      "description": "Collection of Standard Industry Codes (SICs)",
      "get": {
        "tags": [
          "SICs"
        ],
        "summary": "Get a list of SICs",
        "operationId": "getSICs",
        "responses": {
          "200": {
            "description": "Returns the list of SIC codes",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "items"
                  ],
                  "properties": {
                    "_links": {
                      "type": "object"
                    },
                    "items": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/SIC"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/400"
          },
          "401": {
            "$ref": "#/components/responses/401"
          },
          "403": {
            "$ref": "#/components/responses/403"
          },
          "404": {
            "$ref": "#/components/responses/404"
          }
        }
      },
      "post": {
        "tags": [
          "SICs"
        ],
        "summary": "Add SIC entry",
        "operationId": "postSIC",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SIC"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Confirms creation of the new SIC, redirecting to the new resource URI",
            "headers": {
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "Location": {
                "schema": {
                  "type": "string",
                  "format": "uri-reference"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/400"
          },
          "401": {
            "$ref": "#/components/responses/401"
          },
          "403": {
            "$ref": "#/components/responses/403"
          },
          "404": {
            "$ref": "#/components/responses/404"
          }
        }
      }
    },
    "/contacts/sic/{id}": {
      "description": "Management of individual Standard Industry Code items",
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "$ref": "#/components/schemas/sic-code"
          },
          "style": "simple"
        }
      ],
      "get": {
        "tags": [
          "SICs"
        ],
        "summary": "Get a single SIC",
        "operationId": "getSICById",
        "responses": {
          "200": {
            "description": "Returns the data associated with the SIC code",
            "headers": {
              "ETag": {
                "$ref": "#/components/headers/ETag"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SIC"
                }
              }
            }
          },
          "304": {
            "$ref": "#/components/responses/304"
          },
          "400": {
            "$ref": "#/components/responses/400"
          },
          "401": {
            "$ref": "#/components/responses/401"
          },
          "403": {
            "$ref": "#/components/responses/403"
          },
          "404": {
            "$ref": "#/components/responses/404"
          }
        }
      },
      "put": {
        "tags": [
          "SICs"
        ],
        "summary": "Update a single SIC",
        "operationId": "putSICByCode",
        "parameters": [
          {
            "$ref": "#/components/parameters/if-match"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SIC"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Confirms replacement of SIC resource, returning the new data",
            "headers": {
              "ETag": {
                "$ref": "#/components/headers/ETag"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SIC"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/400"
          },
          "401": {
            "$ref": "#/components/responses/401"
          },
          "403": {
            "$ref": "#/components/responses/403"
          },
          "404": {
            "$ref": "#/components/responses/404"
          },
          "412": {
            "$ref": "#/components/responses/412"
          },
          "413": {
            "$ref": "#/components/responses/413"
          },
          "428": {
            "$ref": "#/components/responses/428"
          }
        }
      },
      "delete": {
        "tags": [
          "SICs"
        ],
        "summary": "Delete a single SIC",
        "operationId": "deleteSICByCode",
        "parameters": [
          {
            "$ref": "#/components/parameters/if-match"
          }
        ],
        "responses": {
          "204": {
            "description": "Confirms deletion of the SIC resource"
          },
          "400": {
            "$ref": "#/components/responses/400"
          },
          "401": {
            "$ref": "#/components/responses/401"
          },
          "403": {
            "$ref": "#/components/responses/403"
          },
          "404": {
            "$ref": "#/components/responses/404"
          },
          "412": {
            "$ref": "#/components/responses/412"
          },
          "428": {
            "$ref": "#/components/responses/428"
          }
        }
      },
      "patch": {
        "tags": [
          "SICs"
        ],
        "summary": "Update a single SIC",
        "operationId": "updateSICByCode",
        "parameters": [
          {
            "$ref": "#/components/parameters/if-match"
          }
        ],
        "responses": {
          "200": {
            "description": "Confirms updating the data associated with the SIC code, returning the new SIC data",
            "headers": {
              "ETag": {
                "$ref": "#/components/headers/ETag"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SIC"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/400"
          },
          "401": {
            "$ref": "#/components/responses/401"
          },
          "403": {
            "$ref": "#/components/responses/403"
          },
          "404": {
            "$ref": "#/components/responses/404"
          },
          "412": {
            "$ref": "#/components/responses/412"
          },
          "413": {
            "$ref": "#/components/responses/413"
          },
          "428": {
            "$ref": "#/components/responses/428"
          }
        }
      }
    },
    "/contacts/business-types": {
      "description": "Manage business types",
      "get": {
        "tags": [
          "Business types"
        ],
        "summary": "Get business types",
        "operationId": "getBusinessTypes",
        "responses": {
          "200": {
            "description": "Returns the list of business types",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "items"
                  ],
                  "properties": {
                    "_links": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    },
                    "items": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/BusinessType"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/400"
          },
          "401": {
            "$ref": "#/components/responses/401"
          },
          "403": {
            "$ref": "#/components/responses/403"
          },
          "404": {
            "$ref": "#/components/responses/404"
          }
        }
      },
      "post": {
        "tags": [
          "Business types"
        ],
        "summary": "Create a business type",
        "operationId": "postBusinessType",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/NewBusinessType"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Confirms creation of the new business type, redirecting to the new resource URI",
            "headers": {
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "Location": {
                "schema": {
                  "type": "string",
                  "format": "uri-reference"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/400"
          },
          "401": {
            "$ref": "#/components/responses/401"
          },
          "403": {
            "$ref": "#/components/responses/403"
          },
          "404": {
            "$ref": "#/components/responses/404"
          }
        }
      }
    },
    "/contacts/business-types/{id}": {
      "description": "Manage business type",
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "$ref": "#/components/schemas/business-type-id"
          },
          "style": "simple"
        }
      ],
      "get": {
        "tags": [
          "Business types"
        ],
        "summary": "Get a single business type",
        "operationId": "getBusinessTypesById",
        "responses": {
          "200": {
            "description": "Returns the requested business type data",
            "headers": {
              "ETag": {
                "$ref": "#/components/headers/ETag"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BusinessType"
                }
              }
            }
          },
          "304": {
            "$ref": "#/components/responses/304"
          },
          "400": {
            "$ref": "#/components/responses/400"
          },
          "401": {
            "$ref": "#/components/responses/401"
          },
          "403": {
            "$ref": "#/components/responses/403"
          },
          "404": {
            "$ref": "#/components/responses/404"
          }
        }
      },
      "put": {
        "tags": [
          "Business types"
        ],
        "summary": "Update a single business type",
        "operationId": "putBusinessTypesById",
        "parameters": [
          {
            "$ref": "#/components/parameters/if-match"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BusinessType"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Confirms replacement of the business type data",
            "headers": {
              "ETag": {
                "$ref": "#/components/headers/ETag"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BusinessType"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/400"
          },
          "401": {
            "$ref": "#/components/responses/401"
          },
          "403": {
            "$ref": "#/components/responses/403"
          },
          "404": {
            "$ref": "#/components/responses/404"
          },
          "412": {
            "$ref": "#/components/responses/412"
          },
          "413": {
            "$ref": "#/components/responses/413"
          },
          "428": {
            "$ref": "#/components/responses/428"
          }
        }
      },
      "delete": {
        "tags": [
          "Business types"
        ],
        "summary": "Delete a single business type",
        "operationId": "deleteBusinessTypesById",
        "parameters": [
          {
            "$ref": "#/components/parameters/if-match"
          }
        ],
        "responses": {
          "204": {
            "description": "Confirms deletion of the business type resource"
          },
          "400": {
            "$ref": "#/components/responses/400"
          },
          "401": {
            "$ref": "#/components/responses/401"
          },
          "403": {
            "$ref": "#/components/responses/403"
          },
          "404": {
            "$ref": "#/components/responses/404"
          },
          "412": {
            "$ref": "#/components/responses/412"
          },
          "428": {
            "$ref": "#/components/responses/428"
          }
        }
      },
      "patch": {
        "tags": [
          "Business types"
        ],
        "summary": "Update a single business type",
        "operationId": "updateBusinessTypesById",
        "parameters": [
          {
            "$ref": "#/components/parameters/if-match"
          }
        ],
        "responses": {
          "200": {
            "description": "Confirms updating the business type data, returning the new resource data",
            "headers": {
              "ETag": {
                "$ref": "#/components/headers/ETag"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BusinessType"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/400"
          },
          "401": {
            "$ref": "#/components/responses/401"
          },
          "403": {
            "$ref": "#/components/responses/403"
          },
          "404": {
            "$ref": "#/components/responses/404"
          },
          "412": {
            "$ref": "#/components/responses/412"
          },
          "413": {
            "$ref": "#/components/responses/413"
          },
          "428": {
            "$ref": "#/components/responses/428"
          }
        }
      }
    },
    "/languages": {
      "description": "Management of language configuration",
      "get": {
        "tags": [
          "Languages"
        ],
        "summary": "Get available languages",
        "operationId": "getLanguages",
        "responses": {
          "200": {
            "description": "Returns the full set of configured languages",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "items"
                  ],
                  "properties": {
                    "_links": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    },
                    "items": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Language"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/400"
          },
          "401": {
            "$ref": "#/components/responses/401"
          },
          "403": {
            "$ref": "#/components/responses/403"
          },
          "404": {
            "$ref": "#/components/responses/404"
          }
        }
      },
      "post": {
        "tags": [
          "Languages"
        ],
        "summary": "Create a language",
        "operationId": "postLanguage",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Language"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Confirms successfull creation of the new resource (language),\nreturning the data from the resource and in the Location header\nthe canonical location to access the resource.\n",
            "headers": {
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "Location": {
                "schema": {
                  "type": "string",
                  "format": "uri-reference"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/400"
          },
          "401": {
            "$ref": "#/components/responses/401"
          },
          "403": {
            "$ref": "#/components/responses/403"
          },
          "404": {
            "$ref": "#/components/responses/404"
          }
        }
      }
    },
    "/languages/{id}": {
      "description": "Manage a single language",
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "$ref": "#/components/schemas/language-code"
          },
          "style": "simple"
        }
      ],
      "get": {
        "tags": [
          "Languages"
        ],
        "summary": "Get a single language",
        "operationId": "getLanguageById",
        "responses": {
          "200": {
            "description": "Returns the requested single resource's data",
            "headers": {
              "ETag": {
                "$ref": "#/components/headers/ETag"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Language"
                }
              }
            }
          },
          "304": {
            "$ref": "#/components/responses/304"
          },
          "400": {
            "$ref": "#/components/responses/400"
          },
          "401": {
            "$ref": "#/components/responses/401"
          },
          "403": {
            "$ref": "#/components/responses/403"
          },
          "404": {
            "$ref": "#/components/responses/404"
          }
        }
      },
      "put": {
        "tags": [
          "Languages"
        ],
        "summary": "Update a single language",
        "operationId": "putLanguageById",
        "parameters": [
          {
            "$ref": "#/components/parameters/if-match"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Language"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Confirms successful replacement of the resource's data,\nreturning the new data of the resource.\n",
            "headers": {
              "ETag": {
                "$ref": "#/components/headers/ETag"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Language"
                }
              }
            }
          },
          "304": {
            "$ref": "#/components/responses/304"
          },
          "400": {
            "$ref": "#/components/responses/400"
          },
          "401": {
            "$ref": "#/components/responses/401"
          },
          "403": {
            "$ref": "#/components/responses/403"
          },
          "404": {
            "$ref": "#/components/responses/404"
          },
          "412": {
            "$ref": "#/components/responses/412"
          },
          "413": {
            "$ref": "#/components/responses/413"
          },
          "428": {
            "$ref": "#/components/responses/428"
          }
        }
      },
      "delete": {
        "tags": [
          "Languages"
        ],
        "summary": "Delete a single language",
        "operationId": "deleteLanguageById",
        "parameters": [
          {
            "$ref": "#/components/parameters/if-match"
          }
        ],
        "responses": {
          "204": {
            "description": "Confirms successful deletion of the resource"
          },
          "400": {
            "$ref": "#/components/responses/400"
          },
          "401": {
            "$ref": "#/components/responses/401"
          },
          "403": {
            "$ref": "#/components/responses/403"
          },
          "404": {
            "$ref": "#/components/responses/404"
          }
        }
      },
      "patch": {
        "tags": [
          "Languages"
        ],
        "summary": "Update a single language",
        "operationId": "updateLanguageById",
        "parameters": [
          {
            "$ref": "#/components/parameters/if-match"
          }
        ],
        "responses": {
          "200": {
            "description": "Confirms successful update,\nreturning the new data for the resource\n"
          },
          "400": {
            "$ref": "#/components/responses/400"
          },
          "401": {
            "$ref": "#/components/responses/401"
          },
          "403": {
            "$ref": "#/components/responses/403"
          },
          "404": {
            "$ref": "#/components/responses/404"
          }
        }
      }
    },
    "/countries": {
      "description": "Management of country configuration",
      "get": {
        "tags": [
          "Countries"
        ],
        "summary": "Get available countries",
        "operationId": "getCountries",
        "responses": {
          "200": {
            "description": "Returns a list of configured countries",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "items"
                  ],
                  "properties": {
                    "_links": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    },
                    "items": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Country"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/400"
          },
          "401": {
            "$ref": "#/components/responses/401"
          },
          "403": {
            "$ref": "#/components/responses/403"
          },
          "404": {
            "$ref": "#/components/responses/404"
          }
        }
      },
      "post": {
        "tags": [
          "Countries"
        ],
        "summary": "Create a country",
        "operationId": "postCountry",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Country"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "...",
            "headers": {
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "Location": {
                "schema": {
                  "type": "string",
                  "format": "uri-reference"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/400"
          },
          "401": {
            "$ref": "#/components/responses/401"
          },
          "403": {
            "$ref": "#/components/responses/403"
          },
          "404": {
            "$ref": "#/components/responses/404"
          }
        }
      }
    },
    "/countries/{id}": {
      "description": "Manage a single country",
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "$ref": "#/components/schemas/country-code"
          },
          "style": "simple"
        }
      ],
      "get": {
        "tags": [
          "Countries"
        ],
        "summary": "Get a single country",
        "operationId": "getCountryById",
        "responses": {
          "200": {
            "description": "Returns the data associated with the country",
            "headers": {
              "ETag": {
                "$ref": "#/components/headers/ETag"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Country"
                }
              }
            }
          },
          "304": {
            "$ref": "#/components/responses/304"
          },
          "400": {
            "$ref": "#/components/responses/400"
          },
          "401": {
            "$ref": "#/components/responses/401"
          },
          "403": {
            "$ref": "#/components/responses/403"
          },
          "404": {
            "$ref": "#/components/responses/404"
          }
        }
      },
      "put": {
        "tags": [
          "Countries"
        ],
        "summary": "Update a single country",
        "operationId": "putCountryById",
        "parameters": [
          {
            "$ref": "#/components/parameters/if-match"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Country"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Confirms replacement of country data, returning the new data",
            "headers": {
              "ETag": {
                "$ref": "#/components/headers/ETag"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Country"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/400"
          },
          "401": {
            "$ref": "#/components/responses/401"
          },
          "403": {
            "$ref": "#/components/responses/403"
          },
          "404": {
            "$ref": "#/components/responses/404"
          },
          "412": {
            "$ref": "#/components/responses/412"
          },
          "413": {
            "$ref": "#/components/responses/413"
          },
          "428": {
            "$ref": "#/components/responses/428"
          }
        }
      },
      "delete": {
        "tags": [
          "Countries"
        ],
        "summary": "Delete a single country",
        "operationId": "deleteCountryById",
        "parameters": [
          {
            "$ref": "#/components/parameters/if-match"
          }
        ],
        "responses": {
          "204": {
            "description": "Confirms deletion of the country resource"
          },
          "400": {
            "$ref": "#/components/responses/400"
          },
          "401": {
            "$ref": "#/components/responses/401"
          },
          "403": {
            "$ref": "#/components/responses/403"
          },
          "404": {
            "$ref": "#/components/responses/404"
          },
          "412": {
            "$ref": "#/components/responses/412"
          },
          "428": {
            "$ref": "#/components/responses/428"
          }
        }
      },
      "patch": {
        "tags": [
          "Countries"
        ],
        "summary": "Update a single country",
        "operationId": "updateCountryById",
        "parameters": [
          {
            "$ref": "#/components/parameters/if-match"
          }
        ],
        "responses": {
          "200": {
            "description": "Confirms updating the country resource, returning the new data"
          },
          "400": {
            "$ref": "#/components/responses/400"
          },
          "401": {
            "$ref": "#/components/responses/401"
          },
          "403": {
            "$ref": "#/components/responses/403"
          },
          "404": {
            "$ref": "#/components/responses/404"
          },
          "412": {
            "$ref": "#/components/responses/412"
          },
          "413": {
            "$ref": "#/components/responses/413"
          },
          "428": {
            "$ref": "#/components/responses/428"
          }
        }
      }
    },
    "/gl/gifi": {
      "description": "A list of GIFI",
      "get": {
        "tags": [
          "GIFI"
        ],
        "summary": "Get a list of GIFI",
        "operationId": "getWIFIs",
        "responses": {
          "200": {
            "description": "Returns the full set of GIFI codes",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "items"
                  ],
                  "properties": {
                    "_links": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    },
                    "items": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/GIFI"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/400"
          },
          "401": {
            "$ref": "#/components/responses/401"
          },
          "403": {
            "$ref": "#/components/responses/403"
          },
          "404": {
            "$ref": "#/components/responses/404"
          }
        }
      },
      "post": {
        "tags": [
          "GIFI"
        ],
        "summary": "Create a single GIFI",
        "operationId": "postWIFI",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GIFI"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Returns the full collection of defined GIFI codes",
            "headers": {
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "Location": {
                "schema": {
                  "type": "string",
                  "format": "uri-reference"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/400"
          },
          "401": {
            "$ref": "#/components/responses/401"
          },
          "403": {
            "$ref": "#/components/responses/403"
          },
          "404": {
            "$ref": "#/components/responses/404"
          }
        }
      }
    },
    "/gl/gifi/{id}": {
      "description": "A single GIFI",
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "$ref": "#/components/schemas/accno-code"
          },
          "style": "simple"
        }
      ],
      "get": {
        "tags": [
          "GIFI"
        ],
        "summary": "Get a single GIFI",
        "operationId": "getWIFIById",
        "responses": {
          "200": {
            "description": "...",
            "headers": {
              "ETag": {
                "$ref": "#/components/headers/ETag"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GIFI"
                }
              }
            }
          },
          "304": {
            "$ref": "#/components/responses/304"
          },
          "400": {
            "$ref": "#/components/responses/400"
          },
          "401": {
            "$ref": "#/components/responses/401"
          },
          "403": {
            "$ref": "#/components/responses/403"
          },
          "404": {
            "$ref": "#/components/responses/404"
          }
        }
      },
      "put": {
        "tags": [
          "GIFI"
        ],
        "summary": "Put a single GIFI",
        "operationId": "putWIFIById",
        "parameters": [
          {
            "$ref": "#/components/parameters/if-match"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GIFI"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The resource was succesfully replaced,\nreturning the new data for the resource.\n",
            "headers": {
              "ETag": {
                "$ref": "#/components/headers/ETag"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GIFI"
                }
              }
            }
          },
          "304": {
            "$ref": "#/components/responses/304"
          },
          "400": {
            "$ref": "#/components/responses/400"
          },
          "401": {
            "$ref": "#/components/responses/401"
          },
          "403": {
            "$ref": "#/components/responses/403"
          },
          "404": {
            "$ref": "#/components/responses/404"
          },
          "412": {
            "$ref": "#/components/responses/412"
          },
          "413": {
            "$ref": "#/components/responses/413"
          },
          "428": {
            "$ref": "#/components/responses/428"
          }
        }
      },
      "delete": {
        "tags": [
          "GIFI"
        ],
        "summary": "Delete a single GIFI",
        "operationId": "deleteWIFIById",
        "parameters": [
          {
            "$ref": "#/components/parameters/if-match"
          }
        ],
        "responses": {
          "204": {
            "description": "The resource was succesfully deleted"
          },
          "400": {
            "$ref": "#/components/responses/400"
          },
          "401": {
            "$ref": "#/components/responses/401"
          },
          "403": {
            "$ref": "#/components/responses/403"
          },
          "404": {
            "$ref": "#/components/responses/404"
          }
        }
      },
      "patch": {
        "tags": [
          "GIFI"
        ],
        "summary": "Update a single GIFI",
        "operationId": "updateWIFIById",
        "parameters": [
          {
            "$ref": "#/components/parameters/if-match"
          }
        ],
        "responses": {
          "200": {
            "description": "The resource was succesfully updated,\nreturning the new data for the resource.\n"
          },
          "400": {
            "$ref": "#/components/responses/400"
          },
          "401": {
            "$ref": "#/components/responses/401"
          },
          "403": {
            "$ref": "#/components/responses/403"
          },
          "404": {
            "$ref": "#/components/responses/404"
          }
        }
      }
    },
    "/menu-nodes": {
      "description": "Menu items for the active user",
      "get": {
        "tags": [
          "UserMenu"
        ],
        "summary": "Get the user's menu items",
        "operationId": "getUserMenuNodes",
        "responses": {
          "200": {
            "description": "Returns the full set of menu nodes accessible\nby the requesting user.\n",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "required": [
                      "id",
                      "url",
                      "parent",
                      "label",
                      "menu"
                    ],
                    "properties": {
                      "id": {
                        "type": "number"
                      },
                      "url": {
                        "type": "string"
                      },
                      "parent": {
                        "type": "number"
                      },
                      "label": {
                        "type": "string"
                      },
                      "menu": {
                        "type": "boolean"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/400"
          },
          "401": {
            "$ref": "#/components/responses/401"
          },
          "403": {
            "$ref": "#/components/responses/403"
          },
          "404": {
            "$ref": "#/components/responses/404"
          }
        }
      }
    },
    "/invoices": {
      "description": "Management of Invoices",
      "get": {
        "tags": [
          "Invoices",
          "Experimental"
        ],
        "summary": "Lists invoices",
        "operationId": "getInvoices",
        "responses": {
          "200": {
            "description": "...",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Invoice"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/400"
          },
          "401": {
            "$ref": "#/components/responses/401"
          },
          "403": {
            "$ref": "#/components/responses/403"
          },
          "404": {
            "$ref": "#/components/responses/404"
          },
          "default": {
            "description": "...",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/error"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Invoices",
          "Experimental"
        ],
        "summary": "Add an invoice",
        "operationId": "postInvoices",
        "requestBody": {
          "description": "...",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/newInvoice"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "headers": {
              "ETag": {
                "$ref": "#/components/headers/ETag1"
              },
              "Location": {
                "schema": {
                  "type": "string",
                  "format": "uri-reference"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Invoice"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/400"
          },
          "401": {
            "$ref": "#/components/responses/401"
          },
          "403": {
            "$ref": "#/components/responses/403"
          },
          "404": {
            "$ref": "#/components/responses/404"
          }
        }
      }
    },
    "/invoices/{id}": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string",
            "minLength": 1
          }
        }
      ],
      "get": {
        "tags": [
          "Invoices",
          "Experimental"
        ],
        "summary": "Get a single invoice",
        "operationId": "getInvoicesById",
        "responses": {
          "200": {
            "description": "...",
            "headers": {
              "ETag": {
                "$ref": "#/components/headers/ETag1"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Invoice"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/400"
          },
          "401": {
            "$ref": "#/components/responses/401"
          },
          "403": {
            "$ref": "#/components/responses/403"
          },
          "404": {
            "$ref": "#/components/responses/404"
          }
        }
      },
      "put": {
        "tags": [
          "Invoices",
          "Experimental"
        ],
        "summary": "Update a single invoice",
        "operationId": "putInvoiceById",
        "parameters": [
          {
            "$ref": "#/components/parameters/if-match1"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/newInvoice"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "...",
            "headers": {
              "ETag": {
                "$ref": "#/components/headers/ETag1"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Invoice"
                }
              }
            }
          },
          "304": {
            "description": "..."
          },
          "400": {
            "$ref": "#/components/responses/400"
          },
          "401": {
            "$ref": "#/components/responses/401"
          },
          "403": {
            "$ref": "#/components/responses/403"
          },
          "404": {
            "$ref": "#/components/responses/404"
          },
          "412": {
            "$ref": "#/components/responses/412"
          },
          "413": {
            "$ref": "#/components/responses/413"
          },
          "428": {
            "$ref": "#/components/responses/428"
          }
        }
      }
    },
    "/products/pricegroups": {
      "description": "Managing products and related configuration",
      "get": {
        "tags": [
          "Price groups"
        ],
        "summary": "Get products price groups",
        "operationId": "getProductsPricegroups",
        "responses": {
          "200": {
            "description": "Returns the full list of defined price groups",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "items"
                  ],
                  "properties": {
                    "_links": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    },
                    "items": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Pricegroup"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/400"
          },
          "401": {
            "$ref": "#/components/responses/401"
          },
          "403": {
            "$ref": "#/components/responses/403"
          },
          "404": {
            "$ref": "#/components/responses/404"
          }
        }
      },
      "post": {
        "tags": [
          "Price groups"
        ],
        "summary": "Create products price group",
        "operationId": "postProductsPricegroup",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/NewPricegroup"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Confirms creation of the new resource, returning\nthe new data\n",
            "headers": {
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "Location": {
                "schema": {
                  "type": "string",
                  "format": "uri-reference"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/400"
          },
          "401": {
            "$ref": "#/components/responses/401"
          },
          "403": {
            "$ref": "#/components/responses/403"
          },
          "404": {
            "$ref": "#/components/responses/404"
          }
        }
      }
    },
    "/products/pricegroups/{id}": {
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "$ref": "#/components/schemas/pricegroup-id"
          },
          "style": "simple"
        }
      ],
      "get": {
        "tags": [
          "Price groups"
        ],
        "summary": "Get a single products price group",
        "operationId": "getProductsPricegroupById",
        "responses": {
          "200": {
            "description": "Returns the data for a single resource\n",
            "headers": {
              "ETag": {
                "$ref": "#/components/headers/ETag"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pricegroup"
                }
              }
            }
          },
          "304": {
            "$ref": "#/components/responses/304"
          },
          "400": {
            "$ref": "#/components/responses/400"
          },
          "401": {
            "$ref": "#/components/responses/401"
          },
          "403": {
            "$ref": "#/components/responses/403"
          },
          "404": {
            "$ref": "#/components/responses/404"
          }
        }
      },
      "put": {
        "tags": [
          "Price groups"
        ],
        "summary": "Create single products price group",
        "operationId": "putProductsPricegroupById",
        "parameters": [
          {
            "$ref": "#/components/parameters/if-match"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Pricegroup"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Confirms successful replacement of the\nresource's data, returning the new state\n",
            "headers": {
              "ETag": {
                "$ref": "#/components/headers/ETag"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pricegroup"
                }
              }
            }
          },
          "304": {
            "$ref": "#/components/responses/304"
          },
          "400": {
            "$ref": "#/components/responses/400"
          },
          "401": {
            "$ref": "#/components/responses/401"
          },
          "403": {
            "$ref": "#/components/responses/403"
          },
          "404": {
            "$ref": "#/components/responses/404"
          },
          "412": {
            "$ref": "#/components/responses/412"
          },
          "413": {
            "$ref": "#/components/responses/413"
          },
          "428": {
            "$ref": "#/components/responses/428"
          }
        }
      },
      "delete": {
        "tags": [
          "Price groups"
        ],
        "summary": "Delete a single products price group",
        "operationId": "deleteProductsPricegroupById",
        "parameters": [
          {
            "$ref": "#/components/parameters/if-match"
          }
        ],
        "responses": {
          "204": {
            "description": "Confirms successful deletion of the resource"
          },
          "400": {
            "$ref": "#/components/responses/400"
          },
          "401": {
            "$ref": "#/components/responses/401"
          },
          "403": {
            "$ref": "#/components/responses/403"
          },
          "404": {
            "$ref": "#/components/responses/404"
          }
        }
      },
      "patch": {
        "tags": [
          "Price groups"
        ],
        "summary": "Update a single products price group",
        "operationId": "updateProductsPricegroupById",
        "parameters": [
          {
            "$ref": "#/components/parameters/if-match"
          }
        ],
        "responses": {
          "200": {
            "description": "Confirms successful update of the resource, returning\nthe new resource state\n"
          },
          "400": {
            "$ref": "#/components/responses/400"
          },
          "401": {
            "$ref": "#/components/responses/401"
          },
          "403": {
            "$ref": "#/components/responses/403"
          },
          "404": {
            "$ref": "#/components/responses/404"
          }
        }
      }
    },
    "/products/warehouses": {
      "description": "Manage warehouses",
      "get": {
        "tags": [
          "Warehouses"
        ],
        "summary": "Get a list of warehouses",
        "operationId": "getWarehouses",
        "responses": {
          "200": {
            "description": "Returns the full set of configured warehouses",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "items"
                  ],
                  "properties": {
                    "_links": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    },
                    "items": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Warehouse"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/400"
          },
          "401": {
            "$ref": "#/components/responses/401"
          },
          "403": {
            "$ref": "#/components/responses/403"
          },
          "404": {
            "$ref": "#/components/responses/404"
          }
        }
      },
      "post": {
        "tags": [
          "Warehouses"
        ],
        "summary": "Create a warehouse",
        "operationId": "postWarehouse",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/NewWarehouse"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Confirms successful creation of the new resource,\nreturning the new data\n",
            "headers": {
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "Location": {
                "schema": {
                  "type": "string",
                  "format": "uri-reference"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/400"
          },
          "401": {
            "$ref": "#/components/responses/401"
          },
          "403": {
            "$ref": "#/components/responses/403"
          },
          "404": {
            "$ref": "#/components/responses/404"
          }
        }
      }
    },
    "/products/warehouses/{id}": {
      "description": "Manage a warehouse",
      "parameters": [
        {
          "name": "id",
          "in": "path",
          "required": true,
          "schema": {
            "$ref": "#/components/schemas/warehouse-id"
          },
          "style": "simple"
        }
      ],
      "get": {
        "tags": [
          "Warehouses"
        ],
        "summary": "Get a single warehouse",
        "operationId": "getWarehousesById",
        "responses": {
          "200": {
            "description": "Returns the data of a single resource",
            "headers": {
              "ETag": {
                "$ref": "#/components/headers/ETag"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Warehouse"
                }
              }
            }
          },
          "304": {
            "$ref": "#/components/responses/304"
          },
          "400": {
            "$ref": "#/components/responses/400"
          },
          "401": {
            "$ref": "#/components/responses/401"
          },
          "403": {
            "$ref": "#/components/responses/403"
          },
          "404": {
            "$ref": "#/components/responses/404"
          }
        }
      },
      "put": {
        "tags": [
          "Warehouses"
        ],
        "summary": "Update a single warehouse",
        "operationId": "putWarehousesById",
        "parameters": [
          {
            "$ref": "#/components/parameters/if-match"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Warehouse"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Confirms successful replacement of the resources data,\nreturning the new state\n",
            "headers": {
              "ETag": {
                "$ref": "#/components/headers/ETag"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Warehouse"
                }
              }
            }
          },
          "304": {
            "$ref": "#/components/responses/304"
          },
          "400": {
            "$ref": "#/components/responses/400"
          },
          "401": {
            "$ref": "#/components/responses/401"
          },
          "403": {
            "$ref": "#/components/responses/403"
          },
          "404": {
            "$ref": "#/components/responses/404"
          },
          "412": {
            "$ref": "#/components/responses/412"
          },
          "413": {
            "$ref": "#/components/responses/413"
          },
          "428": {
            "$ref": "#/components/responses/428"
          }
        }
      },
      "delete": {
        "tags": [
          "Warehouses"
        ],
        "summary": "Delete a single warehouse",
        "operationId": "deleteWarehousesById",
        "parameters": [
          {
            "$ref": "#/components/parameters/if-match"
          }
        ],
        "responses": {
          "204": {
            "description": "Confirms deletion of the resource"
          },
          "400": {
            "$ref": "#/components/responses/400"
          },
          "401": {
            "$ref": "#/components/responses/401"
          },
          "403": {
            "$ref": "#/components/responses/403"
          },
          "404": {
            "$ref": "#/components/responses/404"
          }
        }
      },
      "patch": {
        "tags": [
          "Warehouses"
        ],
        "summary": "Update a single warehouse",
        "operationId": "updateWarehousesById",
        "parameters": [
          {
            "$ref": "#/components/parameters/if-match"
          }
        ],
        "responses": {
          "200": {
            "description": "Confirms successful update of the resource,\nreturning the new state\n"
          },
          "400": {
            "$ref": "#/components/responses/400"
          },
          "401": {
            "$ref": "#/components/responses/401"
          },
          "403": {
            "$ref": "#/components/responses/403"
          },
          "404": {
            "$ref": "#/components/responses/404"
          }
        }
      }
    }
  },
  "components": {
    "responses": {
      "304": {
        "description": "Not modified"
      },
      "400": {
        "description": "Bad request"
      },
      "401": {
        "description": "Unauthorized"
      },
      "403": {
        "description": "Forbidden"
      },
      "404": {
        "description": "Not Found"
      },
      "412": {
        "description": "Precondition failed (If-Match header)"
      },
      "413": {
        "description": "Payload too large"
      },
      "428": {
        "description": "Precondition required"
      }
    },
    "parameters": {
      "if-match": {
        "name": "If-Match",
        "in": "header",
        "description": "Clients need to provide the If-Match parameter on update operations\n(PUT and PATCH) with the ETag obtained in the request from which\ndata are being updated. Requests missing this header will be\nrejected with HTTP response code 428. Requests trying to update\noutdated content will be rejected with HTTP response code 412.\n",
        "required": true,
        "schema": {
          "type": "string"
        }
      },
      "if-match1": {
        "name": "If-Match",
        "in": "header",
        "description": "...",
        "required": true,
        "schema": {
          "type": "string"
        }
      }
    },
    "headers": {
      "ETag": {
        "description": "The API uses the ETag parameter to prevent different clients modifying\nthe same resource around the same time from overwriting each other's\ndata: the later updates will be rejected based on verification of this\nparameter.\nClients need to retain the ETag returned on a request when they might\nwant to update the values later.\n",
        "required": true,
        "schema": {
          "type": "string"
        }
      },
      "ETag1": {
        "description": "...",
        "required": true,
        "schema": {
          "type": "string"
        }
      }
    },
    "securitySchemes": {
      "cookieAuth": {
        "type": "apiKey",
        "in": "cookie",
        "name": "LedgerSMB-1.10",
        "description": "The authenticating cookie can be obtained by sending a `POST` request\nto `login.pl?action=authenticate&company=<url-encoded-company` with a\nJSON object in the body of the request, containing these three fields\n\n* company\n* username\n* password\n\nas if they had been entered on the login page in the browser. Please\nnote that the request `Content-Type` must be set to `application/json`\nand that an `X-Requested-With` header is expected with the value\n`XMLHttpRequest`.\n\n**Note**: the cookie value is updated on each response; the next\nrequest *must* be executed with the new cookie value.\n\n**Note 2**: the validity of the cookie is as long the user's timeout\nwhen logged into the application (default: 90 minutes).\n"
      }
    },
    "schemas": {
      "sic-code": {
        "type": "string",
        "minLength": 1
      },
      "SIC": {
        "type": "object",
        "required": [
          "code",
          "description"
        ],
        "properties": {
          "code": {
            "$ref": "#/components/schemas/sic-code"
          },
          "description": {
            "type": "string"
          }
        }
      },
      "business-type-id": {
        "type": "number",
        "format": "int64"
      },
      "BusinessType": {
        "allOf": [
          {
            "$ref": "#/components/schemas/NewBusinessType"
          },
          {
            "type": "object",
            "required": [
              "id"
            ],
            "properties": {
              "id": {
                "$ref": "#/components/schemas/business-type-id"
              }
            }
          }
        ]
      },
      "NewBusinessType": {
        "type": "object",
        "required": [
          "description"
        ],
        "properties": {
          "description": {
            "type": "string"
          },
          "discount": {
            "type": "number",
            "format": "float"
          }
        }
      },
      "language-code": {
        "type": "string",
        "pattern": "^[a-z]{2}(_[A-Z]{2})?$"
      },
      "Language": {
        "type": "object",
        "required": [
          "code",
          "description"
        ],
        "properties": {
          "code": {
            "$ref": "#/components/schemas/language-code"
          },
          "description": {
            "type": "string"
          }
        }
      },
      "country-code": {
        "type": "string",
        "pattern": "^[a-zA-Z]{2}$"
      },
      "Country": {
        "type": "object",
        "required": [
          "code",
          "name"
        ],
        "properties": {
          "code": {
            "$ref": "#/components/schemas/country-code"
          },
          "name": {
            "type": "string"
          }
        }
      },
      "accno-code": {
        "type": "string",
        "minLength": 1
      },
      "GIFI": {
        "type": "object",
        "required": [
          "accno",
          "description"
        ],
        "properties": {
          "accno": {
            "$ref": "#/components/schemas/accno-code"
          },
          "description": {
            "type": "string",
            "minLength": 1
          }
        }
      },
      "error": {
        "type": "object"
      },
      "newInvoice": {
        "type": "object",
        "required": [
          "eca",
          "account",
          "currency",
          "dates",
          "lines"
        ],
        "properties": {
          "eca": {
            "anyOf": [
              {
                "type": "object",
                "required": [
                  "id"
                ],
                "properties": {
                  "id": {
                    "type": "integer",
                    "format": "int64",
                    "minimum": 1
                  }
                }
              },
              {
                "type": "object",
                "required": [
                  "number",
                  "type"
                ],
                "properties": {
                  "number": {
                    "type": "string",
                    "minLength": 1
                  },
                  "type": {
                    "type": "string",
                    "enum": [
                      "customer",
                      "vendor"
                    ]
                  }
                }
              }
            ]
          },
          "account": {
            "type": "object",
            "properties": {
              "accno": {
                "type": "string",
                "minLength": 1
              }
            }
          },
          "currency": {
            "type": "string",
            "minLength": 3,
            "maxLength": 3
          },
          "description": {
            "type": "string",
            "nullable": true
          },
          "notes": {
            "type": "string",
            "nullable": true
          },
          "internal-notes": {
            "type": "string",
            "nullable": true
          },
          "invoice-number": {
            "type": "string"
          },
          "order-number": {
            "type": "string"
          },
          "po-number": {
            "type": "string"
          },
          "ship-via": {
            "type": "string",
            "nullable": true
          },
          "shipping-point": {
            "type": "string",
            "nullable": true
          },
          "ship-to": {
            "type": "object"
          },
          "dates": {
            "type": "object",
            "required": [
              "book"
            ],
            "properties": {
              "due": {
                "type": "string",
                "format": "date"
              },
              "book": {
                "type": "string",
                "format": "date"
              },
              "created": {
                "type": "string",
                "format": "date"
              }
            }
          },
          "lines": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "part"
              ],
              "properties": {
                "description": {
                  "type": "string"
                },
                "price": {
                  "type": "number"
                },
                "price_fixated": {
                  "type": "boolean",
                  "default": false
                },
                "unit": {
                  "type": "string"
                },
                "qty": {
                  "type": "number",
                  "default": 1
                },
                "taxform": {
                  "type": "boolean",
                  "default": false
                },
                "serialnumber": {
                  "type": "string",
                  "nullable": true
                },
                "discount": {
                  "description": "A value of 10 means the customer gets a 10% discount,\nif discount_type has a value of '%'\n",
                  "type": "number",
                  "minimum": 0,
                  "maximum": 100
                },
                "discount_type": {
                  "type": "string",
                  "enum": [
                    "%"
                  ]
                },
                "delivery_date": {
                  "type": "string",
                  "format": "date",
                  "nullable": true
                },
                "part": {
                  "type": "object",
                  "required": [
                    "number"
                  ],
                  "properties": {
                    "number": {
                      "type": "string",
                      "minLength": 1
                    }
                  }
                }
              }
            }
          },
          "taxes": {
            "type": "object",
            "additionalProperties": {
              "type": "object",
              "properties": {
                "tax": {
                  "type": "object",
                  "required": [
                    "category"
                  ],
                  "properties": {
                    "category": {
                      "type": "string"
                    }
                  }
                },
                "base-amount": {
                  "type": "number"
                },
                "amount": {
                  "type": "number"
                },
                "source": {
                  "type": "string"
                },
                "memo": {
                  "type": "string"
                }
              }
            }
          },
          "payments": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "account",
                "amount",
                "date"
              ],
              "properties": {
                "date": {
                  "type": "string",
                  "format": "date"
                },
                "source": {
                  "type": "string"
                },
                "memo": {
                  "type": "string"
                },
                "amount": {
                  "type": "number"
                },
                "account": {
                  "type": "object",
                  "required": [
                    "accno"
                  ],
                  "properties": {
                    "accno": {
                      "type": "string",
                      "minLength": 1
                    }
                  }
                }
              }
            }
          }
        }
      },
      "Invoice": {
        "description": "...",
        "allOf": [
          {
            "$ref": "#/components/schemas/newInvoice"
          },
          {
            "type": "object",
            "properties": {
              "eca": {
                "type": "object",
                "properties": {
                  "entity": {
                    "type": "object",
                    "properties": {
                      "credit_limit": {
                        "type": "object",
                        "properties": {
                          "total": {
                            "type": "number"
                          },
                          "used": {
                            "type": "number"
                          },
                          "available": {
                            "type": "number"
                          }
                        }
                      }
                    }
                  }
                }
              },
              "account": {
                "type": "object",
                "properties": {
                  "description": {
                    "type": "string"
                  }
                }
              },
              "lines": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "part": {
                      "type": "object",
                      "properties": {
                        "_self": {
                          "type": "string"
                        }
                      }
                    },
                    "total": {
                      "type": "number"
                    }
                  }
                }
              },
              "taxes": {
                "type": "object",
                "additionalProperties": {
                  "type": "object",
                  "properties": {
                    "name": {
                      "type": "string"
                    },
                    "rate": {
                      "type": "number",
                      "minimum": 0,
                      "maximum": 1
                    },
                    "calculated-amount": {
                      "type": "number"
                    }
                  }
                }
              },
              "payments": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "account": {
                      "type": "object",
                      "properties": {
                        "description": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        ]
      },
      "common-id": {
        "type": "integer",
        "format": "int64",
        "minimum": 1
      },
      "pricegroup-id": {
        "$ref": "#/components/schemas/common-id"
      },
      "Pricegroup": {
        "allOf": [
          {
            "$ref": "#/components/schemas/NewPricegroup"
          },
          {
            "type": "object",
            "required": [
              "id"
            ],
            "properties": {
              "id": {
                "$ref": "#/components/schemas/pricegroup-id"
              }
            }
          }
        ]
      },
      "NewPricegroup": {
        "type": "object",
        "required": [
          "description"
        ],
        "properties": {
          "description": {
            "type": "string"
          }
        }
      },
      "warehouse-id": {
        "$ref": "#/components/schemas/common-id"
      },
      "Warehouse": {
        "allOf": [
          {
            "$ref": "#/components/schemas/NewWarehouse"
          },
          {
            "type": "object",
            "required": [
              "id"
            ],
            "properties": {
              "id": {
                "$ref": "#/components/schemas/warehouse-id"
              }
            }
          }
        ]
      },
      "NewWarehouse": {
        "type": "object",
        "required": [
          "description"
        ],
        "properties": {
          "description": {
            "type": "string"
          }
        }
      }
    }
  }
}