Skip to main content
GET
/
plan
/
{planId}
/
balance
Get Plan Balance
curl --request GET \
  --url http://sandbox.mintlify.com/plan/{planId}/balance \
  --header 'Authorization: Bearer <token>'
{
  "isSubscriber": true,
  "total": 123,
  "used": 123,
  "remaining": 123
}
Checks the current usage balance for a given plan, scoped to the authenticated subscriber or a specific address.

Example Usage

const balance = await payments.getPlanBalance(planId)
// OR if you provide the address of a different user
const balance = await payments.getPlanBalance(planId, userAddress)

Parameters

  • planId: The ID of the payment plan to check balance for
  • userAddress (optional): Check balance for a specific user address instead of the authenticated user

Returns

{
  "isSubscriber": "boolean",
  "total": "number",
  "used": "number",
  "remaining": "number"
}

Notes

  • If isSubscriber is false, the user has no active credits
  • Balance may be time-based or credit-based depending on plan type

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

planId
string
required

The unique identifier of the plan.

Response

200 - application/json

Balance information

isSubscriber
boolean
total
integer
used
integer
remaining
integer