The Payment Company Logo

Documentation

Card API

Server-to-server card payment API reference for The Payment Company, including the endpoint, request fields, payload layout, and sample responses.

SectionDocumentation
Topics05
Pathindex

API Endpoint

Live APIProduction environment
POSThttps://api.thepayment.company/api/v1/live/card
Test APISandbox environment
POSThttps://api.thepayment.company/api/v1/test/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
card_numberStringCredit or debit card numberYes
card_expiry_monthStringCard expiry month in MM formatYes
card_expiry_yearStringCard expiry year in YYYY formatYes
card_cvvStringCard CVV or security codeYes
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 selecting 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",
"card_number": "4111111111111111",
"card_expiry_month": "12",
"card_expiry_year": "2027",
"card_cvv": "029",
"redirect_url": "https://thepayment.company",
"webhook_url": "https://thepayment.company/webhook",
"order_id": "12524AGSDF34DS"
}

Sample Responses

{
"status": "SUCCESS",
"message": "Transaction processed successfully!.",
"data": {
  "amount": 100,
  "currency": "GBP",
  "order_id": 1234ABC345,
  "transaction_id": "TPC8597508673693621",
  "customer": {
    "first_name": "James",
    "last_name": "Dean",
    "email": "james@gmail.com"
  },
  "refund": {
    "status": false,
    "refund_date": null
  },
  "chargeback": {
    "status": false,
    "chargeback_date": null
  },
  "is_card_WL": false,
  "descriptor": "The Payment Company"
}
}

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