Make a card payment
Payment requests can be made through our Gateway API. Payments requests are asynchronous so in response to a successful payment request you will receive a pending status, a payment id and an 'authorize' URL where you can redirect the end user to complete any required authorization step. You will then receive notifications of events relating to this payment through webhooks or by calling our GET endpoint.
Depending on your PCI-DSS compliance status you can either use our Server-to-server flow or Hosted forms solution.
Routes will be set up for you so you can direct your payments to specific acquirers as you see fit.
If you don't want to use our intelligent transaction routing engine you can include the id of the specific route you wish to use in the route.id property.
The current functionality of our payment processing is straight-sale only, meaning all payment requests will be auto-captured.
Payment amounts are in minor units, for example a payment for €1.20 should be sent as 120.
Details on required fields and validation can be found in our Open API specification.
- Production
- Sandbox
POST https://api.paytently.io/payments
POST https://sandbox.api.paytently.io/payments
Request:
- Server-to-server
- Hosted forms
curl --location 'https://sandbox.api.paytently.io/payments'
--header 'Content-Type: application/json'
--header 'Authorization: Bearer token_here'
--data-raw '{
"reference": "ord123",
"amount": 100,
"currency": "EUR",
"customer": {
"id": "customer123",
"first_name": "Joe",
"last_name": "Bloggs",
"birth_date": "1991-06-03",
"nationality": "GBR",
"contact": {
"phone": {
"country_code": "44",
"number": "07700900123"
},
"email": "email@example.com"
}
},
"method": {
"type": "card",
"card": {
"number": "4543059999999982",
"cvv": "110",
"expiry_year": "28",
"expiry_month": "06",
"name_on_card": "J Bloggs"
}
},
"billing_address": {
"line_one": "80 Queens Road",
"city": "Manchester",
"postal_code": "M63X 7TH",
"country": "GBR"
},
"device_ip_address": "123.123.123.123",
"aft": {
"number": "ab1cd234-56e7-7891-2345-6f789g1hi23j",
},
"urls": {
"authorize": {
"success": "https://success.com",
"failure": "https://failure.com"
},
"webhook": "https://example.com/paytently/webhooks",
"merchant_website": "https://example.com"
},
"route": {
"id": "rou_12345"
},
"metadata": {
"key": "value"
}
}'
curl --location 'https://sandbox.api.paytently.io/payments'
--header 'Content-Type: application/json'
--header 'Authorization: Bearer token_here'
--data-raw '{
"reference": "ord123",
"amount": 100,
"currency": "EUR",
"customer": {
"id": "customer123",
"first_name": "Joe",
"last_name": "Bloggs",
"birth_date": "2001-06-03",
"contact": {
"phone": {
"country_code": "44",
"number": "07700900123"
},
"email": "email@example.com"
}
},
"billing_address": {
"line_one": "123 Canal Street",
"city": "Manchester",
"postal_code": "M63X 7TH",
"country": "GBR"
},
"device_ip_address": "123.123.123.123",
"urls": {
"authorize": {
"success": "https://success.com",
"failure": "https://failure.com"
},
"hosted_forms": {
"success": "https://success.com",
"failure": "https://failure.com"
},
"webhook": "https://example.com/paytently/webhooks",
"merchant_website": "https://example.com"
},
"metadata": {
"key": "value"
}
}'
Response:
- Server-to-server
- Hosted forms
- 202
- 400
- 422
- 500
{
"id": "pay_12345",
"status": "pending",
"_links": {
"self": {
"href": "https://sandbox.api.paytently.io/payments/pay_12345",
"method": "GET"
},
"authorize": {
"href": "https://sandbox.payredirect.io/authorize/pay_12345",
"method": "GET"
}
}
}
{
"trace_id": "12345",
"errors": [
{
"property": "metadata",
"code": "malformed_request",
"reason": "",
"docs": "https://docs.paytently.io/api/reference"
}
]
}
{
"trace_id": "12345",
"errors": [
{
"property": "reference",
"code": "reference_invalid",
"reason": "reference must not be more than 64 characters",
"detail": "Invalid length: 70",
"docs": "https://docs.paytently.io/api/reference"
},
{
"property": "reference",
"code": "reference_invalid",
"reason": "reference must only contain letters, numbers and accepted special characters: _-",
"detail": "Invalid characters: @",
"docs": "https://docs.paytently.io/api/reference"
}
]
}
{
"title": "Server error",
"status": 500,
"trace_id": "12345"
}
- 202
- 400
- 422
- 500
{
"id": "pay_12345",
"status": "pending",
"_links": {
"hosted_forms": {
"href": "https://sandbox.api.paytently.io/hosted-forms?paymentId=pay_12345",
"method": "GET"
},
"self": {
"href": "https://sandbox.api.paytently.io/payments/pay_12345",
"method": "GET"
}
}
}
{
"trace_id": "12345",
"errors": [
{
"property": "metadata",
"code": "malformed_request",
"reason": "",
"docs": "https://docs.paytently.io/api/reference"
}
]
}
{
"trace_id": "12345",
"errors": [
{
"property": "reference",
"code": "reference_invalid",
"reason": "reference must not be more than 64 characters",
"detail": "Invalid length: 70",
"docs": "https://docs.paytently.io/api/reference"
},
{
"property": "reference",
"code": "reference_invalid",
"reason": "reference must only contain letters, numbers and accepted special characters: _-",
"detail": "Invalid characters: @",
"docs": "https://docs.paytently.io/api/reference"
}
]
}
{
"title": "Server error",
"status": 500,
"trace_id": "12345"
}