preloader

Create a Payment

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 an order or subscription depending upon program configuration. It will charge the order immediately if set to do so in the payment program. 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.

You can see all the available REST methods via our Swagger at rest.policypay.io or uat-rest.policypay.io


User Credentials


Email: ***

Password: ***

Public Key: ***

Secret Key: ***


Swagger API Endpoint Definitions


Once logged in with your given credentials, navigate to /payments /payment/create.

Selecting Try it out will bring up the request body for your API endpoint definitions. Once filled in completely, selecting Execute will run the API.

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
accountNumber Number Yes *******
uniqueNumber String Yes
itemName String Yes
orig_amount Number Yes
name String Yes
address1 String Yes
address2 String Yes
city String Yes
state String Yes
zip String Yes
email String Yes
phone String Yes
programId String Yes
paymentMethod String Yes
nameOnCard String Yes
cardNumber String Yes
expiry String Yes
cvv String Yes
accHolder String Yes
bankAccount String Yes
routingNumber String Yes
bankName String Yes
accountType String Yes
checkNo String Yes
abbr String Yes
extra Object Yes
createLoan Boolean Yes
restLoanPayload Object Yes
autoPay Boolean Yes
installmentDueDate String Yes
finProAgency Object Yes
searchCode String Yes
name String Yes
phone String Yes
email String Yes
address1 String Yes
address2 String Yes
city String Yes
state String Yes
zip String Yes
policies Array Yes
policyEffDate String Yes
policyNo String Yes
coverageType String Yes
premium Number Yes
fees Number Yes
taxes Number Yes
brokerFee Number Yes
inspectionFee Number Yes
insuranceCompany.searchCode String Yes
insuranceCompany.name String Yes
insuranceCompany.phone String Yes
insuranceCompany.email String Yes
insuranceCompany.address1 String Yes
insuranceCompany.address2 String Yes
insuranceCompany.city String Yes
insuranceCompany.state String Yes
insuranceCompany.zip String Yes
generalAgency Object Yes
searchCode String Yes
name String Yes
phone String Yes
phone String Yes
email String Yes
address1 String Yes
address2 String Yes
city String Yes
state String Yes
zip String Yes
broker Object Yes
searchCode String Yes
name String Yes
phone String Yes
phone String Yes
email String Yes
address1 String Yes
address2 String Yes
city String Yes
state String Yes
zip String Yes

Postman API Link


An alternate way of using our API is with your given Postman link. The link will take you to your already configured endpoint for you to fill out. In the Body section on Postman, you will find your configured endpoints. Once filled, selecting Send will execute the API call.

Congratulations! You have successfully created your payment.


Sample JSON Payload


{
  "accountNumber": 0,
  "uniqueNumber": "string",
  "itemName": "string",
  "orig_amount": 0,
  "name": "string",
  "address1": "string",
  "address2": "string",
  "city": "string",
  "state": "string",
  "zip": "string",
  "email": "string",
  "phone": "string",
  "programId": "string",
  "paymentMethod": "credit card",
  "nameOnCard": "string",
  "cardNumber": "string",
  "expiry": "string",
  "cvv": "string",
  "accHolder": "string",
  "bankAccount": "string",
  "routingNumber": "string",
  "bankName": "string",
  "accountType": "checking",
  "checkNo": "string",
  "abbr": "string",
  "extra": {},
  "createLoan": false,
  "restLoanPayload": {
    "autoPay": false,
    "installmentDueDate": "2023-11-29",
    "finProAgency": {
      "searchCode": "string",
      "name": "string",
      "phone": "string",
      "email": "string",
      "address1": "string",
      "address2": "string",
      "city": "string",
      "state": "string",
      "zip": "string"
    },
    "policies": [
      {
        "policyEffDate": "2023-11-29",
        "policyNo": "string",
        "coverageType": "string",
        "premium": 0,
        "fees": 0,
        "taxes": 0,
        "brokerFee": 0,
        "inspectionFee": 0,
        "insuranceCompany": {
          "searchCode": "string",
          "name": "string",
          "phone": "string",
          "email": "string",
          "address1": "string",
          "address2": "string",
          "city": "string",
          "state": "string",
          "zip": "string"
        },
        "generalAgency": {
          "searchCode": "string",
          "name": "string",
          "phone": "string",
          "email": "string",
          "address1": "string",
          "address2": "string",
          "city": "string",
          "state": "string",
          "zip": "string"
        },
        "broker": {
          "searchCode": "string",
          "name": "string",
          "phone": "string",
          "email": "string",
          "address1": "string",
          "address2": "string",
          "city": "string",
          "state": "string",
          "zip": "string"
        }
      }
    ]
  }
}

Sample JSON Response


{
  "status": "success",
  "message": "string",
  "order": {
    "status": "Pending",
    "paymentMethod": "credit card",
    "uniqueNumber": "string",
    "amount": 0,
    "fee": 0,
    "orig_amount": 0,
    "billingInfo": {
      "name": "string",
      "phone": "string",
      "email": "string",
      "address1": "string",
      "address2": "string",
      "zip": "string",
      "city": "string",
      "state": "string"
    },
    "itemInfo": {
      "name": "string",
      "description": "string"
    },
    "extra": {
      "company_name": "string"
    }
  }
}

Response Codes


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

Still Didn’t Find Your Answer?

Please send us a support ticket through the link below.

Submit a ticket