{ "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": { "/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" } } } }, "/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" } } } }, "examples": { "validCountries": { "$ref": "#/components/examples/validCountries" } } } } }, "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" }, "examples": { "validCountry": { "$ref": "#/components/examples/validCountry" } } } } }, "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" }, "409": { "$ref": "#/components/responses/409" }, "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" }, "409": { "$ref": "#/components/responses/409" }, "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" } } } }, "/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" } }, "examples": { "validInvoices": { "$ref": "#/components/examples/validInvoices" } } } } }, "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" }, "examples": { "validInvoice": { "$ref": "#/components/examples/validInvoice" } } } } }, "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" } } } }, "/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": "array", "items": { "type": "object" } }, "items": { "type": "array", "items": { "$ref": "#/components/schemas/SIC" } } } }, "examples": { "validSICs": { "$ref": "#/components/examples/validSICs" } } } } }, "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/ETag2" }, "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/ETag2" } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SIC" }, "examples": { "validSIC": { "$ref": "#/components/examples/validSIC" } } } } }, "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-match2" } ], "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/ETag2" } }, "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-match2" } ], "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-match2" } ], "responses": { "200": { "description": "Confirms updating the data associated with the SIC code, returning the new SIC data", "headers": { "ETag": { "$ref": "#/components/headers/ETag2" } }, "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" } } } }, "examples": { "validBusinessTypes": { "$ref": "#/components/examples/validBusinessTypes" } } } } }, "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/ETag2" }, "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/ETag2" } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BusinessType" }, "examples": { "validBusinessType": { "$ref": "#/components/examples/validBusinessType" } } } } }, "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-match2" } ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BusinessType" } } } }, "responses": { "200": { "description": "Confirms replacement of the business type data", "headers": { "ETag": { "$ref": "#/components/headers/ETag2" } }, "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-match2" } ], "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-match2" } ], "responses": { "200": { "description": "Confirms updating the business type data, returning the new resource data", "headers": { "ETag": { "$ref": "#/components/headers/ETag2" } }, "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" } } } }, "examples": { "validLanguages": { "$ref": "#/components/examples/validLanguages" } } } } }, "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" }, "examples": { "validLanguage": { "$ref": "#/components/examples/validLanguage" } } } } }, "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" }, "409": { "$ref": "#/components/responses/409" }, "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" }, "409": { "$ref": "#/components/responses/409" } } }, "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" } } } }, "/gl/gifi": { "description": "A list of GIFI", "get": { "tags": [ "GIFI" ], "summary": "Get a list of GIFI", "operationId": "getGIFIs", "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" } } } }, "examples": { "validGIFIs": { "$ref": "#/components/examples/validGIFIs" } } } } }, "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": "postGIFI", "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": "getGIFIById", "responses": { "200": { "description": "...", "headers": { "ETag": { "$ref": "#/components/headers/ETag" } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GIFI" }, "examples": { "validGIFI": { "$ref": "#/components/examples/validGIFI" } } } } }, "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": "putGIFIById", "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": "deleteGIFIById", "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": "updateGIFIById", "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" } } } }, "/orders": { "description": "Management of Orders", "get": { "tags": [ "Orders", "Experimental" ], "summary": "Lists orders", "operationId": "getOrders", "responses": { "200": { "description": "...", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/Order" } }, "examples": { "validOrders": { "$ref": "#/components/examples/validOrders" } } } } }, "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": [ "Orders", "Experimental" ], "summary": "Add an order", "operationId": "postOrders", "requestBody": { "description": "...", "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/newOrder" } } } }, "responses": { "201": { "description": "Created", "headers": { "ETag": { "$ref": "#/components/headers/ETag3" }, "Location": { "schema": { "type": "string", "format": "uri-reference" } } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Order" } } } }, "400": { "$ref": "#/components/responses/400" }, "401": { "$ref": "#/components/responses/401" }, "403": { "$ref": "#/components/responses/403" }, "404": { "$ref": "#/components/responses/404" } } } }, "/orders/{id}": { "parameters": [ { "name": "id", "in": "path", "required": true, "schema": { "type": "string", "minLength": 1 } } ], "get": { "tags": [ "Orders", "Experimental" ], "summary": "Get a single order", "operationId": "getOrdersById", "responses": { "200": { "description": "...", "headers": { "ETag": { "$ref": "#/components/headers/ETag3" } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Order" }, "examples": { "validOrder": { "$ref": "#/components/examples/validOrder" } } } } }, "400": { "$ref": "#/components/responses/400" }, "401": { "$ref": "#/components/responses/401" }, "403": { "$ref": "#/components/responses/403" }, "404": { "$ref": "#/components/responses/404" } } }, "put": { "tags": [ "Orders", "Experimental" ], "summary": "Update a single order", "operationId": "putOrderById", "parameters": [ { "$ref": "#/components/parameters/if-match3" } ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/newOrder" } } } }, "responses": { "200": { "description": "...", "headers": { "ETag": { "$ref": "#/components/headers/ETag3" } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Order" } } } }, "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/partsgroups": { "description": "Managing products and related configuration", "get": { "tags": [ "Parts groups" ], "summary": "Get products parts groups", "operationId": "getProductsPartsgroups", "responses": { "200": { "description": "Returns the full list of defined parts groups", "content": { "application/json": { "schema": { "type": "object", "required": [ "items" ], "properties": { "_links": { "type": "array", "items": { "type": "object" } }, "items": { "type": "array", "items": { "$ref": "#/components/schemas/Partsgroup" } } } }, "examples": { "validPartsgroups": { "$ref": "#/components/examples/validPartsgroups" } } } } }, "400": { "$ref": "#/components/responses/400" }, "401": { "$ref": "#/components/responses/401" }, "403": { "$ref": "#/components/responses/403" }, "404": { "$ref": "#/components/responses/404" } } }, "post": { "tags": [ "Parts groups" ], "summary": "Create products parts group", "operationId": "postProductsPartsgroup", "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/NewPartsgroup" } } } }, "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/partsgroups/{id}": { "parameters": [ { "name": "id", "in": "path", "required": true, "schema": { "$ref": "#/components/schemas/common-id" }, "style": "simple" } ], "get": { "tags": [ "Parts groups" ], "summary": "Get a single products parts group", "operationId": "getProductsPartsgroupById", "responses": { "200": { "description": "Returns the data for a single resource\n", "headers": { "ETag": { "$ref": "#/components/headers/ETag" } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Partsgroup" }, "examples": { "validPartsgroup": { "$ref": "#/components/examples/validPartsgroup" } } } } }, "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": [ "Parts groups" ], "summary": "Create single products parts group", "operationId": "putProductsPartsgroupById", "parameters": [ { "$ref": "#/components/parameters/if-match" } ], "requestBody": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Partsgroup" } } } }, "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/Partsgroup" } } } }, "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" }, "409": { "$ref": "#/components/responses/409" }, "412": { "$ref": "#/components/responses/412" }, "413": { "$ref": "#/components/responses/413" }, "428": { "$ref": "#/components/responses/428" } } }, "delete": { "tags": [ "Parts groups" ], "summary": "Delete a single products price group", "operationId": "deleteProductsPartsgroupById", "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" }, "409": { "$ref": "#/components/responses/409" } } }, "patch": { "tags": [ "Parts groups" ], "summary": "Updaet a single products parts group", "operationId": "updateProductsPartsgroupById", "parameters": [ { "$ref": "#/components/parameters/if-match" } ], "responses": { "200": { "description": "Confirms successful update of the resource,\nreturning the new resource state\n" }, "400": { "$ref": "#/components/responses/400" }, "401": { "$ref": "#/components/responses/401" }, "403": { "$ref": "#/components/responses/403" }, "404": { "$ref": "#/components/responses/404" }, "409": { "$ref": "#/components/responses/409" } } } }, "/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" } } } }, "examples": { "validPricegroups": { "$ref": "#/components/examples/validPricegroups" } } } } }, "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/common-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" }, "examples": { "validPricegroup": { "$ref": "#/components/examples/validPricegroup" } } } } }, "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" }, "409": { "$ref": "#/components/responses/409" }, "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" }, "409": { "$ref": "#/components/responses/409" } } }, "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" }, "409": { "$ref": "#/components/responses/409" } } } }, "/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" } } } }, "examples": { "validWarehouses": { "$ref": "#/components/examples/validWarehouses" } } } } }, "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/common-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" }, "examples": { "validWarehouse": { "$ref": "#/components/examples/validWarehouse" } } } } }, "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" }, "409": { "$ref": "#/components/responses/409" }, "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" }, "409": { "$ref": "#/components/responses/409" } } }, "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" }, "409": { "$ref": "#/components/responses/409" } } } } }, "components": { "responses": { "304": { "description": "Not modified" }, "400": { "description": "Bad request" }, "401": { "description": "Unauthorized" }, "403": { "description": "Forbidden" }, "404": { "description": "Not Found" }, "409": { "description": "Conflict" }, "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" } }, "if-match2": { "name": "If-Match", "in": "header", "description": "...", "required": true, "schema": { "type": "string" } }, "if-match3": { "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" } }, "ETag2": { "description": "...", "required": true, "schema": { "type": "string" } }, "ETag3": { "description": "...", "required": true, "schema": { "type": "string" } } }, "securitySchemes": { "cookieAuth": { "type": "apiKey", "in": "cookie", "name": "LedgerSMB", "description": "The authenticating cookie can be obtained by sending a `POST` request\nto `login.pl?__action=authenticate&company=