Refunds

Refund a settled collection back to the payer. You identify the collection by its provider_event_id, request the refund, and Swappr returns the funds to the original payer. Your wallet is debited the full original amount when the refund settles.

Available for GBP and EUR collections.

How a refund works

A refund is the reverse of a collection: the money you collected goes back to whoever paid it. You do not supply the payer’s bank details, Swappr already knows where the collection came from and returns it to that source.

Two things are worth designing around:

  • You reference the collection, not a payer. The only identifier you send is provider_event_id, the value delivered as providerEventId on the wallet_funded webhook you received when the collection credited your wallet. Store that id when you receive the webhook and you have everything you need to refund later.
  • One refund per collection. A collection can be refunded once. A second attempt returns 409, so a retry after a dropped response tells you the refund already exists rather than making a new one.

Before you refund

  • Enable the capability on your key. The API key must carry the refunds capability, enable Refunds on the key under API keys. A key without it gets 403 forbidden_refund_create. This is a property of the key itself, so it keeps working regardless of later changes to the team member who created it.
  • The collection must belong to you. A provider_event_id for a collection in another account, or in the other environment, returns the same 404 as one that does not exist.
  • Idempotency-Key is required. Send a unique value per logical refund. Because only one refund is possible per collection, a repeat of the same refund returns 409 refund_already_exists.

POSTRefund a collection

POST/v1/refunds

Refund a settled collection back to the payer.

Request body
provider_event_idstringRequired

The collection to refund, the providerEventId from its wallet_funded webhook.

reasonstring

Why the refund is being made. Stored for your records. Up to 250 characters.

referencestring

Your own reference, echoed back on the refund object. Up to 100 characters.

Response fields

FieldTypeNotes
objectstringAlways refund.
idstringThe refund id. Use it to retrieve the refund later.
statusstringpending | processing | successful | failed. processing on creation; successful once the funds are returned.
provider_event_idstringThe collection this refund is for.
amount_minorstring | nullThe full original collection amount being refunded, in minor units.
currencystringGBP or EUR.
referencestring | nullYour reference, exactly as you sent it. null if you sent none.
reasonstring | nullThe reason you supplied.
created_atstringISO 8601.
updated_atstringISO 8601.

Errors

CodeHTTPCause
idempotency_key_required400The Idempotency-Key header was absent.
invalid_field400provider_event_id was not supplied, or reason / reference is too long.
invalid_json / invalid_body400The body is not a JSON object.
forbidden_refund_create403The API key is not enabled for refunds.
refund_collection_not_found404No collection matching provider_event_id is visible to this key.
refund_already_exists409This collection has already been refunded.
refund_not_allowed422The collection cannot be refunded (e.g. outside the refund window, not settled, or already returned). The message explains why.
Request
curl -X POST 'https://api.swappr.me/api/v1/refunds' \
  -H "Authorization: Bearer sk_live_..." \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
    "provider_event_id": "evt_abc123",
    "reason": "Duplicate payment",
    "reference": "RFND-4021"
  }'
Response
{
  "object": "refund",
  "id": "clx9r3q0000xyz789ghi012",
  "status": "processing",
  "provider_event_id": "evt_abc123",
  "amount_minor": "150000",
  "currency": "GBP",
  "reference": "RFND-4021",
  "reason": "Duplicate payment",
  "created_at": "2026-08-14T10:15:00.000Z",
  "updated_at": "2026-08-14T10:15:00.000Z"
}

GETRetrieve a refund

GET/v1/refunds/{id}

Fetch one refund by id to check its status. Reading needs no capability beyond authentication. A refund belonging to another account, or to the other environment, returns the same 404 as one that does not exist.

Path parameters
idstringRequired

The refund id.

Errors

CodeHTTPCause
refund_not_found404No refund with that id is visible to this key.
Request
curl 'https://api.swappr.me/api/v1/refunds/clx9r3q0000xyz789ghi012' \
  -H "Authorization: Bearer sk_live_..."
Response
{
  "object": "refund",
  "id": "clx9r3q0000xyz789ghi012",
  "status": "successful",
  "provider_event_id": "evt_abc123",
  "amount_minor": "150000",
  "currency": "GBP",
  "reference": "RFND-4021",
  "reason": "Duplicate payment",
  "created_at": "2026-08-14T10:15:00.000Z",
  "updated_at": "2026-08-14T10:47:00.000Z"
}