POST
/
v1
/
customers
/
{id}
/
credits
/
{productId}
/
usage

Authorizations

Authorization
string
headerrequired

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
usage_retained
number
required

Value indicating the number of credits consumed.

Required range: x > 0
event_id
string | null

Event ID corresponding to the credit consumption.

Response

201 - application/json
id
string
required

Credit transaction ID.

product_id
string | null
required

ID of the product related to the transaction.

price
object | null
required

Price details related to the transaction.

customer_id
string
required

ID of the customer related to the transaction.

payment_method_id
string | null
required

ID of the payment method related to the transaction.

invoice_id
string | null
required

ID of the invoice related to the transaction.

event_id
string | null
required

ID of the event related to the credit consumption.

type
enum<string>
required

Type of credit transaction.

Available options:
topup,
usage
source
enum<string>
required

Type of credit transaction.

Available options:
app,
portal,
api
amount_excluding_tax
number
required

Monetary amount. Expressed in currency's smallest unit.

credit_count
number
required

Value of credits related to the transaction.

balance_after
number
required

Credit balance after the transaction.

created_at
string
required

Credit transaction creation date.

updated_at
string
required

Credit transaction last edition date.

Was this page helpful?