Skip to main content
POST
Topup credits

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

id
string
required
productId
string
required

Body

application/json

Credit topup payload

credit_count
number
required

Value indicating a number of credits to add. If price_id is defined, this value must correspond to a full credit pack for the price.

Example:

32

expires_at
string<date-time>

Expiration date for credits linked to this transaction. UTC date time string in the ISO 8601 format.

Example:

"2024-12-20T16:04:11Z"

Response

201 - application/json

The created credit transaction

id
string
required

Credit transaction ID.

Example:

"cdt_BPZ19obsBS2qyo"

product_id
string | null
required

ID of the product related to the transaction.

Example:

"itm_3kXODDF42QXtnL"

price
object | null
required

Price details related to the transaction.

Example:
customer_id
string
required

ID of the customer related to the transaction.

Example:

"cus_Typ0px2W0aiEtl"

payment_method_id
string | null
required

ID of the payment method related to the transaction.

Example:

"pm_1xMpj5bwRqN7LM"

invoice_id
string | null
required

ID of the invoice related to the transaction.

Example:

"inv_1eTaiytfA0i2Va"

event_id
string | null
required

ID of the event related to the credit consumption.

Example:

null

aggregator_id
string | null
required

ID of the aggregator that triggered this usage (for multi-aggregator credits).

Example:

null

expires_at
string<date> | null
required

Expiration date for credits linked to this transaction

Example:

null

type
enum<string>
required

Type of credit transaction.

Available options:
topup,
usage,
expiration
Example:

"topup"

source
enum<string>
required
deprecated

Deprecated field, we recommend no longer using it.

Available options:
app,
portal,
api,
system
Example:

"system"

amount_excluding_tax
number | null
required

Monetary amount. Expressed in currency's smallest unit.

credit_count
number
required

Value of credits related to the transaction.

Example:

32

balance_after
number
required

Credit balance after the transaction.

Example:

2000

created_at
string<date-time>
required

Credit transaction creation date. UTC date time string in the ISO 8601 format.

Example:

"2024-10-13T07:00:01.860Z"

updated_at
string<date-time>
required

Credit transaction last edition date. UTC date time string in the ISO 8601 format.

Example:

"2024-10-13T07:00:01.860Z"