Getting started
Step 1. Obtain your sandbox credentials
To interact with our Gateway API you will first need the credentials (client id and secret) supplied to you by the Paytently team.
If you do not have these credentials yet please reach out to our team: integration@paytently.com
Step 2. Exchange your credentials for a token
Make a POST request to our /auth/token endpoint to generate a token which can be used to perform requests to our Gateway API.
This request uses the x-www-form-urlencoded header content type. This is different to all our other APIs.
POST https://sandbox.api.paytently.io/auth/token
curl --location 'https://sandbox.api.paytently.io/auth/token' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'audience=https://sandbox.api.paytently.io' \
--data-urlencode 'grant_type=client_credentials' \
--data-urlencode 'client_id=your-client-id' \
--data-urlencode 'client_secret=your-client-secret' \
Step 3. Use this token to make a test payment
POST https://sandbox.api.paytently.io/payments
Authorization: Bearer your-jwt-access-token
During onboarding we will provide a route that needs to be included in all payment requests in the route.id property. This id determines the specific route to an acquirer that a transaction will take.
curl --location 'https://sandbox.api.paytently.io/payments'
--header 'Content-Type: application/json'
--header 'Authorization: Bearer token_here'
--data-raw '{
"reference": "ord12345",
"amount": 100,
"currency": "EUR",
"route": {
"id": "rou_12345"
},
"customer": {
"first_name": "Joe",
"last_name": "Bloggs",
"birth_date": "2001-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": "25",
"expiry_month": "06",
"name_on_card": "B Geldof"
}
},
"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"
},
"webhook": "https://example.com/paytently/webhooks"
},
"metadata": {
"key": "value"
}
}'
Step 4. Confirm successful response
You should receive a 202 reponse to your test payment.
{
"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"
}
}
}
Step 5. Next steps
Once you have made your first test payment you may find the following pages helpful to continue your integration: