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/11/04 15:43] – [API definition] Gary Willettsweb_interface:rest_api [2026/04/01 14:45] (current) – [API definition] Gary Willetts
Line 38: Line 38:
 ^ 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 (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. | | /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'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 containing an element for every line of stock for all items in the master lists that are assigned to the customer that are set to be used for requisitions as detailed on the [[names:adding_and_editing#item_lists_tab|5.01. Names: using, adding and editing]] page. \\ * 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. |
 | /customerOrder | POST | Create a new customer order with the supplied array of order lines. Returns the ID of the order created. \\ * The customer and supplier's details are derived from the log-in details i.e. the customer will be the store the logged in user is a contact of and the supplier will be the supplying store of that store. \\ * An order (serial) number will be automatically assigned by mSupply (unique per store). \\ * Item codes must match the codes (the mSupply item code or the catalogue code) of items already existing in mSupply. \\ * Requested quantities are specified in number of packs and pack size. \\ * Customer stock on hand quantities (if available) are specified in units. \\ * Customer orders are created as response (customer) requisitions in mSupply. These are then processed manually in the supplying store to generate one or more customer invoices to fulfil the order (see the [[issuing_goods:stock_control_methods#response_internal_requisitions|8.07. Stock control methods for your customers (requisitions)]] page for details). \\ * Customer invoice numbers will also be automatically assigned by mSupply (unique per store). \\ * Generated customer invoices will be linked back to the original customer order via the order number. \\ * Customer invoices are confirmed when the stock has been picked and packed for shipment. \\ * Comments can be entered for the order and also for individual lines. | | /customerOrder | POST | Create a new customer order with the supplied array of order lines. Returns the ID of the order created. \\ * The customer and supplier's details are derived from the log-in details i.e. the customer will be the store the logged in user is a contact of and the supplier will be the supplying store of that store. \\ * An order (serial) number will be automatically assigned by mSupply (unique per store). \\ * Item codes must match the codes (the mSupply item code or the catalogue code) of items already existing in mSupply. \\ * Requested quantities are specified in number of packs and pack size. \\ * Customer stock on hand quantities (if available) are specified in units. \\ * Customer orders are created as response (customer) requisitions in mSupply. These are then processed manually in the supplying store to generate one or more customer invoices to fulfil the order (see the [[issuing_goods:stock_control_methods#response_internal_requisitions|8.07. Stock control methods for your customers (requisitions)]] page for details). \\ * Customer invoice numbers will also be automatically assigned by mSupply (unique per store). \\ * Generated customer invoices will be linked back to the original customer order via the order number. \\ * Customer invoices are confirmed when the stock has been picked and packed for shipment. \\ * Comments can be entered for the order and also for individual lines. |
  • Last modified: 2026/04/01 14:45
  • by Gary Willetts