Retrieve customer billing state
const url = 'https://api.strent.dev/v1/customers/retrieve_billing_state';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"stripe_customer_id":"cus_123"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.strent.dev/v1/customers/retrieve_billing_state \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "stripe_customer_id": "cus_123" }'Returns detailed subscription, item, and schedule state for billing pages and inspection. Each subscription reports grants_access. This operation is outside the hot-path performance class and returns 200 even when the customer has never been refreshed, with last_refreshed_at: null.
This read-only POST operation is side-effect-free and semantically safe to retry, but clients should not retry automatically by default.
Authorizations
Section titled “ Authorizations ”Request Bodyrequired
Section titled “ Request Bodyrequired ”object
Example
{ "stripe_customer_id": "cus_123"}Responses
Section titled “ Responses ”Detailed billing state; last_refreshed_at is null when the customer has never been refreshed.
object
object
object
object
object
object
Stripe’s amount in the currency’s minor unit, for arithmetic. Null for tiered or decimal-only prices.
The same amount as an exact decimal string in whole currency units, such as “19.99” for usd 1999 or “2000” for jpy 2000. It has no currency symbol or locale separators: format it with Intl.NumberFormat and currency. Null exactly when unit_amount is null.
object
object
object
Stripe’s amount in the currency’s minor unit, for arithmetic. Null for tiered or decimal-only prices.
The same amount as an exact decimal string in whole currency units, such as “19.99” for usd 1999 or “2000” for jpy 2000. It has no currency symbol or locale separators: format it with Intl.NumberFormat and currency. Null exactly when unit_amount is null.
Example
{ "stripe_customer_id": "cus_123", "last_refreshed_at": "2026-08-14T09:30:00.000Z", "subscriptions": []}The request body is invalid.
object
object
object
Example
{ "error": { "code": "VALIDATION_FAILED", "message": "The request body is invalid.", "requestId": "req_123" }}The Authorization header or project API key is invalid.
object
object
object
Example
{ "error": { "code": "INVALID_AUTH_HEADER", "message": "The Authorization header or project API key is invalid.", "requestId": "req_123" }}The project API key has been revoked.
object
object
object
Example
{ "error": { "code": "API_KEY_REVOKED", "message": "The project API key has been revoked.", "requestId": "req_123" }}The request body is too large.
object
object
object
Example
{ "error": { "code": "VALIDATION_FAILED", "message": "The request body is too large.", "requestId": "req_123" }}The request failed.
object
object
object
Example
{ "error": { "code": "VALIDATION_FAILED", "message": "The request failed.", "requestId": "req_123" }}The project or pre-authentication rate limit was exceeded.
object
object
object
Example
{ "error": { "code": "RATE_LIMIT_EXCEEDED", "message": "The project or pre-authentication rate limit was exceeded.", "requestId": "req_123" }}Headers
Section titled “ Headers ”Seconds before another request is advised.
Strent could not complete the request.
object
object
object
Example
{ "error": { "code": "INTERNAL_ERROR", "message": "Strent could not complete the request.", "requestId": "req_123" }}