Card payments
Create a payment
You can use this endpoint to create a new payment.
post/v1/payments
Headers
Idempotency-Keystring
Request body
Example request
{
"agreement_id": "abcefghjklmnopqr1234567890",
"amount": 12000,
"description": "New passport application",
"email": "Joe.Bogs@example.org",
"language": "en",
"prefilled_cardholder_details": {
"billing_address": {
"city": "address city",
"country": "GB",
"line1": "address line 1",
"line2": "address line 2",
"postcode": "AB1 2CD"
},
"cardholder_name": "J. Bogs"
},
"reference": "12345",
"return_url": "https://service-name.gov.uk/transactions/12345",
"set_up_agreement": "abcefghjklmnopqr1234567890"
}Response
Created
Example response
{
"_links": {
"auth_url_post": {
"href": "https://an.example.link/from/payment/platform",
"method": "POST",
"params": {
"description": "This is a value for a parameter called description"
},
"type": "application/x-www-form-urlencoded"
},
"cancel": {
"href": "https://an.example.link/from/payment/platform",
"method": "POST",
"params": {
"description": "This is a value for a parameter called description"
},
"type": "application/x-www-form-urlencoded"
},
"capture": {
"href": "https://an.example.link/from/payment/platform",
"method": "POST",
"params": {
"description": "This is a value for a parameter called description"
},
"type": "application/x-www-form-urlencoded"
},
"events": {
"href": "https://an.example.link/from/payment/platform",
"method": "GET"
},
"next_url": {
"href": "https://an.example.link/from/payment/platform",
"method": "GET"
},
"next_url_post": {
"href": "https://an.example.link/from/payment/platform",
"method": "POST",
"params": {
"description": "This is a value for a parameter called description"
},
"type": "application/x-www-form-urlencoded"
},
"refunds": {
"href": "https://an.example.link/from/payment/platform",
"method": "GET"
},
"self": {
"href": "https://an.example.link/from/payment/platform",
"method": "GET"
}
},
"amount": 1200,
"card_details": {
"billing_address": {
"city": "address city",
"country": "GB",
"line1": "address line 1",
"line2": "address line 2",
"postcode": "AB1 2CD"
}
},
"created_date": "2016-01-21T17:15:00.000Z",
"description": "New passport application",
"email": "citizen@example.org",
"language": "en",
"payment_id": "hu20sqlact5260q2nanm0q8u93",
"payment_provider": "worldpay",
"provider_id": "null",
"reference": "12345",
"refund_summary": {
"amount_available": 100,
"status": "available"
},
"return_url": "https://service-name.gov.uk/transactions/12345",
"settlement_summary": {
"capture_submit_time": "2016-01-21T17:15:00.000Z",
"captured_date": "2016-01-21",
"settled_date": "2016-01-21"
},
"state": {
"code": "P010",
"message": "User cancelled the payment",
"status": "created"
}
}