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
}Records a usage event for a customer against a product. Atomically increments usage counters on the active purchase and appends an event to the usage log.
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
}Customer reference
"cus_3C4D5E6F"
Product reference
"prd_1A2B3C4D"
Action type
transaction, api_call, hour, email, storage, custom "api_call"
Custom action key for custom action types
Human-readable description of the event
Arbitrary metadata
Tool or feature name
Number of usage units (default: 1)
1