The Payment Company Logo

HostedApi

Hosted Checkout API

Hosted payment page API reference for The Payment Company, including the endpoint, request fields, payload details, and sample responses.

SectionHostedApi
Topics05
PathhostedApi

API Endpoint

Live APIProduction environment
POSThttps://api.thepayment.company/api/v1/live/hosted/card
Test APISandbox environment
POSThttps://api.thepayment.company/api/v1/test/hosted/card

Request Fields

ParameterTypeDescriptionRequired
first_nameStringGiven name of the cardholderYes
last_nameStringFamily name of the cardholderYes
emailStringCustomer email addressYes
addressStringBilling street addressYes
countryStringCountry code in ISO 3166-1 alpha-3 formatYes
cityStringCardholder cityYes
stateStringCardholder state or regionYes
zipStringZIP or postal codeYes
ip_addressStringCustomer IP addressYes
phone_numberStringCardholder phone numberYes
amountNumberPayment amount in the smallest currency unitYes
currencyStringCurrency code in ISO 4217 formatYes
redirect_urlStringURL where the customer is sent after paymentYes
webhook_urlStringURL used for server-to-server webhook updatesNO
order_idStringMerchant-side unique order referenceNO
terminal_idStringUnique connector terminal ID, useful when choosing a primary or fallback connectorNO

Payload

Send the request payload as JSON. The sample structure is shown below:

{
"first_name": "James",
"last_name": "Dean",
"email": "james@gmail.com",
"address": "64 Hertingfordbury Rd",
"country": "GB",
"city": "Newport",
"state": "GB",
"zip": "TF10 8DF",
"ip_address": "127.0.0.1",
"phone_number": "7654233212",
"amount": 100,
"currency": "GBP",
"redirect_url": "https://thepayment.company",
"webhook_url": "https://thepayment.company/webhook",
"order_id": "12524AGSDF34DS"
}

Sample Responses

{
"status": "REDIRECT",
"message": "Please redirect user to complete the payment.",
"redirect_url": "https://api.thepayment.company/api/v1/test/card/hosted/TPC0186280974141637",
"data": {
  "amount": 100,
  "currency": "GBP",
  "order_id": null,
  "transaction_id": "TPC0186280974141637",
  "customer": {
    "first_name": "James",
    "last_name": "Dean",
    "email": "james@gmail.com"
  },
  "refund": {
    "status": false,
    "refund_date": null
  },
  "chargeback": {
    "status": false,
    "chargeback_date": null
  }
}
}

Integration Notes

Encrypted payment APIs must use AES-256-CBC before transmitting sensitive fields. Authentication, headers, encryption steps, and sample implementations for Node.js, PHP, Python, and Java are documented in Integration Examples.

On this page