preloader

Create a Loan Checkout

Explore a full, working code sample of a loan integration with our API. This documentation will outline the basic steps of creating a loan with refresh payments 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 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/loan/checkout or uat-rest.policypay.io/loan/checkout.


User Credentials


Email: ***

Password: ***

Public Key: ***

Secret Key: ***


URL: /loan/checkout

Your API endpoint definitions will vary and be custom for your specific needs. The following is an example.

Variable Type Required Notes
loanId String Yes *******
paymentId String Yes Id of payment
amount String Yes Loan amount
paymentMethod String Yes Method of payment
nameOnCard String Yes Name of applicant on credit card
expiry String Yes Expiration date of card
cvv String Yes CVV code
accHolder String Yes Holder of account
bankAccount String Yes Bank account number
routingNumber String Yes Routing account number
bankName String Yes Name of bank
accountType String Yes Type of bank account
checkNo String Yes Checking number

Sample JSON Payload


Your unique loanId is required.

{
  "loanId": "string",
  "paymentId": "string",
  "amount": 0,
  "paymentMethod": "credit card",
  "nameOnCard": "string",
  "cardNumber": "string",
  "expiry": "string",
  "cvv": "string",
  "accHolder": "string",
  "bankAccount": "string",
  "routingNumber": "string",
  "bankName": "string",
  "accountType": "checking",
  "checkNo": "string"
}

Sample JSON Response


{
  "status": "success",
  "message": "string",
  "order": {
    "loanRef": "string",
    "orderRef": "string",
    "orderStatus": "string",
    "paymentId": "string",
    "loanId": "string"
  }
}

Response Codes


Code Description
200 Loan created successfully
400 Failed to create loan
422 Unprocessable entry
500 Internal server error