Explore a full, working code sample of a loan integration with our Application Programming Interface (API). This documentation will outline the basic steps of fetching payment request status by id or reference number from the policyPay system. With your program set up in our production environment, it will be ready for live testing. When successful testing is completed, real loans can be retrieved.
Once you submit to the API, you can see the accounts in the UI at policypay.io by logging in with your given credentials.
We recommend using Postman for all of our API routes. Download our Postman collection using the link below: Download Postman Collection. Our respective Production and Sandbox URLs are the following: rest.policypay.io/payment/request/status/{ref} or uat-rest.policypay.io/payment/request/status/{ref}.
User Credentials
Email: ***
Password: ***
Public Key: ***
Secret Key: ***
URL: /payment/request/status/{ref}
A response payload will be returned which includes your API endpoints along with a successul 200 code displayed. See Response Codes below for further details.
To fetch order status, use reference inputs.
Variable | Type | Required | Notes |
---|---|---|---|
ref (path) | String | Yes |
Sample JSON Response
{
"status": "success",
"message": "string",
"request": {
"status": "Requested",
"url": "string",
"name": "string",
"email": "string",
"amount": 0,
"expires": "2023-12-04",
"_id": "string",
"abbr": "string",
"itemName": "string",
"agencyId": "string",
"agencyName": "string",
"agent": {
"_id": "string",
"name": "string",
"email": "string"
}
}
}
Response Codes
Code | Description |
---|---|
200 | Payment request status retrieved successfully |
400 | Failed to create loan |
422 | Unprocessable entry |
500 | Internal server error |