Differences

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

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
web_interface:rest_api [2025/01/21 15:57] Adrian Booneweb_interface:rest_api [2025/05/14 03:26] (current) – [What is it?] Gary Willetts
Line 8: Line 8:
   * Mark a customer invoice as acknowledged (shipped)   * Mark a customer invoice as acknowledged (shipped)
   * Mark a customer invoice as received (arrived)   * Mark a customer invoice as received (arrived)
 +  * Retrieve stock information
  
 Response requisitions will be processed in mSupply as normal in the supplying store, and can be fulfilled by generating and processing one or more customer invoices, depending on stock availability. Response requisitions will be processed in mSupply as normal in the supplying store, and can be fulfilled by generating and processing one or more customer invoices, depending on stock availability.
Line 224: Line 225:
         "confirmedDate": "2020-12-29T12:45:00.000Z",         "confirmedDate": "2020-12-29T12:45:00.000Z",
         "receivedDate": "",         "receivedDate": "",
 +        "acknowledgedDate": "",
         "cancelledDate": "", // blank unless the invoice has been manually cancelled after it has been confirmed         "cancelledDate": "", // blank unless the invoice has been manually cancelled after it has been confirmed
         "invoiceReference": "REF222",         "invoiceReference": "REF222",
Line 254: Line 256:
     "error": "JWT token/user ID/store ID not found"     "error": "JWT token/user ID/store ID not found"
 } }
-</code> Returns all customer invoices for the logged in customer in their supplying store and confirmed, but which haven't yet been received or cancelled. Note that a single customer order can be split into multiple customer invoices |+</code> Returns all customer invoices for the logged in customer in their supplying store and confirmed, but which haven't yet been acknowledged, received or cancelled. Note that a single customer order can be split into multiple customer invoices |
 | api/v4/customerInvoiceReceived/8567546 | PATCH | Request: <code=javascript> | api/v4/customerInvoiceReceived/8567546 | PATCH | Request: <code=javascript>
 { {
Line 306: Line 308:
 } }
 </code> Updates the received date for the specified customer invoice -> it will no longer appear in the GET response above | </code> Updates the received date for the specified customer invoice -> it will no longer appear in the GET response above |
 +| api/v4/customerInvoiceAcknowledged/8567546 | PATCH | Request: <code=javascript>
 +{
 +    "acknowledgedDate": "2020-12-31T09:23:00.000Z"
 +}
 +</code> Response: <code=javascript> 
 +// success (HTTP status 200)
 +{
 +    "status": "success",
 +    "numberOfRecordsUpdated": 1
 +}
 +// failure (HTTP status 404)
 +{
 +    "status": "error",
 +    "error": "Invoice not found"
 +}
 +// failure (HTTP status 409)
 +{
 +    "status": "error",
 +    "error": "More than one invoice found"
 +}
 +// failure (HTTP status 503)
 +{
 +    "status": "error",
 +    "error": "Unable to update invoice"
 +}
 +// failure (HTTP status 503)
 +{
 +    "status": "error",
 +    "error": "acknowledgedDate is invalid"
 +}
 +// failure (HTTP status 403)
 +{
 +    "status": "error",
 +    "error": "Invoice is not yet ready for dispatch"
 +}
 +// failure (HTTP status 403)
 +{
 +    "status": "error",
 +    "error": "Invoice has been already been acknowledged/cancelled"
 +}
 +// failure (HTTP status 400)
 +{
 +    "status": "error",
 +    "error": "Invoice number/acknowledged date missing"
 +}
 +// failure (HTTP status 401)
 +{
 +    "status": "error",
 +    "error": "JWT token/user ID/store ID not found"
 +}
 +</code> Updates the acknowledged date for the specified customer invoice -> it will no longer appear in the GET response above |
 | api/v4/customerInvoice/8567546 | GET | Response: <code=javascript>  | api/v4/customerInvoice/8567546 | GET | Response: <code=javascript> 
 // success (HTTP status 200) // success (HTTP status 200)
  • Last modified: 2025/01/21 15:57
  • by Adrian Boone