Skip to content

Get Invoice Status

Retrieve latest status of an invoice using its reference

GET/esws/api/status

Notes

  1. Issued authorization token is valid within 60 seconds upon response.
  2. It is encouraged to authenticate first before doing a single transaction.


STATUS TYPE
Parameter Description
GENERATED The invoice was generated
EMAIL_SENT The invoice was created and sent to the intended recipient.
UNDELIVERED The invoice was created and failed to send to the intended recipient.
PAID The invoice was paid by the recipient.
FAILED The payment made by the recipient to the invoice failed.
REJECTED The recipient rejected the invoice.
CANCELLED The biller cancelled the invoice.
PENDING The payment is still pending and waiting for the result.

Generate Invoice Status

Generate Invoice Status Header Parameters!

Request Samples

curl -X POST "http://test.ws.e-snapped.com/esws/api/status?reference=INV-00001_TEST"
-H "accept: application/json" 
-H "Authorization: Bearer eyJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJBbHRQYXlOZXQgQ29ycCIsImlhdCI6MTU4MTA0NTkxNCwiZXNrIjoiVThnSGElMkJDTVdieFNRMVJ0WUEyZ0FkMmN4cEtPZW8lMkJMbXh5TEwxS3k1ZW8lM0QuZXNsbFdSQ3NEbk9UalM4TG9TbHMlMkJUUkElM0QlM0QiLCJlc3AiOiI1bjE3T0dGVlpnOW5RVW5TWTRGUXZRJTNEJTNELmVzRXRvT1JUVkNXSXl0JTJCN2pWamNYRnVnJTNEJTNEIiwiZXhwIjoxNTgxMDQ3NzE0fQ.yn6_ncSr1MckNsE3BkhsMW5r1muRJlfLdSOHBpYjjeo"
-H "Content-Type: application/json" 
  var settings = {
  "url": "{host}/esws/api/status?reference=INV-000001",
  "method": "GET",
  "timeout": 0,
  "headers": {
  "Authorization":"Bearer eyJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJBbHRQYXlOZXQgQ29ycCIsImlhdCI6MTU4MTA0NTkxNCwiZXNrIjoiVThnSGElMkJDTVdieFNRMVJ0WUEyZ0FkMmN4cEtPZW8lMkJMbXh5TEwxS3k1ZW8lM0QuZXNsbFdSQ3NEbk9UalM4TG9TbHMlMkJUUkElM0QlM0QiLCJlc3AiOiI1bjE3T0dGVlpnOW5RVW5TWTRGUXZRJTNEJTNELmVzRXRvT1JUVkNXSXl0JTJCN2pWamNYRnVnJTNEJTNEIiwiZXhwIjoxNTgxMDQ3NzE0fQ.yn6_ncSr1MckNsE3BkhsMW5r1muRJlfLdSOHBpYjjeo",
    "Content-Type": "application/json"
  }
};

$.ajax(settings).done(function (response) {
  console.log(response);
});

Responses

200 Successful Request

Get Invoice Status Response Parameters!

400 Result of missing/invalid header parameter/s

Generate Invoice Response Parameters!

401 Result of invalid authorization token. Token must not be null, not modified, and not expired.

Generate Invoice Response Parameters!

422 Result of missing/invalid URL parameter.

Generate Invoice Response Parameters!

Response Samples

{
  "code": "OK.01",
  "message": "HTTP Request Success",
  "timestamp": "2020-02-07 04:10:56.60",
  "status": "PAID",
  "reference": "INV-000001_TEST"
}
{
  "code": "ER.01",
  "message": "HTTP Request Error",
  "timestamp": "2020-02-07 03:55:06.741",
  "errors": [
    "Missing request header 'Authorization' of type String"
  ]
}
{
  "code": "ER.02",
  "message": "Authentication Error",
  "timestamp": "2020-02-07 03:57:27.384",
  "errors": [
    "Invalid authorization token. Make sure that the token is valid and not altered/modified."
  ]
}
{
  "code": "ER.04",
  "message": "Validation Error",
  "timestamp": "2020-02-07 04:54:12.110",
  "errors": [
    "Invoice not found"
  ]
}