{"files":{"SKILL.md":"---\nname: govuk-pay-api\ndescription: \"GOV.UK Pay API skill. Use when working with GOV.UK Pay for payments, refunds. Covers 10 endpoints.\"\nversion: 1.0.0\ngenerator: lapsh\n---\n\n# GOV.UK Pay API\nAPI version: 1.0.3\n\n## Auth\nApiKey Authorization in header\n\n## Base URL\nhttps://publicapi.payments.service.gov.uk\n\n## Setup\n1. Set your API key in the appropriate header\n2. GET /v1/payments -- search payments\n3. POST /v1/payments -- create first payment\n\n## Endpoints\n10 endpoints across 2 groups. See references/api-spec.lap for full details.\n\n### Payments\n| Method | Path | Description |\n|--------|------|-------------|\n| GET | /v1/payments | Search payments |\n| POST | /v1/payments | Create new payment |\n| GET | /v1/payments/{paymentId} | Find payment by ID |\n| POST | /v1/payments/{paymentId}/cancel | Cancel payment |\n| POST | /v1/payments/{paymentId}/capture | Capture payment |\n| GET | /v1/payments/{paymentId}/events | Return payment events by ID |\n| GET | /v1/payments/{paymentId}/refunds | Get all refunds for a payment |\n| POST | /v1/payments/{paymentId}/refunds | Submit a refund for a payment |\n| GET | /v1/payments/{paymentId}/refunds/{refundId} | Find payment refund by ID |\n\n### Refunds\n| Method | Path | Description |\n|--------|------|-------------|\n| GET | /v1/refunds | Search refunds |\n\n## Common Questions\nMatch user requests to endpoints in references/api-spec.lap. Key patterns:\n- \"List all payments?\" -> GET /v1/payments\n- \"Create a payment?\" -> POST /v1/payments\n- \"Get payment details?\" -> GET /v1/payments/{paymentId}\n- \"Create a cancel?\" -> POST /v1/payments/{paymentId}/cancel\n- \"Create a capture?\" -> POST /v1/payments/{paymentId}/capture\n- \"List all events?\" -> GET /v1/payments/{paymentId}/events\n- \"List all refunds?\" -> GET /v1/payments/{paymentId}/refunds\n- \"Create a refund?\" -> POST /v1/payments/{paymentId}/refunds\n- \"Get refund details?\" -> GET /v1/payments/{paymentId}/refunds/{refundId}\n- \"How to authenticate?\" -> See Auth section above\n\n## Response Tips\n- Check response schemas in references/api-spec.lap for field details\n- Paginated endpoints accept limit/offset or cursor parameters\n- Create/update endpoints return the modified resource on success\n- Error responses include status codes and descriptions in the spec\n\n## References\n- Full spec: See references/api-spec.lap for complete endpoint details, parameter tables, and response schemas\n\n> Generated from the official API spec by [LAP](https://lap.sh)\n","references/api-spec.lap":"@lap v0.3\n# Machine-readable API spec. Each @endpoint block is one API call.\n@api GOV.UK Pay API\n@base https://publicapi.payments.service.gov.uk\n@version 1.0.3\n@auth ApiKey Authorization in header\n@endpoints 10\n@toc payments(9), refunds(1)\n\n@group payments\n@endpoint GET /v1/payments\n@desc Search payments\n@optional {reference: any # Your payment reference to search (exact match, case insensitive), email: any # The user email used in the payment to be searched, state: any # State of payments to be searched. Example=success, card_brand: any # Card brand used for payment. Example=master-card, from_date: any # From date of payments to be searched (this date is inclusive). Example=2015-08-13T12:35:00Z, to_date: any # To date of payments to be searched (this date is exclusive). Example=2015-08-14T12:35:00Z, page: any # Page number requested for the search, should be a positive integer (optional, defaults to 1), display_size: any # Number of results to be shown per page, should be a positive integer (optional, defaults to 500, max 500), cardholder_name: any # Name on card used to make payment, first_digits_card_number: any # First six digits of the card used to make payment, last_digits_card_number: any # Last four digits of the card used to make payment, from_settled_date: any # From settled date of payment to be searched (this date is inclusive). Example=2015-08-13, to_settled_date: any # To settled date of payment to be searched (this date is inclusive). Example=2015-08-14}\n@returns(200) OK\n@errors {401: Credentials are required to access this resource, 422: Invalid parameters: from_date, to_date, status, display_size. See Public API documentation for the correct data formats, 429: Too many requests, 500: Downstream system error}\n\n@endpoint POST /v1/payments\n@desc Create new payment\n@required {body: map # requestPayload}\n@returns(201) Created\n@errors {400: Bad request, 401: Credentials are required to access this resource, 422: Invalid attribute value: description. Must be less than or equal to 255 characters length, 429: Too many requests, 500: Downstream system error}\n\n@endpoint GET /v1/payments/{paymentId}\n@desc Find payment by ID\n@required {paymentId: any # Payment identifier}\n@returns(200) OK\n@errors {401: Credentials are required to access this resource, 404: Not found, 429: Too many requests, 500: Downstream system error}\n\n@endpoint POST /v1/payments/{paymentId}/cancel\n@desc Cancel payment\n@required {paymentId: any # Payment identifier}\n@returns(204) No Content\n@errors {400: Cancellation of payment failed, 401: Credentials are required to access this resource, 404: Not found, 409: Conflict, 429: Too many requests, 500: Downstream system error}\n\n@endpoint POST /v1/payments/{paymentId}/capture\n@desc Capture payment\n@required {paymentId: any # Payment identifier}\n@returns(204) No Content\n@errors {400: Capture of payment failed, 401: Credentials are required to access this resource, 404: Not found, 409: Conflict, 429: Too many requests, 500: Downstream system error}\n\n@endpoint GET /v1/payments/{paymentId}/events\n@desc Return payment events by ID\n@required {paymentId: any # Payment identifier}\n@returns(200) OK\n@errors {401: Credentials are required to access this resource, 404: Not found, 429: Too many requests, 500: Downstream system error}\n\n@endpoint GET /v1/payments/{paymentId}/refunds\n@desc Get all refunds for a payment\n@required {paymentId: any}\n@returns(200) OK\n@errors {401: Credentials are required to access this resource, 404: Not found, 429: Too many requests, 500: Downstream system error}\n\n@endpoint POST /v1/payments/{paymentId}/refunds\n@desc Submit a refund for a payment\n@required {paymentId: any # paymentId, body: map # requestPayload}\n@returns(200) successful operation\n@returns(202) ACCEPTED\n@errors {401: Credentials are required to access this resource, 404: Not found, 412: Refund amount available mismatch, 429: Too many requests, 500: Downstream system error}\n\n@endpoint GET /v1/payments/{paymentId}/refunds/{refundId}\n@desc Find payment refund by ID\n@required {paymentId: any, refundId: any}\n@returns(200) OK\n@errors {401: Credentials are required to access this resource, 404: Not found, 429: Too many requests, 500: Downstream system error}\n\n@endgroup\n\n@group refunds\n@endpoint GET /v1/refunds\n@desc Search refunds\n@optional {from_date: any # From date of refunds to be searched (this date is inclusive). Example=2015-08-13T12:35:00Z, to_date: any # To date of refunds to be searched (this date is exclusive). Example=2015-08-14T12:35:00Z, from_settled_date: any # From settled date of refund to be searched (this date is inclusive). Example=2015-08-13, to_settled_date: any # To settled date of refund to be searched (this date is inclusive). Example=2015-08-13, page: any # Page number requested for the search, should be a positive integer (optional, defaults to 1), display_size: any # Number of results to be shown per page, should be a positive integer (optional, defaults to 500, max 500)}\n@returns(200) OK\n@errors {401: Credentials are required to access this resource, 422: Invalid parameters. See Public API documentation for the correct data formats, 500: Downstream system error}\n\n@endgroup\n\n@end\n"}}