Commet
  • Precios
Iniciar SesiónRegistrarse
Create credit pack POSTDelete credit pack DELETEList credit packs GETPurchase credits POSTUpdate credit pack PUT
DocumentaciónRecursosConstruir con AIAPI ReferenceWebhooks

Purchase credits

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

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.

POST
/subscriptions/{id}/credits

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
Length1 <= length

Response Body

application/json

application/json

curl -X POST "https://commet.co/api/v1/subscriptions/string/credits" \  -H "Content-Type: application/json" \  -d '{    "creditPackId": "string"  }'

application/json

Credit pack public ID

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

Subscription public ID

{
  "success": true,
  "data": {
    "object": "credit_pack",
    "livemode": true,
    "credits": 0
  }
}
{
  "success": false,
  "error": {
    "type": "validation_error",
    "code": "string",
    "message": "string",
    "doc_url": "string",
    "param": "string"
  }
}
{
  "success": false,
  "error": {
    "type": "validation_error",
    "code": "string",
    "message": "string",
    "doc_url": "string",
    "param": "string"
  }
}