Skip to content
Baremetrics

Create Charge

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

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

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

[!CAUTION] If you are managing subscription charges manually, please note that this will not impact the subscription state or MRR. For example, if you stop sending charges, the subscription will stay active until you cancel it. This feature is purely designed to allow people to control the timing of charges, and for people who have custom proration methods.

If you want to manually manage subscription charges, then please contact support.

Otherwise, we will automatically create charges.

[!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

  • created string · date-time

    Unix timestamp of when this was created

    Default "NOW"

  • status string

    The status of this charge. Can be paid or failed. Defaults to paid.

    Default "paid"

  • fee integer · int32

    Default 0

  • subscription_oid string

    This can only be supplied when Subscription Auto Charging is disabled. Please contact support if you want to handle your subscription charges manually.

Responses

200OK
{
  "charge": {
    "oid": "your_unique_id",
    "source_id": "source_id",
    "source": "baremetrics",
    "status": "paid",
    "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
    },
    "subscription": null,
    "amount": 450000,
    "currency": "USD",
    "original_amount": 450000,
    "fee": 500,
    "original_fee": 500
  }
}
400Bad Request
{}