EOR API Endpoint Documentation
Updated: 14-Mar-2024 | Previous: 19-Feb-2024
May change with prior notice.
# | Method | Endpoint Address | Updated | Previous |
---|---|---|---|
1 | POST | 14-Mar-2024 | |
2 | POST | 07-Feb-2024 | |
3 | POST | 12-Mar-2024 |
Request and Response Handling | UPDATED |
Duplicate or Conflicting Data | 31-JAN-2024 T3:00PM |
JWT Token Expiry and request error response payloads | 31-JAN-2024 T3:00PM |
Handling Response Payloads | 31-JAN-2024 T3:00PM |
Response Payloads, ErrorName and HTTP Status Codes | 09-FEB-2024 T8:00PM |
Method | Endpoint Address / Description | Updated | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
POST |
(live) https://api.ppa.com.ph/api/signin/LoginGetJwtAsync
(staging) https://webapi-staging.ppa.com.ph/api/signin/LoginGetJwtAsync
Authorize Web API registered user. This API must be called or accomplished or performed before any or other EOR endpoints can be used by the subscriber. Both staging and live tokens, cookie and JWT validities are 24 hours and 20 minutes respectively. You DO NOT NEED to authorize or login everytime you make a EOR post request. Once your request is denied or authorization/token has expired, issue another LoginGetJwtAsync request in order to be granted for posting again. Tip: As a common practice, most systems monitor their acquisition of new tokens in background threads/jobs. Some usually do this every 15 minutes, or 5 minutes before the actual token expires. This is to give seemless experience to the user/automated systems without having to relogin everytime the token expires. You must persist the JWT token and send it as a Bearer using the header Authorization for every EOR receipt post request. The cookie-based token is used for the web application pages only. The JWT token is used for web, other subscribing application types such as Windows, Android, iOS, etc. NOTE: We will no longer support the cookie-based token in the future, especially with the new upcoming version of PPA Web API. Please use the JWT token instead for posting against EOR system. Request Parameters:
|
14-Mar-2024 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
POST |
(live) https://api.ppa.com.ph/api/eor/PostDataForAckReceipt
(staging) https://webapi-staging.ppa.com.ph/api/eor/PostDataForAckReceipt
Request Payload
Example JSON RequestExample JSON Response:
The endpoint will emit the JSON record below. Validations are also emitted back for each column or property.
As of February 9, 2024, the Status Code will yield 201/Created when the request is successful, instead of 202/Accepted.
Where:
Duplicate or Conflicting Data
In case of the same or exact receipt data has been submitted (hash coded by the PPA Web API Server),
below JSON response payload will be emitted back to the subscribing application. The api method will
return a http response code of 409 (Conflict), along with its error name.
JWT Token Expiry and request error response payloads
The JWT token will expire in 20 mins on both live and stagnig server. You will need to re-authorize or login again to get a new JWT token. You can handle the re-authorization using the response payloads below.
Any of the above exceptions will require you to re-authorize or login again to get a new JWT token.
Other exceptions that may occur:
Handling Response Payloads
It is recommended to check either the HTTP response code or the ErrorName of the response payload, or both.
The developers of EOR recommend the usage of the ErrorName property when dealing with error responses, as these are originally emitted by the
underlying libraries that PPA Web API use.
Response Payloads, ErrorName and HTTP Status Codes
EOR/EPS as a Web API Resful service, follows the Standard HTTP Status Codes, regardless of the request,
http or transactions, since the set of Standard HTTP Status Codes HTTP Status Codes are well known and well-understood by the developers.
The response payload will contain the following properties in JSON format:
List of ErrorName and HTTP Status Codes
When requesting for posting the receipt, the response payload will contain the following ErrorName and Status:
|
07-Feb-2024 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
POST |
(live) https://api.ppa.com.ph/api/eor/RequestJwtEncryption
(staging) https://webapi-staging.ppa.com.ph/api/eor/RequestJwtEncryption
Request PayloadNone
IMPORTANT: When calling the endpoint, the JWT token should be sent as a Bearer in the Authorization header of the request. When printing a receipt from a subscribed system, e.g. ICTSI's ACTS, it opens or redirects to a new browser window. This new window is not covered by the JWT token currently held by the subscriber. Unless, that customer has a user account / access in PPA EOR System. As of the moment, customers do not have this account status yet. This endpoint encrypts the currently held JWT token of a subscriber. The use of this endpoint is to encrypt the jwt to ejwt (encrypted JWT) as a url parameter when jumping from one web application system to another, as a URL parameter e.g. ICTSI ACTS redirecting or opening a window, to the print a customer's receipt. The ejwt is then decrypted by the EOR/EPS system and only this system can decrypt it. In addition to, this token expires every 20 minutes and its usage is no longer possible even if they are cached by the browser or ISPs.
The endpoint /api/eor/PostDataForAckReceipt
JSON response payload, and the property ReceiptPrintUrl will now contain the value below: "ReceiptPrintUrl" : "https://api.ppa.com.ph/eor/printauth/?eorIdSn=the-guid-eoridsn&ejwt=" Example Response Payload
{
When redirecting or opening a new window to the print window/page of the EOR/EPS system, the URL should contain the ejwt parameter.
https://api.ppa.com.ph/eor/printauth/?eorIdSn=the-guid-eoridsn&ejwt=HQTPDtTH91Z%2faX34kkuuiCEOEiNVSj0OjsB5Xvsh9NQaucCmSJpwAQWC7KD3GA4MUeTg0bd3Ju8qJOMdNAOcfpGrwy........
NOTE: the value of the property EJwt is url-encoded, and shorten for brevity in this documentation. The actual value is longer.
|
12-Mar-2024 |