This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision | |
| web_interface:rest_api [2025/09/10 11:28] – [API definition] Gary Willetts | web_interface:rest_api [2025/11/04 15:43] (current) – [API definition] Gary Willetts |
|---|
| |
| ^ URL ^ HTTP Verb ^Description| | ^ URL ^ HTTP Verb ^Description| |
| | /login | POST | Login with username and password setup in mSupply. For the ''/storeCustomerInvoice'' endpoint, the username and password must be for an mSupply user. For all other endpoints the username and password must be for a contact of a store name.\\ \\ Returns a JWT cookie to be used in following requests (send it in an Authorization header with scheme Bearer i.e. ''Authorization: Bearer <jwt_token>''). Include the ''loginType = "invoice"'' element in the request body or, for the ''/storeCustomerInvoice'' endpoint, include the ''loginType = "storeInvoice"'' element. | | | /login | POST | Login with username and password setup in mSupply. For the ''/storeCustomerInvoice'' endpoint, the username and password must be for an mSupply user. For all other endpoints the username and password must be for a contact of a store name.\\ \\ Returns a JWT cookie (which expires in 2 hours) to be used in following requests (send it in an Authorization header with scheme Bearer i.e. ''Authorization: Bearer <jwt_token>''). Include the ''loginType = "invoice"'' element in the request body or, for the ''/storeCustomerInvoice'' endpoint, include the ''loginType = "storeInvoice"'' element. | |
| | /stock | GET | Returns an array of stock details for all items in the customer's master list(s). \\ * Quantities are specified in number of packs and pack size. \\ * Separate lines for each different batch, expiry date or pack size. | | | /stock | GET | Returns an array of stock details for all items in the customer's master list(s). \\ * Quantities are specified in number of packs and pack size. \\ * Separate lines for each different batch, expiry date or pack size. | |
| | /stock?code=xxx&name=yyy | GET | Returns an array of stock details for all visible items, optionally restricted to those starting with the specified code/name. \\ * Quantities are specified in number of packs and pack size. \\ * Separate lines for each different batch, expiry date or pack size. | | | /stock?code=xxx&name=yyy | GET | Returns an array of stock details for all visible items, optionally restricted to those starting with the specified code/name. \\ * Quantities are specified in number of packs and pack size. \\ * Separate lines for each different batch, expiry date or pack size. | |