Skip to main content
POST
/
api
/
v1
/
charges
Create a new charge
curl --request POST \
  --url https://dev-billing-api.iqraa.ai/api/v1/api/v1/charges \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --header 'x-admin-api-key: <x-admin-api-key>' \
  --data '
{
  "name": "Extra Storage",
  "code": "extra_storage",
  "amount": 1000,
  "currency": "USD",
  "entitlementCode": "EXTRA_STORAGE_ENTITLEMENT",
  "description": "Additional storage space for your account",
  "billableMetricOverrides": {
    "fieldName": "storage_gb",
    "aggregatorType": "sum",
    "description": "Total storage used in GB"
  }
}
'

Authorizations

Authorization
string
header
required

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

Headers

x-admin-api-key
string
required

The API key to access the admin API

Body

application/json
name
string
required

The name of the charge

Example:

"Extra Storage"

code
string
required

Unique code identifier for the charge

Example:

"extra_storage"

amount
number
required

The price of the charge

Required range: x >= 0
Example:

1000

currency
string
required

The currency for the charge

Example:

"USD"

entitlementCode
string
required

The entitlement code this charge is associated with

Example:

"EXTRA_STORAGE_ENTITLEMENT"

description
string

Description of the charge

Example:

"Additional storage space for your account"

billableMetricOverrides
object

Optional overrides for billable metric configuration

Example:
{
"fieldName": "storage_gb",
"aggregatorType": "sum",
"description": "Total storage used in GB"
}

Response

Charge created successfully