v1

latestOpenAPI 3.1.02026-07-261444991.2 MB
Credit

Create top-up by external ID

This endpoint allows you to create a new top-up for a specified customer's balance. While this top-up is active, the customer's balance will added in increments of the specified amount whenever the balance reaches the specified threshold.

If a top-up already exists for this customer in the same currency, the existing top-up will be replaced.

post/customers/external_customer_id/{external_customer_id}/credits/top_ups

Path parameters

external_customer_idstring nullable required

Request body

currencystring required

The currency or custom pricing unit to use for this top-up. If this is a real-world currency, it must match the customer's invoicing currency.

thresholdstring required

The threshold at which to trigger the top-up. If the balance is at or below this threshold, the top-up will be triggered.

amountstring required

The amount to increment when the threshold is reached.

per_unit_cost_basisstring required

How much, in the customer's currency, to charge for each unit.

expires_afterinteger nullable

The number of days or months after which the top-up expires. If unspecified, it does not expire.

expires_after_unit'day' | 'month' nullable

The unit of expires_after.

active_fromstring date-time nullable

The date from which the top-up is active. If unspecified, the top-up is active immediately. This should not be more than 10 days in the past.

Response

Created

idstring required
currencystring required

The currency or custom pricing unit to use for this top-up. If this is a real-world currency, it must match the customer's invoicing currency.

thresholdstring required

The threshold at which to trigger the top-up. If the balance is at or below this threshold, the top-up will be triggered.

amountstring required

The amount to increment when the threshold is reached.

per_unit_cost_basisstring required

How much, in the customer's currency, to charge for each unit.

expires_afterinteger nullable

The number of days or months after which the top-up expires. If unspecified, it does not expire.

expires_after_unit'day' | 'month' nullable

The unit of expires_after.