Commet
  • Pricing
Log InTry out
Create credit pack POSTDelete credit pack DELETEList credit packs GETPurchase credits POSTUpdate credit pack PUT
DocumentationKnowledge BaseBuild with AIAPI ReferenceWebhooks

Purchase credits

Purchase a credit pack for a subscription. Charges the customer and adds credits to their balance.

POST
/subscriptions/{id}/credits

Purchase a credit pack for a subscription. Charges the customer and adds credits to their balance.

Authorization

ApiKeyAuth
x-api-key<token>

In: header

Path Parameters

id*string

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

creditPackId*string

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/subscriptions/string/credits" \  -H "Content-Type: application/json" \  -d '{    "creditPackId": "string"  }'
{  "success": true,  "data": {    "credits": -9007199254740991,    "object": "subscription",    "livemode": true  }}
{  "success": false,  "error": {    "type": "string",    "code": "string",    "message": "string",    "param": "string",    "details": null,    "doc_url": "string"  }}
{  "success": false,  "error": {    "type": "string",    "code": "string",    "message": "string",    "param": "string",    "details": null,    "doc_url": "string"  }}
{  "success": false,  "error": {    "type": "string",    "code": "string",    "message": "string",    "param": "string",    "details": null,    "doc_url": "string"  }}
{  "success": false,  "error": {    "type": "string",    "code": "string",    "message": "string",    "param": "string",    "details": null,    "doc_url": "string"  }}
{  "success": false,  "error": {    "type": "string",    "code": "string",    "message": "string",    "param": "string",    "details": null,    "doc_url": "string"  }}

List credit packs GET

List all active credit packs.

Update credit pack PUT

Update a credit pack's name, description, credits, price, or active status.