TestingAPIs is still being built. If something breaks, email support@testingapis.com.

Refund a succeeded payment

POSThttps://api.testingapis.com/api/Payments/{id}/refundSign in to see this endpoint's URL

Parameters 1

NameTypeDescription
idrequiredpath · integer (int32)Payment ID.

Responses

200
Payment refunded.
404
No payment with that ID.
409
Already refunded, or not in succeeded status.

Example

Request
curl -X POST "https://api.testingapis.com/api/Payments/13/refund" \
  -H "X-TestingApis-Key: YOUR_API_KEY"
Response200 OK
{
  "message": "Payment refunded successfully",
  "data": {
    "id": 13,
    "userId": 102,
    "orderId": null,
    "amount": 20.0,
    "currency": "USD",
    "method": "card",
    "status": "refunded",
    "description": "refund demo",
    "cardLast4": "4242",
    "createdAt": "2026-09-30T18:26:35Z",
    "refundedAt": "2026-09-30T18:26:45Z"
… (2 more lines)

Sign in to see the details

The parameters, request and response examples and the live Try it panel for this endpoint are for signed-in members. Accounts are free and take a few seconds to create.