Set current usage
Set a metered feature's usage to an exact value for the current period. Use the Idempotency-Key header to make retries safe.
Set a metered feature's usage to an exact value for the current period. Use the Idempotency-Key header to make retries safe.
Authorization
ApiKeyAuth x-api-key<token>
In: header
Header Parameters
Idempotency-Key?string
Unique key used to safely retry this write for 24 hours without applying it twice.
Length
1 <= length <= 200Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
application/json
application/json
application/json
application/json
application/json
application/json
application/json
application/json
curl -X PUT "https://example.com/usage" \ -H "Content-Type: application/json" \ -d '{ "customerId": "string", "featureCode": "string", "value": 0 }'{ "id": "string", "value": 0, "previousValue": 0, "adjustment": -9007199254740991, "customerId": "string", "reason": "string", "ts": "2019-08-24T14:15:22Z", "createdAt": "2019-08-24T14:15:22Z", "featureCode": "string", "object": "usage_adjustment", "livemode": true}{ "error": { "type": "string", "code": "string", "message": "string", "param": "string", "details": null, "doc_url": "string" }}{ "error": { "type": "string", "code": "string", "message": "string", "param": "string", "details": null, "doc_url": "string" }}{ "error": { "type": "string", "code": "string", "message": "string", "param": "string", "details": null, "doc_url": "string" }}{ "error": { "type": "string", "code": "string", "message": "string", "param": "string", "details": null, "doc_url": "string" }}{ "error": { "type": "string", "code": "string", "message": "string", "param": "string", "details": null, "doc_url": "string" }}{ "error": { "type": "string", "code": "string", "message": "string", "param": "string", "details": null, "doc_url": "string" }}{ "error": { "type": "string", "code": "string", "message": "string", "param": "string", "details": null, "doc_url": "string" }}{ "error": { "type": "string", "code": "string", "message": "string", "param": "string", "details": null, "doc_url": "string" }}{ "error": { "type": "string", "code": "string", "message": "string", "param": "string", "details": null, "doc_url": "string" }}