Open documentation ↗Overview
GOV.UK Pay API (This version is no longer maintained. See openapi/publicapi_spec.json for latest API specification)
GOV.UK Pay API is a finance API from payments.service.gov.uk. Requests are authenticated with an API key. It is served over HTTPS. Its OpenAPI description documents 10 endpoints.
At a glance
- Authentication
- API key
- HTTPS
- Yes
- CORS
- Unknown
- Category
- Finance
- Base URL
https://publicapi.payments.service.gov.uk- Version
- 1.0.3
- Endpoints
- 10
- OpenAPI
- Specification ↗
- Spec updated
- 2023-03-06
Make a first request
Replace the placeholders; the documentation says exactly where credentials go.
curl -X GET "https://publicapi.payments.service.gov.uk/v1/payments" \
-H "Accept: application/json" \
-H "X-API-Key: YOUR_API_KEY"const response = await fetch("https://publicapi.payments.service.gov.uk/v1/payments", {
method: "GET",
headers: {
"Accept": "application/json",
"X-API-Key": "YOUR_API_KEY",
},
});
const data = await response.json();
console.log(data);import requests
response = requests.request(
"GET",
"https://publicapi.payments.service.gov.uk/v1/payments",
headers={
"Accept": "application/json",
"X-API-Key": "YOUR_API_KEY",
},
timeout=30,
)
print(response.json())Endpoints
| Method | Path | What it does |
|---|---|---|
| GET | /v1/payments | Search payments |
| POST | /v1/payments | Create new payment |
| GET | /v1/payments/{paymentId} | Find payment by ID |
| POST | /v1/payments/{paymentId}/cancel | Cancel payment |
| POST | /v1/payments/{paymentId}/capture | Capture payment |
| GET | /v1/payments/{paymentId}/events | Return payment events by ID |
| GET | /v1/payments/{paymentId}/refunds | Get all refunds for a payment |
| POST | /v1/payments/{paymentId}/refunds | Submit a refund for a payment |
| GET | /v1/payments/{paymentId}/refunds/{refundId} | Find payment refund by ID |
| GET | /v1/refunds | Search refunds |
Questions
Does the GOV.UK Pay API API need an API key?
Yes. The GOV.UK Pay API API uses API key authentication; the documentation explains how to get credentials.
Does the GOV.UK Pay API API support HTTPS?
Yes, the GOV.UK Pay API API is served over HTTPS.
How many endpoints does the GOV.UK Pay API API have?
Its OpenAPI description lists 10 endpoints in version 1.0.3. All of them are shown on this page.
What are alternatives to the GOV.UK Pay API API?
Other Finance APIs include Stripe, SEC EDGAR Data, Plaid, Fed Treasury, Razorpay IFSC.
Similar finance APIs
Compare alternatives →Stripe
FinancePayment processing, subscriptions, and financial management
SEC EDGAR Data
FinanceAPI to access annual reports of public US companies
Plaid
FinanceConnect with user's bank accounts and access transaction data
Fed Treasury
FinanceU.S. Department of the Treasury Data
Razorpay IFSC
FinanceIndian Financial Systems Code (Bank Branch Codes)
Klarna
FinanceKlarna payment and shopping service
Listed from APIs.guru (CC0).