GOV.UK Pay integration
GOV.UK Pay is the UK government's payment platform for public sector services. Create card payments and send the paying user to the hosted payment page, read a payment's status and event history, cancel a payment that is still in progress, capture a delayed payment, issue full or partial refunds, search payments, refunds and disputes, and set up and charge recurring-payment agreements. Sending raw card details to authorise a MOTO payment is not exposed, so a payment created in moto_api mode cannot be completed from here. Authentication is a GOV.UK Pay API key, created in the GOV.UK Pay admin tool for one service and one environment (test keys only take test payments), sent as a Bearer token.
Say what should happen.
The workflow builds itself.
What you can do with GOV.UK Pay
Each of these is one operation on one endpoint, available both as a workflow step and as a tool an AI agent can call on its own. Nothing bundles several operations into one action, so what a run did stays readable afterwards.
Most endpoints run on the free plan. A few, mainly the ones that publish on your behalf, need a paid plan.
Refund, 4 operations
create_refundCreate refundPOSTRefunds all or part of a successful payment, in pence. Read refund_summary.amount_available from get_payment first and send it as refund_amount_available, so the refund is refused if the amount available has changed since.get_refundGet refundGETReturns one refund of a payment: its amount in pence, status (submitted, success or error), creation date and, for Stripe accounts, its settlement date.list_payment_refundsList payment refundsGETLists the refunds issued for one payment, each with its refund_id, amount in pence, status (submitted, success or error) and creation date.search_refundsSearch refundsGETSearches the refunds of this service, newest first, filtered by creation date or settlement date. Results are paginated (page, display_size up to 500) and eventually consistent.
Agreement, 3 operations
create_agreementCreate agreementPOSTCreates an agreement for recurring payments and returns its agreement_id with status created.get_agreementGet agreementGETReturns one recurring-payment agreement: its status (created, active, cancelled or inactive; only an active agreement can be charged), reference, description, user identifier and the payment instrument (card) saved on it.search_agreementsSearch agreementsGETSearches the recurring-payment agreements of this service, newest first, optionally filtered by reference or status. Results are paginated with page and display_size (at most 500 per page).
Payment, 3 operations
create_paymentCreate paymentPOSTCreates a card payment and returns its payment_id and _links.next_url, the GOV.UK Pay page to send the paying user to (share it with that user only). A standard payment needs amount (in pence), description, reference and return_url.get_paymentGet paymentGETReturns one payment as it is now: amount, state (status such as created, started, submitted, capturable, success, failed, cancelled or error, plus finished, and an error code and message when it failed), card details.search_paymentsSearch paymentsGETSearches the payments created by this service, newest first, filtered by reference, email, state, card brand, cardholder name, card digits, creation or settlement dates, or agreement.
Cancel, 2 operations
cancel_agreementCancel agreementPOSTCancels a recurring-payment agreement, so no further payments can be taken with it until it is set up again with a new first payment (create_payment with set_up_agreement). Returns no body on success.cancel_paymentCancel paymentPOSTCancels a payment that is still in progress (not yet finished), so the paying user can no longer complete it. Returns no body on success; a payment already captured or cancelled is refused.
Capture, 1 operation
capture_paymentCapture paymentPOSTTakes the money for a payment created with delayed_capture, once it has reached status capturable. Returns no body on success; a payment already captured or cancelled is refused.
Dispute, 1 operation
search_disputesSearch disputesGETSearches disputes (chargebacks raised by paying users through their bank), filtered by the date the dispute was raised or settled and by status. Each result gives the disputed amount, reason, status, evidence due date and the payment it concerns.
Event, 1 operation
list_payment_eventsList payment eventsGETLists every state change of a payment in order (created, started, submitted, success and so on), each with its timestamp, which shows how far the paying user got.
Use GOV.UK Pay from Claude Code, Cursor or Codex
Connect GOV.UK Pay in LiveContext, create an API key in Settings, then add the LiveContext MCP server to your client. Its GOV.UK Pay operations become tools the client can call, next to every other integration you connected.
claude mcp add --transport http livecontext https://livecontext.ai/mcp --header "X-API-Key: YOUR_API_KEY"[mcp_servers.livecontext]
url = "https://livecontext.ai/mcp"
[mcp_servers.livecontext.http_headers]
"X-API-Key" = "YOUR_API_KEY"{
"mcpServers": {
"livecontext": {
"type": "http",
"url": "https://livecontext.ai/mcp",
"headers": {
"X-API-Key": "YOUR_API_KEY"
}
}
}
}How to connect GOV.UK Pay
- Create your workspace
Sign up free. Nothing to install.
- Connect GOV.UK Pay once
Add your GOV.UK Pay connection in Settings. Every tool from this integration reuses it, and secrets are encrypted at rest and visible only to you.
- Describe the job in chat
The workflow builds itself in front of you and picks the endpoints it needs. Drag the steps yourself on the canvas whenever you would rather be explicit.
GOV.UK Pay integration FAQ
What can you do with the GOV.UK Pay integration?
LiveContext exposes 15 operations on GOV.UK Pay, covering refund, agreement, payment and cancel.
