Refunds
Refunds allow PSPs only to return funds for a previously completed pay-in.
The refunded amount is sent back to the original external customer who made the payment to your merchant/customer.
Developers cannot initiate refunds.
Refunds are strictly a PSP operation.
Refund Types
Celar supports two refund types:
-
Full refund
- Refunds the entire original pay-in amount
amountmust not be provided
-
Partial refund
- Refunds a portion of the original pay-in
amountmustbe provided
Create a Refund
Endpoint: POST /payments/refund
Request
curl --request POST \
--url https://api.sandbox.celar.io/api/v1/payments/refund \
--header 'Accept: application/json' \
--header 'Authorization: Bearer <your_api_key>' \
--header 'Idempotency-Key: <random_uuid>' \
--header 'Content-Type: application/json' \
--data '{
"celar_walletId": "cw_91806496a0987bed",
"type": "partial",
"paymentId": "payin_0696c85b83d0d946",
"amount": 10
}'
Parameters
| Field | Required | Description |
|---|---|---|
celar_walletId | Yes | PSP wallet funding the refund |
type | Yes | Refund type: partial or full |
paymentId | Yes | Pay-in ID being refunded |
amount | Conditional | Required for partial, omitted for full |
Response
{
"message": "Refund completed successfully",
"refundId": "refund_eb8ce7aa1602f17d",
"amount": 10,
"tx_hash": "0x9da442bbb3e48800c5260dce6dac2ef5c2d2ce471512c621f8ec94b3fa8f9fbf"
}
Key Fields
refundId→ unique identifier for the refundtx_hash→ on-chain transaction hash for the refundamount→ refunded amount (equals full pay-in amount for full refunds)
Attempting to refund more than the original pay-in will fail