Explore a full, working code sample of a Payment integration with our Application Programming Interface (API). This documentation will outline the basic steps of creating a payment intent for the order before creating it. With your program set up in our production environment, it will be ready for live testing. When successful testing is completed, real Payments can be created.
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/intent/fee or uat-rest.policypay.io/payment/intent/fee.
User Credentials
Email: ***
Password: ***
Public Key: ***
Secret Key: ***
URL: /payment/intent/fee
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.
Your API endpoint definitions will vary and be custom for your specific needs. The following is an example.
Variable | Type | Required | Notes |
---|---|---|---|
paymentMethod | String | Yes | |
orig_amount | Number | Yes | |
programId | String | Yes |
Sample JSON Payload
{
"paymentMethod": "string",
"orig_amount": 0,
"programId": "string"
}
Sample JSON Response
{
"status": "success",
"message": "string",
"order": {
"orig_amount": 0,
"fee": 0,
"total": 0
}
}
Response Codes
Code | Description |
---|---|
200 | Payment intent created successfully |
400 | Failed to create Payment |
422 | Unprocessable entry |
500 | Internal server error |