Service

GOV.UK Pay API

GOV.UK Pay API (This version is no longer maintained. See openapi/publicapi_spec.json for latest API specification)

Government & public#openapi#financial

Fork copies the collection into your workspace, without the publisher's secrets, so you can add your own key and send requests. Star saves it to your starred APIs (Account › Marketplace) and helps others find it.

Overview

GOV.UK Pay API (This version is no longer maintained. See openapi/publicapi_spec.json for latest API specification)

Endpoints 10

Card payments

  • GETSearch payments/v1/payments?reference=string&email=string&state=created&card_brand=string&from_date=string&to_date=string&page=string&display_size=string&cardholder_name=string&first_digits_card_number=string&last_digits_card_number=string&from_settled_date=string&to_settled_date=stringSearch payments by reference, state, 'from' and 'to' date. The Authorisation token needs to be specified in the 'authorization' header as 'authorization:…
  • POSTCreate new payment/v1/paymentsCreate a new payment for the account associated to the Authorisation token. The Authorisation token needs to be specified in the 'authorization' header as…
  • GETFind payment by ID/v1/payments/:paymentIdReturn information about the payment The Authorisation token needs to be specified in the 'authorization' header as 'authorization: Bearer YOUR_API_KEY_HERE'
  • POSTCancel payment/v1/payments/:paymentId/cancelCancel a payment based on the provided payment ID and the Authorisation token. The Authorisation token needs to be specified in the 'authorization' header as…
  • POSTCapture payment/v1/payments/:paymentId/captureCapture a payment based on the provided payment ID and the Authorisation token. The Authorisation token needs to be specified in the 'authorization' header as…
  • GETReturn payment events by ID/v1/payments/:paymentId/eventsReturn payment events information about a certain payment The Authorisation token needs to be specified in the 'authorization' header as 'authorization:…

Refunding card payments

  • GETGet all refunds for a payment/v1/payments/:paymentId/refundsReturn refunds for a payment. The Authorisation token needs to be specified in the 'authorization' header as 'authorization: Bearer YOUR_API_KEY_HERE'
  • POSTSubmit a refund for a payment/v1/payments/:paymentId/refundsReturn issued refund information. The Authorisation token needs to be specified in the 'authorization' header as 'authorization: Bearer YOUR_API_KEY_HERE'
  • GETFind payment refund by ID/v1/payments/:paymentId/refunds/:refundIdReturn payment refund information by Refund ID The Authorisation token needs to be specified in the 'authorization' header as 'authorization: Bearer…
  • GETSearch refunds/v1/refunds?from_date=string&to_date=string&from_settled_date=string&to_settled_date=string&page=string&display_size=stringSearch refunds by 'from' and 'to' date. The Authorisation token needs to be specified in the 'authorization' header as 'authorization: Bearer YOUR_API_KEY_HERE'

API details

Base URL
https://publicapi.payments.service.gov.uk
Authentication
An API key in the Authorization header
Operations
10 operations on 8 pathsGET 6POST 4
Main resources
Card payments 6Refunding card payments 4
Description format
Swagger 2.0, API version 1.0.3
Listed from
APIs.guru OpenAPI Directory (CC0-1.0)
Source updated

How to test the GOV.UK Pay API in Swastik Codes

  1. Open the APISelect “Fork & run in Swastik Codes” on this page. Sign in or create a free account if asked.
  2. Fork it into your workspaceChoose a workspace. You get your own copy of the GOV.UK Pay API collection, without the publisher's secrets.
  3. Add your credentialsThis API uses an API key in the Authorization header. Add yours in the collection's variables or an environment; the requests already reference it.
  4. Send a requestPick an endpoint, for example “Search payments” (GET /v1/payments?reference=string&email=string&state=created&card_brand=string&from_date=string&to_date=string&page=string&display_size=string&cardholder_name=string&first_digits_card_number=string&last_digits_card_number=string&from_settled_date=string&to_settled_date=string), and press Send. Check the response, add tests and run the whole collection with the runner.

Frequently asked questions

What is the GOV.UK Pay API?

GOV.UK Pay API (This version is no longer maintained. See openapi/publicapi_spec.json for latest API specification) It is listed under Government & public and has 10 endpoints.

Who publishes the GOV.UK Pay API?

It is listed from Service's public API description (an OpenAPI document), not published by Service on Swastik Codes. Anyone who controls payments.service.gov.uk can claim the profile by adding a DNS TXT record.

What is the base URL of the GOV.UK Pay API?

Requests go to https://publicapi.payments.service.gov.uk. Endpoint paths are added to this base URL.

How do I authenticate with the GOV.UK Pay API?

With an API key in the Authorization header.

How many endpoints does the GOV.UK Pay API have?

10 operations on 8 paths (6 GET, 4 POST). The largest groups are Card payments, Refunding card payments.

Is forking the GOV.UK Pay API free?

Yes. Forking copies the collection into your workspace for free. It has been starred 0 times and forked 0 times.

Suggest an API

Tell us which public API is missing. We check it, then add it here with its endpoints when it has an OpenAPI (Swagger) description.