Commet
  • Precios
Iniciar SesiónRegistrarse
Adjust balance POSTCancel subscription POSTChange plan POSTCreate subscription POSTGet active subscription GETList subscriptions GETPreview plan change POSTTop up balance POSTRevert scheduled cancellation POST
DocumentaciónRecursosConstruir con AIAPI ReferenceWebhooks

Top up balance

Top up a subscription's balance. Charges the customer's payment method for the specified amount.

Preview plan change POST

Preview proration details for a plan change without applying it. Returns credit, charge, and net amount.

Revert scheduled cancellation POST

Revert a scheduled cancellation. Only works when canceledAt is set but status is not yet 'canceled'.

POST
/subscriptions/{id}/balance/topup

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.

amount*integer
Range0 < value

Response Body

application/json

application/json

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

application/json

Amount to top up (must be positive)

Top up a subscription's balance. Charges the customer's payment method for the specified amount.

Subscription public ID

{
  "success": true,
  "data": {
    "object": "subscription",
    "livemode": true,
    "amount": 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"
  }
}