Skip to main content
Get the current credit balance for the API key owner. Use this endpoint before credit-consuming workflows such as event unlock, contact email unlock, or exhibitor event search.

When to use this endpoint

Call GET /external/credits/balance before any workflow that can spend credits: For user-facing integrations, show the balance before a paid action and refresh it after the action completes.

Endpoint

GET /external/credits/balance

Authentication

See Authentication

Success status code

200 OK

Request example

curl "https://platform.lensmor.com/external/credits/balance" \
  -H "Authorization: Bearer $LENSMOR_API_KEY"

Response example

{
  "totalAmount": 35050,
  "totalBalance": 30050,
  "subscriptionAmount": 35000,
  "subscriptionBalance": 30000,
  "giftAmount": 50,
  "giftBalance": 50,
  "resetAt": 1714521600000
}

Response fields

FieldDescription
totalAmountTotal credits ever granted across active subscription and gift buckets.
totalBalanceTotal currently available credits. Use this for simple “can this user spend credits?” checks.
subscriptionAmountSubscription credits granted for the active credit period.
subscriptionBalanceRemaining subscription credits. These are consumed before gift credits.
giftAmountGift credits granted to the user.
giftBalanceRemaining gift credits.
resetAtEarliest active subscription credit expiration timestamp in milliseconds, or null.

Integration guidance

  • Use totalBalance for high-level balance checks.
  • Use bucket-specific fields when your UI needs to explain subscription vs. gift credit usage.
  • Refresh the balance after credit-consuming operations because balanceAfter may differ from a previously cached value.
  • Treat resetAt as nullable. Some accounts may only have gift credits or no active subscription credit expiration.

Error responses

  • 401 Unauthorized
  • 429 Too Many Requests

Notes

  • resetAt is a timestamp in milliseconds for the earliest active subscription credit expiration, or null.
  • Subscription credits are consumed before gift credits.
  • See Credits and access for shared credit behavior.