Charges
Create a charge
Create a usage-based charge linking a plan to a billable metric. Supported models: STANDARD, GRADUATED, VOLUME, PACKAGE, PERCENTAGE.
post/api/charges
Request body
Example request
{
"chargeModel": "STANDARD",
"invoiceDisplayName": "API Calls",
"minAmountCents": 100,
"properties": {
"amount": "0.10",
"currency": "USD"
},
"graduatedRanges": [
{
"toValue": 100,
"perUnitAmount": 0.1
}
],
"filters": [
{
"key": "region",
"values": [
"us-east"
]
}
]
}Response
Charge created
Example response
{
"id": "clx1234567890",
"planId": "clxplan123",
"billableMetricId": "clxbm123",
"chargeModel": "GRADUATED",
"billingTiming": "IN_ARREARS",
"invoiceDisplayName": "API Usage",
"minAmountCents": 100,
"graduatedRanges": [
{
"id": "clx1234567890",
"toValue": 1000,
"perUnitAmount": "0.0100",
"flatAmount": "0.0000"
}
],
"filters": [
{
"id": "clx1234567890",
"key": "region",
"values": [
"us-east"
]
}
]
}