List refunds

get/v1/refunds

Parameters

limitintegerin query

1 to 100 · default 20

payment_intentstring (uuid)in query

Responses

  • 200Refunds, newest firstobject
    Show the fields
    object"list"
    dataarray of Refund
    Fields of data
    idstring (uuid)
    object"refund"
    livemodeboolean
    payment_intentstring (uuid)
    amountinteger

    Minor units (kobo, cents).

    at least 0

    currencyNGN | USD
    reasonstring | null
    statuspending | succeeded | failed
    failure_codestring | null
    created_atstring (date-time)
    succeeded_atstring (date-time) | null
    failed_atstring (date-time) | null
    has_moreboolean
bash
curl https://sandbox.api.biftpay.com/v1/refunds \
  -H "Authorization: Bearer bp_test_..."
response
{
  "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 headerrequired

A unique key per logical request, for example a UUID. Up to 255 characters.

up to 255 characters

Body

payment_intentstring (uuid)required
amountinteger

Defaults to the full remaining amount.

at least 1

reasonrequested_by_customer | duplicate | fraudulent

Responses

  • 201CreatedRefund
    Show the fields
    idstring (uuid)
    object"refund"
    livemodeboolean
    payment_intentstring (uuid)
    amountinteger

    Minor units (kobo, cents).

    at least 0

    currencyNGN | USD
    reasonstring | null
    statuspending | succeeded | failed
    failure_codestring | null
    created_atstring (date-time)
    succeeded_atstring (date-time) | null
    failed_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
bash
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": "…"
  }'
response
{
  "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 pathrequired

Responses

  • 200The refundRefund
    Show the fields
    idstring (uuid)
    object"refund"
    livemodeboolean
    payment_intentstring (uuid)
    amountinteger

    Minor units (kobo, cents).

    at least 0

    currencyNGN | USD
    reasonstring | null
    statuspending | succeeded | failed
    failure_codestring | null
    created_atstring (date-time)
    succeeded_atstring (date-time) | null
    failed_atstring (date-time) | null
  • 404Not found, or not visible to this key
bash
curl https://sandbox.api.biftpay.com/v1/refunds/{id} \
  -H "Authorization: Bearer bp_test_..."
response
{
  "id": "…",
  "object": "refund",
  "livemode": true,
  "payment_intent": "…",
  "amount": 0,
  "currency": "NGN",
  "status": "pending",
  "created_at": "…"
}