Skip to main content
POST
/
v1
/
sdk
/
usages
Record a usage event
curl --request POST \
  --url https://api.example.com/v1/sdk/usages \
  --header 'Content-Type: application/json' \
  --data '
{
  "customerRef": "cus_3C4D5E6F",
  "productRef": "prd_1A2B3C4D",
  "action": "api_call",
  "customActionKey": "<string>",
  "description": "<string>",
  "metadata": {},
  "toolName": "<string>",
  "units": 1
}
'
{
  "outcome": "success",
  "success": true,
  "units": 1
}

Body

application/json
customerRef
string
required

Customer reference

Example:

"cus_3C4D5E6F"

productRef
string
required

Product reference

Example:

"prd_1A2B3C4D"

action
enum<string>

Action type

Available options:
transaction,
api_call,
hour,
email,
storage,
custom
Example:

"api_call"

customActionKey
string

Custom action key for custom action types

description
string

Human-readable description of the event

metadata
object

Arbitrary metadata

toolName
string

Tool or feature name

units
number

Number of usage units (default: 1)

Example:

1

Response

Usage recorded successfully

outcome
enum<string>
Available options:
success,
paywall
Example:

"success"

success
boolean
Example:

true

units
number
Example:

1