Retrieve account billing details
Returns the subscription billing snapshot of the authenticated company: base plan subscription (status, trial, current period end, pending plan change), gestoría seats subscription (quantity, active managed companies, per-seat cost with VAT, recurring total, next invoice) and default payment method. Managed companies (plan gestionada) receive managed: true without the master's billing data. Amounts are integer cents; unresolved amounts are null, never a misleading 0.
In: header
Header Parameters
Pin the API version (YYYY-MM-DD, Stripe-style date versioning) for this request; omit to use the key's pinned version, or the latest if none. Unsupported version → 400 unsupported_api_version; malformed → 400 parameter_invalid_format. The effective version is echoed in the Factuarea-Version response header. See the Versioning guide.
dateOperate on behalf of a child company (gestoría master key): pass its public id (UUID v7) and the request runs against that child's data without changing the key's scope, tier or environment (omit to use the key's own company). Invalid UUID → 400 parameter_invalid_uuid; unknown or non-owned id → 404 profile_not_found. See the Acting on behalf guide.
uuidResponse Body
application/json
application/json
application/json
application/json
application/json
import { Factuarea } from "@factuarea/sdk";const factuarea = new Factuarea({ apiKey: process.env.FACTUAREA_API_KEY! });const result = await factuarea.account.billing();{
"data": {
"object": "account_billing",
"managed": false,
"plan": {
"slug": "empresario",
"name": "Empresario",
"status": "active",
"billing_interval": "month",
"is_trialing": false,
"trial_days_remaining": 0,
"is_on_grace_period": false,
"grace_period_days_remaining": 0,
"current_period_end": "2026-08-01T09:12:00+00:00",
"ends_at": "2019-08-24T14:15:22Z",
"pending_change": {
"slug": "emprendedor",
"name": "Emprendedor",
"effective_at": "2026-08-01T09:12:00+00:00",
"billing_interval": "month"
}
},
"gestoria_seats": {
"status": "active",
"quantity": 4,
"active_companies": 4,
"unit_amount": 1500,
"tax_rate": 21,
"tax_amount": 315,
"total_per_seat": 1815,
"recurring_total": 7260,
"currency": "EUR",
"billing_interval": "month",
"next_invoice_at": "2026-07-15T10:00:00+00:00",
"ends_at": "2019-08-24T14:15:22Z"
},
"payment_method": {
"brand": "visa",
"last_four": "4242"
}
}
}{
"error": {
"type": "authentication_error",
"code": "missing_api_key",
"message": "No se ha proporcionado una API key válida en el header Authorization.",
"param": null,
"doc_url": "https://docs.factuarea.com/guides/errors#missing_api_key",
"request_id": "req_01HKQS5N8VR7QXJ9K3T6BWPMZA"
}
}{
"error": {
"type": "authorization_error",
"code": "insufficient_scope",
"message": "Esta API key no tiene el scope requerido para esta operación.",
"param": null,
"doc_url": "https://docs.factuarea.com/guides/errors#insufficient_scope",
"request_id": "req_01HKQS5NBC3P8M1KX4V7SLNHQD"
}
}{
"error": {
"type": "rate_limit_error",
"code": "rate_limit_exceeded",
"message": "Has excedido el rate limit de 60 peticiones por minuto. Reintenta tras 30 segundos.",
"param": null,
"doc_url": "https://docs.factuarea.com/guides/errors#rate_limit_exceeded",
"request_id": "req_01HKQS5NKW1C6W9T4G5H0JBZVL"
}
}{
"error": {
"type": "api_error",
"code": "internal_error",
"message": "Ha ocurrido un error inesperado. Si persiste, contacta con soporte adjuntando el request_id.",
"param": null,
"doc_url": "https://docs.factuarea.com/guides/errors#internal_error",
"request_id": "req_01HKQS5NLX2D7X0U5H6J1KCAWM"
}
}