Get information about a payment’s refunds

GET/v1/payments/{paymentId}/refunds

You can use this endpoint to get a list of refunds for a payment.

Requires a bearer token.

In this mock: Refunds are listed under _embedded.refunds, oldest first.

Path parameters

NameTypeDescription
paymentId
required
string The unique payment_id of the payment you want a list of refunds for.

Example request

curl -X GET "https://publicapi.payments.platform-engineering.com/v1/payments/{paymentId}/refunds" \
  -H "Authorization: Bearer $TOKEN"

Responses

200: OK - your request was successful.

NameTypeDescription
_embedded object
_embedded.refunds[] array of objects
_embedded.refunds[]._links object links for search refunds resource
_embedded.refunds[]._links.payment object A link related to a payment
_embedded.refunds[]._links.self object A link related to a payment
_embedded.refunds[].amount integer The amount refunded to the user in pence.
_embedded.refunds[].created_date string The date and time you created this refund. This value uses Coordinated Universal Time (UTC) and ISO 8601 format - YYYY-MM-DDThh:mm:ss.SSSZ.
_embedded.refunds[].payment_id string The unique ID GOV.UK Pay automatically associated with this payment when you created it.
_embedded.refunds[].refund_id string The unique ID GOV.UK Pay automatically associated with this refund when you created it.
_embedded.refunds[].settlement_summary object A structure representing information about a settlement for refunds
_embedded.refunds[].settlement_summary.settled_date string The date Stripe took the refund from a payout to your bank account. settled_date only appears if Stripe has taken the refund. This value uses Coordinated Universal Time (UTC) and ISO 8601 format - YYYY-MM-DD.
_embedded.refunds[].status string The status of the refund.
One of: submitted, success, error
_links object links for search refunds resource
_links.payment object A link related to a payment
_links.payment.href string A URL that lets you perform additional actions to this payment when combined with the associated method.
_links.payment.method string An API method that lets you perform additional actions to this paymentwhen combined with the associated href.
_links.self object A link related to a payment
_links.self.href string A URL that lets you perform additional actions to this payment when combined with the associated method.
_links.self.method string An API method that lets you perform additional actions to this paymentwhen combined with the associated href.
payment_id string The unique ID GOV.UK Pay associated with this payment when you created it.
{
  "_embedded": {
    "refunds": [
      {
        "_links": {
          "payment": {},
          "self": {}
        },
        "amount": 120,
        "created_date": "2017-01-10T16:52:07.855Z",
        "payment_id": "hu20sqlact5260q2nanm0q8u93",
        "refund_id": "act4c33g40j3edfmi8jknab84x",
        "settlement_summary": {
          "settled_date": "2016-01-21"
        },
        "status": "success"
      }
    ]
  },
  "_links": {
    "payment": {
      "href": "https://an.example.link/from/payment/platform",
      "method": "GET"
    },
    "self": {
      "href": "https://an.example.link/from/payment/platform",
      "method": "GET"
    }
  },
  "payment_id": "hu20sqlact5260q2nanm0q8u93"
}

401: Your API key is missing or invalid. Read more about [authenticating GOV.UK Pay API requests](https://docs.payments.service.gov.uk/api_reference/#authentication)

404: Not found

NameTypeDescription
code string An API error codethat explains why the payment failed.<br><br>code only appears if the payment failed.
description string Additional details about the error.
field string The parameter in your request that's causing the error.
header string The header in your request that's causing the error.
{
  "code": "P0102",
  "description": "Invalid attribute value: amount. Must be less than or equal to 10000000",
  "field": "amount",
  "header": "Idempotency-Key"
}

429: Too many requests

NameTypeDescription
code string A GOV.UK Pay API error code. You can find out more about this code in our documentation.
description string Additional details about the error
{
  "code": "P0900",
  "description": "Too many requests"
}

500: Downstream system error

NameTypeDescription
code string An API error codethat explains why the payment failed.<br><br>code only appears if the payment failed.
description string Additional details about the error.
field string The parameter in your request that's causing the error.
header string The header in your request that's causing the error.
{
  "code": "P0102",
  "description": "Invalid attribute value: amount. Must be less than or equal to 10000000",
  "field": "amount",
  "header": "Idempotency-Key"
}