curl --request POST \
--url https://api.paygentic.io/v0/usage \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"idempotencyKey": "<string>",
"entitlementId": "<string>",
"customerId": "<string>",
"merchantId": "<string>",
"timestamp": "2023-11-07T05:31:56Z",
"properties": [
{
"billableMetricId": "<string>",
"quantity": 123,
"price": "<string>"
}
],
"metadata": {}
}'
{
"id": "<string>",
"object": "usageEvent",
"idempotencyKey": "<string>",
"customerId": "<string>",
"description": "<string>",
"merchantId": "<string>",
"consumerId": "<string>",
"subscriptionId": "<string>",
"entitlementId": "<string>",
"timestamp": "2023-11-07T05:31:56Z",
"createdAt": "2023-11-07T05:31:56Z",
"properties": [
{
"billableMetricId": "<string>",
"quantity": 2,
"price": "<string>"
}
],
"metadata": {},
"billing": {
"price": 123,
"billingEventId": "<string>"
},
"dispute": {
"id": "<string>",
"object": "dispute",
"usageEventId": "<string>",
"customerId": "<string>",
"merchantId": "<string>",
"customerMessage": "<string>",
"merchantMessage": "<string>",
"status": "pending",
"disputedAmount": "<string>",
"resolvedAt": "2023-11-07T05:31:56Z",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}
}
Creates a usage event. The idempotencyKey is used to ensure the event is processed only once by downstream consumers, even if the same event is submitted multiple times. Duplicate submissions will be accepted and return the same response.
curl --request POST \
--url https://api.paygentic.io/v0/usage \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"idempotencyKey": "<string>",
"entitlementId": "<string>",
"customerId": "<string>",
"merchantId": "<string>",
"timestamp": "2023-11-07T05:31:56Z",
"properties": [
{
"billableMetricId": "<string>",
"quantity": 123,
"price": "<string>"
}
],
"metadata": {}
}'
{
"id": "<string>",
"object": "usageEvent",
"idempotencyKey": "<string>",
"customerId": "<string>",
"description": "<string>",
"merchantId": "<string>",
"consumerId": "<string>",
"subscriptionId": "<string>",
"entitlementId": "<string>",
"timestamp": "2023-11-07T05:31:56Z",
"createdAt": "2023-11-07T05:31:56Z",
"properties": [
{
"billableMetricId": "<string>",
"quantity": 2,
"price": "<string>"
}
],
"metadata": {},
"billing": {
"price": 123,
"billingEventId": "<string>"
},
"dispute": {
"id": "<string>",
"object": "dispute",
"usageEventId": "<string>",
"customerId": "<string>",
"merchantId": "<string>",
"customerMessage": "<string>",
"merchantMessage": "<string>",
"status": "pending",
"disputedAmount": "<string>",
"resolvedAt": "2023-11-07T05:31:56Z",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}
}
Bearer authentication header of the form Bearer <token>
, where <token>
is your auth token.
Usage event created successfully
The response is of type object
.