Skip to main content

Create refund

Create a refund for a specific transaction. This endpoint allows you to process full or partial refunds for completed transactions.

POSThttps://api.efundpay.com/v4/transactions/{transaction_id}/refunds
This endpoint requires the transactions.write scope.

Authorizations

Authorizationstringheaderrequired

Bearer authentication header of the form `Bearer <token>`, where `<token>` is your auth token.

Headers

x-merchant-account-idstringrequired

The ID of the merchant account to use for this request.

Examples:""default""

Path Parameters

transaction_idstringrequired

The unique identifier of the transaction to create a refund for.

Examples:"7099948d-7286-47e4-aad8-b68f7eb44591"

Body

application/json
amountintegerrequired

The amount to refund in the smallest currency unit.

Range:x >= 1
Examples:"1299""500"
currencystringrequired

Refund currency.

Examples:"USD""EUR"
reasonstringrequired

The reason for the refund.

Length:1 - 255
Examples:"Refund due to user request.""Product return""Order cancellation"
external_identifierstringrequired

An external identifier that can be used to match the refund against your own records.

Length:1 - 50
Examples:"refund-12345"
webhooks_urlstringrequired

The webhook URL to receive payment status notifications.

Examples:"https://yourdomain.com/webhook/refund"
bank_detailobject | null

Bank account details object, required for payment is QR PromptPay, Thailand Mobile Banking. Please see Refund Policy for more details.

Response

application/json

Successful Response

typestringrequired

Resource type, always "refund".

Examples:"refund"
idstringrequired

Unique refund identifier.

Examples:"6a1d4e46-14ed-4fe1-a45f-eff4e025d211"
transaction_idstringrequired

The ID of the transaction being refunded.

Examples:"7099948d-7286-47e4-aad8-b68f7eb44591"
statusstringrequired

Refund status. Available options: processing, succeeded, failed, declined, voided

Examples:"succeeded""failed""processing"
currencystringrequired

The ISO 4217 currency code for this refund. Will always match that of the associated transaction.

Examples:"EUR""USD""GBP"
amountintegerrequired

Refund amount in the smallest currency unit.

Examples:"1299"
reasonstringrequired

Reason for the refund.

Examples:"Refund due to user request."
external_identifierstringrequired

External identifier for the refund.

Examples:"refund-12345"
transaction_external_identifierstringrequired

External identifier for the original transaction.

Examples:"transaction-12345"
created_atstringrequired

Creation time (ISO 8601).

Examples:"2013-07-16T19:23:00.000+00:00"
curl --request POST \
--url https://api.efundpay.com/v4/transactions/7099948d-7286-47e4-aad8-b68f7eb44591/refunds \
--header 'Authorization: Bearer <token>' \
--header 'x-merchant-account-id: <x-merchant-account-id>' \
--header 'Content-Type: application/json' \
--data '{
"amount": 1299,
"currency": "EUR",
"reason": "Refund due to user request.",
"external_identifier": "refund-12345",
"bank_detail": {
"bank_code": "014",
"bank_account_name": "Jack",
"bank_account_no": "5015377989"
}
}'
{
"type": "refund",
"id": "6a1d4e46-14ed-4fe1-a45f-eff4e025d211",
"transaction_id": "7099948d-7286-47e4-aad8-b68f7eb44591",
"status": "succeeded",
"currency": "EUR",
"amount": 1299,
"reason": "Refund due to user request.",
"external_identifier": "refund-12345",
"transaction_external_identifier": "transaction-12345",
"created_at": "2013-07-16T19:23:00.000+00:00",
}
Powered by Docusaurus