v11

latestOpenAPI 3.0.1raw.githubusercontent.com2025-07-2818719.5 KB
Products

creates a new product

post/v1/api/products

Request body

descriptionstring

Description of the product. This will be passed as the description when creating the charge

gateway_account_idstring required

gateway account id of the Gateway Account as identified by adminusers.

languagestring

The language pages for the product will be in. If not provided, defaults to 'en'. Allowed values 'en', 'cy'

metadataobject
namestring required

Name of the product. This will be passed as the name when creating the charge

pay_api_tokenstring required

valid api token for the gateway account of above service which this product takes payments for

priceinteger

Price for the product in pence. This will be passed as the amount when creating charge. Mandatory for Non-ADHOC and Non-AGENT_INITIATED_MOTO products

product_name_pathstring

Product Name Path part of Product Path. Required for Adhoc type only.

reference_enabledboolean

Flag to set whether payment reference is auto generated or entered by user. True means that user enters reference at the beginning of a user journey.

reference_hintstring

Hint text for reference entry text box. Optional field when reference enabled. Ignored if reference_enabled is set to false.

reference_labelstring

Only required if reference_enabled is true. Label for the reference entry text box.

return_urlstring

(https only) where to redirect to upon completion of a payment. If not provided, pay-products will generate a default url to itself when creating a charge

service_name_pathstring

Service Name Path part of Product Path. Required for Adhoc type only.

type'DEMO' | 'PROTOTYPE' | 'ADHOC' | 'AGENT_INITIATED_MOTO' required

Type of the product

Example request

{
  "description": "Description of the product",
  "gateway_account_id": "1",
  "language": "en",
  "name": "A name for the product",
  "pay_api_token": "api_test_5meusgv5ufclsbvde78mdf35bfdhnhm1307euq94kcf0lcqcqrovbjovib",
  "price": 1050,
  "product_name_path": "name-for-product",
  "reference_enabled": true,
  "reference_hint": "This can be found on your letter",
  "reference_label": "Amount for your licence",
  "return_url": "https://some.valid.url/",
  "service_name_path": "some-awesome-government-service",
  "type": "DEMO"
}

Response

OK

amount_hintstring
date_createdstring date-time
descriptionstring
external_idstring
gateway_account_idinteger
language'en' | 'cy'
metadataobject
namestring
pay_api_tokenstring
priceinteger
product_name_pathstring
reference_enabledboolean
reference_hintstring
reference_labelstring
require_captchaboolean
return_urlstring
service_name_pathstring
status'ACTIVE' | 'INACTIVE'
type'DEMO' | 'PROTOTYPE' | 'ADHOC' | 'AGENT_INITIATED_MOTO'

Example response

{
  "_links": [
    {
      "href": "http://products-url/v1/api/products/874h5c87834659q345698495",
      "method": "GET",
      "rel": "self"
    }
  ],
  "amount_hint": "Enter an amount in multiples of £2 for the number of permits required",
  "description": "Description of the product",
  "external_id": "874h5c87834659q345698495",
  "gateway_account_id": 1,
  "language": "en",
  "name": "A name for the product",
  "price": 1050,
  "product_name_path": "name-for-product",
  "reference_enabled": true,
  "reference_hint": "This can be found on your letter",
  "reference_label": "Amount for your licence",
  "return_url": "https://some.valid.url/",
  "service_name_path": "some-awesome-government-service",
  "status": "ACTIVE",
  "type": "DEMO"
}