Commet
  • Precios
Iniciar SesiónRegistrarse
Adjust balance POSTCancel subscription POSTChange plan POSTCreate a recovery payment link for a past due subscription POSTCreate subscription POSTGet active subscription GETGet subscription by ID GETList subscriptions GETPreview plan change POSTReactivate a past due or canceled subscription POSTTop up balance POSTRevert scheduled cancellation POSTUpdate payment method 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.

POST
/subscriptions/{id}/balance/topup

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

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 <= 9007199254740991

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/subscriptions/string/balance/topup" \  -H "Content-Type: application/json" \  -d '{    "amount": 1  }'
{  "success": true,  "data": {    "amount": -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"  }}
{  "success": false,  "error": {    "type": "string",    "code": "string",    "message": "string",    "param": "string",    "details": null,    "doc_url": "string"  }}

Reactivate a past due or canceled subscription POST

Reactivates a subscription. A past_due subscription retries its outstanding renewal charge (recovering to active on success). A canceled subscription generates a fresh invoice, charges the saved card, and resets the billing period. On a successful charge the subscription becomes active; a declined charge returns an error with a recoveryUrl in the error details that can be sent to the customer to update their card.

Revert scheduled cancellation POST

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