web_interface:rest_api

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
web_interface:rest_api [2025/09/10 11:25] – [API definition] Gary Willettsweb_interface:rest_api [2025/09/10 11:28] (current) – [API definition] Gary Willetts
Line 37: Line 37:
  
 ^ 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 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. |
Line 46: Line 46:
 | /customerInvoiceReceived/{invoice number} | PATCH | Set the specified customer invoice's received (arrival) date to the date specified (in ISO format). | | /customerInvoiceReceived/{invoice number} | PATCH | Set the specified customer invoice's received (arrival) date to the date specified (in ISO format). |
 | /customerInvoiceAcknowledged/{invoice number} | PATCH | Set the specified customer invoice's acknowledged (shipped) date to the date specified (in ISO format). | | /customerInvoiceAcknowledged/{invoice number} | PATCH | Set the specified customer invoice's acknowledged (shipped) date to the date specified (in ISO format). |
-| /storeCustomerInvoice?startDate=YYYY-MM-DD&endDate=YYYY-MM-DD | GET | **Note: This endpoint has a different authentication method to the others. You must login as an mSupply user (see the [[web_interface:rest_api#authentication|Authentication]] section above), not a contact of a store.**\\ Returns all confirmed (and not cancelled) customer invoices in the default store of the user logged in with, which were confirmed between the startDate and endDate. |+| /storeCustomerInvoice?startDate=YYYY-MM-DD&endDate=YYYY-MM-DD | GET | **Note: This endpoint has a different authentication method to the others. You must login as an mSupply user (see the [[web_interface:rest_api#authentication|Authentication]] section above), not a contact of a store and you must use a different **''loginType''** value.**\\ Returns all confirmed (and not cancelled) customer invoices in the default store of the user logged in with, which were confirmed between the startDate and endDate. |
  
 ===== Examples ===== ===== Examples =====
  • Last modified: 2025/09/10 11:28
  • by Gary Willetts