Get information about a single payment
GET/v1/payments/{paymentId}
You can use this endpoint to get details about a single payment you’ve previously created.
Requires a bearer token.
In this mock: Returns the stored payment. State changes only through cancel, capture and POST /v1/auth.
Path parameters
| Name | Type | Description |
|---|---|---|
paymentIdrequired |
string | Returns the payment with the matching payment_id. |
Example request
curl -X GET "https://publicapi.payments.platform-engineering.com/v1/payments/{paymentId}" \
-H "Authorization: Bearer $TOKEN"
Responses
200: OK - your request was successful.
| Name | Type | Description |
|---|---|---|
_links |
object | links for payment |
_links.auth_url_post |
object | A POST link related to a payment |
_links.auth_url_post.href |
string | A URL that lets you perform additional actions to this payment when combined with the associated method. |
_links.auth_url_post.method |
string | |
_links.auth_url_post.params |
map | |
_links.auth_url_post.type |
string | |
_links.cancel |
object | A POST link related to a payment |
_links.cancel.href |
string | A URL that lets you perform additional actions to this payment when combined with the associated method. |
_links.cancel.method |
string | |
_links.cancel.params |
map | |
_links.cancel.type |
string | |
_links.capture |
object | A POST link related to a payment |
_links.capture.href |
string | A URL that lets you perform additional actions to this payment when combined with the associated method. |
_links.capture.method |
string | |
_links.capture.params |
map | |
_links.capture.type |
string | |
_links.events |
object | A link related to a payment |
_links.events.href |
string | A URL that lets you perform additional actions to this payment when combined with the associated method. |
_links.events.method |
string | An API method that lets you perform additional actions to this paymentwhen combined with the associated href. |
_links.next_url |
object | A link related to a payment |
_links.next_url.href |
string | A URL that lets you perform additional actions to this payment when combined with the associated method. |
_links.next_url.method |
string | An API method that lets you perform additional actions to this paymentwhen combined with the associated href. |
_links.next_url_post |
object | A POST link related to a payment |
_links.next_url_post.href |
string | A URL that lets you perform additional actions to this payment when combined with the associated method. |
_links.next_url_post.method |
string | |
_links.next_url_post.params |
map | |
_links.next_url_post.type |
string | |
_links.refunds |
object | A link related to a payment |
_links.refunds.href |
string | A URL that lets you perform additional actions to this payment when combined with the associated method. |
_links.refunds.method |
string | An API method that lets you perform additional actions to this paymentwhen combined with the associated href. |
_links.self |
object | A link related to a payment |
_links.self.href |
string | A URL that lets you perform additional actions to this payment when combined with the associated method. |
_links.self.method |
string | An API method that lets you perform additional actions to this paymentwhen combined with the associated href. |
agreement_payment_type |
string | When the customer initiates a standing order agreement transaction we have to include a customerInitiatedReason attribute. This can have a value of instalment, recurring, or unscheduled.One of: instalment, recurring, unscheduled |
amount |
integer | The description assigned to the payment when it was created. |
authorisation_mode |
string | How the payment will be authorised. Payments created in web mode require the paying user to visit the next_url to complete the payment.One of: web, moto_api, external |
authorisation_summary |
object | Object containing information about the authentication of the payment. |
authorisation_summary.three_d_secure |
object | Object containing information about the 3D Secure authentication of the payment. |
authorisation_summary.three_d_secure.required |
boolean | Indicates if this payment was authorised with 3D Secure authentication. required is true if the payment required 3D Secure authentication. |
card_brand |
string | This attribute is deprecated. Please use card_details.card_brand instead. |
card_details |
object | A structure representing the payment card |
card_details.billing_address |
object | A structure representing the billing address of a card |
card_details.billing_address.city |
string | The paying user's city. |
card_details.billing_address.country |
string | The paying user’s country, displayed as a 2-character ISO-3166-1-alpha-2 code. |
card_details.billing_address.line1 |
string | The first line of the paying user’s address. |
card_details.billing_address.line2 |
string | The second line of the paying user’s address. |
card_details.billing_address.postcode |
string | The paying user's postcode. |
card_details.card_brand |
string | The brand of card the user paid with. |
card_details.card_type |
string | The type of card the user paid with.null means your user paid with Google Pay or we did not recognise which type of card they paid with.One of: debit, credit, null |
card_details.cardholder_name |
string | |
card_details.expiry_date |
string | The expiry date of the card the user paid with in MM/YY format. |
card_details.first_digits_card_number |
string | |
card_details.last_digits_card_number |
string | |
card_details.wallet_type |
string | The digital wallet type that the user paid with One of: Apple Pay, Google Pay |
corporate_card_surcharge |
integer | The corporate card surcharge amount in pence. |
created_date |
string | |
delayed_capture |
boolean | delayed_capture is true if you’re controlling how long it takes GOV.UK Pay to take (‘capture’) a payment. |
description |
string | The description assigned to the payment when it was created. |
email |
string | |
exemption |
object | A structure representing that 3DS exemption was requested and the outcome of the exemption, if applicable. |
exemption.outcome |
object | A structure representing the outcome of a 3DS exemption, if known. |
exemption.outcome.result |
string | The outcome of the requested exemption |
exemption.requested |
boolean | Indicates whether an exemption was requested for the given payment. |
exemption.type |
string | Indicates the type of exemption. Only present for corporate exemption |
fee |
integer | The payment service provider’s (PSP) transaction fee, in pence. fee only appears when we have taken (‘captured’) the payment from the user or if their payment fails after they submitted their card details. fee will not appear if your PSP is Worldpay or you are using an API key from a test service. |
language |
string | The ISO-6391 Alpha-2 code of the language of the user's payment page. One of: en, cy |
metadata |
object | |
metadata.metadata |
map | |
moto |
boolean | Indicates if this payment is a Mail Order / Telephone Order (MOTO) payment. |
net_amount |
integer | The amount, in pence, that will be paid into your bank account after your payment service provider takes the fee. |
payment_id |
string | The unique ID GOV.UK Pay automatically associated with this payment when you created it. |
payment_provider |
string | The payment service provider that processed this payment. |
provider_id |
string | The unique ID your payment service provider generated for this payment. This is not the same as the payment_id. |
reference |
string | The reference associated with the payment when it was created. reference is not unique - multiple payments can have the same reference value. |
refund_summary |
object | A structure representing the refunds availability |
refund_summary.amount_available |
integer | How much you can refund to the user, in pence. |
refund_summary.amount_submitted |
integer | How much you’ve already refunded to the user, in pence. |
refund_summary.status |
string | Whether you can refund the payment. |
return_url |
string | The URL you direct the paying user to after their payment journey on GOV.UK Pay ends. |
settlement_summary |
object | A structure representing information about a settlement |
settlement_summary.capture_submit_time |
string | The date and time GOV.UK Pay asked your payment service provider to take the payment from your user’s account. This value uses Coordinated Universal Time (UTC) and ISO 8601 format - YYYY-MM-DDThh:mm:ss.SSSZ |
settlement_summary.captured_date |
string | The date your payment service provider took the payment from your user. This value uses ISO 8601 format - YYYY-MM-DD |
settlement_summary.settled_date |
string | The date that the transaction was paid into the service's account. |
state |
object | A structure representing the current state of the payment in its lifecycle. |
state.can_retry |
boolean | If can_retry is true, you can use this agreement to try to take another recurring payment. If can_retry is false, you cannot take another recurring payment with this agreement. can_retry only appears on failed payments that were attempted using an agreement for recurring payments. |
state.code |
string | An API error codethat explains why the payment failed. code only appears if the payment failed. |
state.finished |
boolean | Indicates whether a payment journey is finished. |
state.message |
string | A description of what went wrong with this payment. message only appears if the payment failed. |
state.status |
string | Where the payment is in the payment status lifecycle. |
total_amount |
integer | Amount your user paid in pence, including corporate card fees. total_amount only appears if you added a corporate card surcharge to the payment. |
{
"_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"
}
},
"agreement_payment_type": "instalment",
"amount": 1200,
"authorisation_mode": "web",
"authorisation_summary": {
"three_d_secure": {}
},
"card_brand": "Visa",
"card_details": {
"billing_address": {
"city": "address city",
"country": "GB",
"line1": "address line 1",
"line2": "address line 2",
"postcode": "AB1 2CD"
},
"card_brand": "Visa",
"card_type": "debit",
"cardholder_name": "Mr. Card holder",
"expiry_date": "04/24",
"first_digits_card_number": "123456",
"last_digits_card_number": "1234",
"wallet_type": "Apple Pay"
},
"corporate_card_surcharge": 250,
"created_date": "2016-01-21T17:15:00.000Z",
"delayed_capture": false,
"description": "Your Service Description",
"email": "The paying user’s email address.",
"exemption": {
"outcome": {
"result": "honoured"
},
"requested": true,
"type": "corporate"
},
"fee": 5,
"language": "en",
"metadata": {
"ledger_code": "AB100"
},
"moto": false,
"net_amount": 1195,
"payment_id": "hu20sqlact5260q2nanm0q8u93",
"payment_provider": "worldpay",
"provider_id": "reference-from-payment-gateway",
"reference": "your-reference",
"refund_summary": {
"amount_available": 100,
"status": "available"
},
"return_url": "http://your.service.domain/your-reference",
"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"
},
"total_amount": 1450
}
401: Your API key is missing or invalid. Read more about [authenticating GOV.UK Pay API requests](https://docs.payments.service.gov.uk/api_reference/#authentication)
404: Not found
| Name | Type | Description |
|---|---|---|
code |
string | An API error codethat explains why the payment failed.<br><br>code only appears if the payment failed. |
description |
string | Additional details about the error. |
field |
string | The parameter in your request that's causing the error. |
header |
string | The header in your request that's causing the error. |
{
"code": "P0102",
"description": "Invalid attribute value: amount. Must be less than or equal to 10000000",
"field": "amount",
"header": "Idempotency-Key"
}
429: Too many requests
| Name | Type | Description |
|---|---|---|
code |
string | A GOV.UK Pay API error code. You can find out more about this code in our documentation. |
description |
string | Additional details about the error |
{
"code": "P0900",
"description": "Too many requests"
}
500: Downstream system error
| Name | Type | Description |
|---|---|---|
code |
string | An API error codethat explains why the payment failed.<br><br>code only appears if the payment failed. |
description |
string | Additional details about the error. |
field |
string | The parameter in your request that's causing the error. |
header |
string | The header in your request that's causing the error. |
{
"code": "P0102",
"description": "Invalid attribute value: amount. Must be less than or equal to 10000000",
"field": "amount",
"header": "Idempotency-Key"
}