Skip to content
Baremetrics

Create Refund

POST https://api.baremetrics.com/v1/{source_id}/refunds

Create "One-Off" refunds that are not linked to a subscription.

These refunds do not affect MRR. They only impact Net Revenue and Other Revenue.

[!CAUTION] Zero-decimal currencies

Our API expects currencies to be submitted in their smallest unit. The value 100 USD, for example, should be submitted to our API as 10,000 (i.e. 10,000 cents).

We consider the following currencies to be zero-decimal:\ BIF, DJF, JPY, KRW, PYG, VND, XAF, XPF, CLP, GNF, KMF, MGA, RWF, VUV, XOF, ISK, HUF

Special Exceptions

Although the Hungarian Forint (HUF) is sometimes considered to have an exponent of 2, our API treats HUF as a zero-decimal currency. All HUF values should therefore be rounded to the nearest whole number (e.g. a charge of HUF 100.95 should be submitted to our API as 101).

Path parameters

  • source_id string required

    Please see Sources

Body

application/json
  • oid string required

    Your unique reference for this charge

  • amount integer · int32 required

    The charge amount (in cents)

  • currency string required

    The ISO code of the currency of this plan. E.G: usd

  • customer_oid string required

    Your unique ID for the customer

  • charge_oid string required

    Which charge do you want to refund? This must be an API charge.

  • created string · date-time

    Unix timestamp of when this was created

    Default "NOW"

Responses

200OK
{
  "refund": {
    "oid": "your_unique_id",
    "source_id": "source_id",
    "source": "baremetrics",
    "created": 1475452800,
    "customer": {
      "oid": "customer_1",
      "source_id": "source_1",
      "source": "stripe",
      "created": 1492605754,
      "email": "customer_1@baremetrics.com",
      "name": "Customer 1",
      "display_image": "https://logo.clearbit.com/baremetrics.com",
      "display_name": "Customer 1",
      "notes": "Here are some notes",
      "ltv": 50000
    },
    "charge": {
      "oid": "123",
      "source_id": "source_id",
      "source": "baremetrics",
      "status": "paid",
      "created": 1475452800,
      "currency": "usd",
      "amount": 450000,
      "original_amount": 450000
    },
    "amount": 450000
  }
}
400Bad Request
{}