List refunds
get/v1/refunds
Parameters
limitintegerin query1 to 100 · default 20
payment_intentstring (uuid)in queryResponses
- 200Refunds, newest firstobject
Show the fields
object"list"dataarray of RefundFields of data
idstring (uuid)object"refund"livemodebooleanpayment_intentstring (uuid)amountintegerMinor units (kobo, cents).
at least 0
currencyNGN | USDreasonstring | nullstatuspending | succeeded | failedfailure_codestring | nullcreated_atstring (date-time)succeeded_atstring (date-time) | nullfailed_atstring (date-time) | nullhas_moreboolean
curl https://sandbox.api.biftpay.com/v1/refunds \
-H "Authorization: Bearer bp_test_..."{
"object": "list",
"data": [
{
"id": "…",
"object": "refund",
"livemode": true,
"payment_intent": "…",
"amount": 0,
"currency": "NGN",
"status": "pending",
"created_at": "…"
}
],
"has_more": true
}Refund a successful payment, in full or in part
post/v1/refunds
Sent back through the provider that charged the customer. The amount is held from
the merchant's balance (pending if not yet released, else available) into
refund_in_flight, then settled when the provider confirms or returned if it fails.
Processing fees aren't returned. Omit amount to refund what's left.
A payment with an open dispute can't be refunded (409 payment_disputed): the
chargeback already returns the funds, so answer the dispute instead. What a lost
dispute returned counts towards the amount already refunded.
In test mode, amounts ending in 13 kobo are rejected and ending in 17 stay pending.
Parameters
Idempotency-Keystringin headerrequiredA unique key per logical request, for example a UUID. Up to 255 characters.
up to 255 characters
Body
payment_intentstring (uuid)requiredamountintegerDefaults to the full remaining amount.
at least 1
reasonrequested_by_customer | duplicate | fraudulentResponses
- 201CreatedRefund
Show the fields
idstring (uuid)object"refund"livemodebooleanpayment_intentstring (uuid)amountintegerMinor units (kobo, cents).
at least 0
currencyNGN | USDreasonstring | nullstatuspending | succeeded | failedfailure_codestring | nullcreated_atstring (date-time)succeeded_atstring (date-time) | nullfailed_atstring (date-time) | null - 400Invalid request
- 404Not found, or not visible to this key
- 409The object is in a state that doesn't allow this
curl -X POST https://sandbox.api.biftpay.com/v1/refunds \
-H "Authorization: Bearer bp_test_..." \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{
"payment_intent": "…"
}'{
"id": "…",
"object": "refund",
"livemode": true,
"payment_intent": "…",
"amount": 0,
"currency": "NGN",
"status": "pending",
"created_at": "…"
}Retrieve a refund
get/v1/refunds/{id}
Parameters
idstring (uuid)in pathrequiredResponses
- 200The refundRefund
Show the fields
idstring (uuid)object"refund"livemodebooleanpayment_intentstring (uuid)amountintegerMinor units (kobo, cents).
at least 0
currencyNGN | USDreasonstring | nullstatuspending | succeeded | failedfailure_codestring | nullcreated_atstring (date-time)succeeded_atstring (date-time) | nullfailed_atstring (date-time) | null - 404Not found, or not visible to this key
curl https://sandbox.api.biftpay.com/v1/refunds/{id} \
-H "Authorization: Bearer bp_test_..."{
"id": "…",
"object": "refund",
"livemode": true,
"payment_intent": "…",
"amount": 0,
"currency": "NGN",
"status": "pending",
"created_at": "…"
}