Skip to main content
POST
/
v1
/
customer
/
reportUsage
report usage
curl --request POST \
  --url https://api.unprice.dev/v1/customer/reportUsage \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "customerId": "cus_1H7KQFLr7RepUyQBKdnvY",
  "featureSlug": "tokens",
  "usage": 30,
  "idempotenceKey": "123e4567-e89b-12d3-a456-426614174000",
  "metadata": {
    "action": "create",
    "country": "US"
  }
}
'
{
  "success": true,
  "message": "<string>",
  "cacheHit": true,
  "remaining": 123
}

Authorizations

Authorization
string
header
required

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

Body

application/json

The usage to report

customerId
string
required

The customer ID

Example:

"cus_1H7KQFLr7RepUyQBKdnvY"

featureSlug
string
required

The feature slug

Example:

"tokens"

usage
number
required

The usage

Example:

30

idempotenceKey
string<uuid>
required

The idempotence key

Example:

"123e4567-e89b-12d3-a456-426614174000"

metadata
object

The metadata

Example:
{ "action": "create", "country": "US" }

Response

The result of the report usage

success
boolean
required
message
string
cacheHit
boolean
remaining
number