Delay taking a payment
You can control how long it takes GOV.UK Pay to take (‘capture’) a payment from your user’s bank account after your payment service provider (PSP) has authorised that payment.
You may want to use delayed capture if you need time to do your own anti-fraud checks on payments, or check that users are eligible for your service.
During the delay, your user’s available bank balance is reduced by the payment amount.
You cannot use delayed capture for:
- payments made with payment links
- recurring payments
To use this feature, include "delayed_capture": true
in the body of your request to create a new payment.
This example request creates a £50 parking fine that the service can capture at a later point because it includes the delayed_capture
parameter:
POST /v1/payments
{
"amount": 5000,
"reference" : "LE2504",
"description": "Pay a penalty charge notice (PCN)",
"return_url": "https://your.service.gov.uk/completed",
"delayed_capture": true
}
Your paying user will follow the standard payment flow. After your user selects Confirm on the Confirm your details page:
- the payment’s status will change to
capturable
- you can make a request to the
POST /v1/payments/{PAYMENT_ID}/capture
endpoint when you want to capture the delayed
You must send the delayed capture request within 120 hours (5 days) of creating the payment, regardless of when your user completes the payment flow. If you do not, the payment will expire.
If you’ve turned on payment confirmation emails, GOV.UK Pay will send a payment confirmation email to your user. We’ll send this email once we’ve received and processed your service’s capture request.
You can see definitions and possible values of every parameter and attribute for this endpoint in our API reference. You can also view possible responses to your capture request.
See the capture URL for a payment
If a payment is available for capture, you can see its capture URL in responses to API requests. For example:
GET /v1/payments
GET /v1/payments/{PAYMENT_ID}
Replace {PAYMENT_ID}
with the ID of the payment you want to see the capture URL for.
The _links
object will contain:
"capture": {
"href": "https://publicapi.payments.service.gov.uk/v1/payments/{PAYMENT_ID}/capture",
"method": "POST"
}
If the payment is not available for capture, the _links
object will not contain a capture
object.