Errors
Errors use the GOV.UK Pay shape. field is only present for validation errors.
{ "field": "amount", "code": "P0101", "description": "Missing mandatory attribute: amount" }
| HTTP status | Code | Meaning |
|---|---|---|
| 400 | P0197 / P0697 / P2197 | The JSON in the request body is invalid. |
| 400 | P0601 / P0602 | Refund amount missing or invalid. |
| 400 | P1211 | No payment matches the one_time_token. |
| 400 | P2501 | The agreement is already cancelled or inactive. |
| 401 | n/a | No bearer token sent. Body is {"message":"Unauthorized"}. |
| 402 | P0010 | The card was declined (POST /v1/auth). |
| 403 | n/a | Bearer token sent but not valid. Body is {"message":"Forbidden"}. |
| 404 | P0200 / P0300 / P0500 / P0600 / P1000 | No payment matched the ID. |
| 404 | P0700 | No refund matched the ID. |
| 404 | P2200 / P2500 | No agreement matched the ID. |
| 404 | P0402 / P1100 / P1402 / P2402 | The requested page of search results does not exist. |
| 409 | P0191 | The Idempotency-Key has already been used. |
| 409 | P0502 | The payment cannot be cancelled in its current state. |
| 409 | P1003 | The payment is not capturable. |
| 412 | P0603 / P0604 | The payment cannot be refunded, or refund_amount_available does not match. |
| 422 | P0101 / P2101 | A mandatory attribute is missing. See field. |
| 422 | P0102 / P2102 | An attribute value is invalid. See field and description. |
| 422 | P0104 | return_url cannot be used with moto_api. |
| 422 | P0401 / P1101 / P1401 / P2401 | A search parameter is invalid. |
| 422 | P1212 | The one_time_token has already been used. |
Codes P1401 and P1402 (disputes search) are assumed; the public documentation does not list them.