PT EN

Organizações: Acções

URL base: $BUSINESS_API

Pedir para retirar uma conta

Registos

DELETE /organizations/{organizationID}/accounts/{tenantID}

Schedule removal of an account after the configured notice period

Moves an active link to removal_pending and sets notice_period_until to now plus the deployment's configured notice period. Access ends when a scheduled sweep runs after that date, and the account keeps its data and ownership. Either an organization owner with organization:accounts:manage or an owner of the account itself may call it. If the organization pays for the account, direct billing is scheduled for the deadline and the account's owners are notified. Returns 202 with the updated link, 404 when there is no active link between the two, and 400 when the link is not active.

Parâmetros

organizationIDstring · caminho · obrigatório

ID of the organization the account is linked to.

tenantIDstring · caminho · obrigatório

ID of the linked account (utility workspace) to remove from the organization.

Devolve

202 Account link removal scheduled; account ownership and data are retained

Mostrar atributos
idstring · obrigatório
organization_idstring · obrigatório
tenant_idstring · obrigatório
tenant_namestring · opcional
tenant_slugstring · opcional
statestring · obrigatório

um de pending_consent, active, removal_pending, removed, owned

consent_approved_bystring · obrigatório
consent_approved_atstring (date-time) · opcional
added_bystring · obrigatório
notice_period_untilstring (date-time) · opcional
grantsobject · obrigatório

Erros 403 · 404

Permissões business:organization:read, organization:accounts:manage

curl -X DELETE "$BUSINESS_API/organizations/{organizationID}/accounts/{tenantID}" \
  -H "Authorization: Bearer sk_test_..."
Resposta 202
{
  "id": "org_2BfeY3PegjBaQbr8EdxWUjNy4BN",
  "organization_id": "org_2ZNeUPlw01Za6RbKMZDGGbR4cV5",
  "tenant_id": "ten_2ugFXIC316WXzGu1HGal90AxTA6",
  "tenant_name": "Ana Matsinhe",
  "tenant_slug": "tenant slug",
  "state": "pending_consent",
  "consent_approved_by": "consent approved by",
  "consent_approved_at": "2026-11-19T09:30:00Z",
  "added_by": "added by",
  "notice_period_until": "2026-11-19T09:30:00Z",
  "grants": {
    "key": [
      "value"
    ]
  }
}

Obter a carteira de uma organização

Registos

GET /organizations/{organizationID}/portfolio

Read aggregate account lifecycle counts permitted by organization grants

Returns only aggregate counts: the total number of accounts, plus counts by account status and by workspace state. No account details are included. Owners see the accounts the organization owns. For linked accounts in the active or removal_pending state, a caller's role is counted only when the account owner granted that role portfolio:read. Requires the organization:portfolio:read scope, and a closed organization returns 404.

Parâmetros

organizationIDstring · caminho · obrigatório

ID of the organization whose portfolio is summarised; it must equal the caller's active organization context.

Devolve

200 Aggregate counts only; linked accounts require explicit portfolio:read consent

Mostrar atributos
organization_idstring · obrigatório
account_countinteger · obrigatório
by_statusobject · obrigatório

Erros 403 · 404

Permissões organization:portfolio:read · Funções: account_analyst, account_owner

curl -X GET "$BUSINESS_API/organizations/{organizationID}/portfolio" \
  -H "Authorization: Bearer sk_test_..."
Resposta 200
{
  "organization_id": "org_2ZNeUPlw01Za6RbKMZDGGbR4cV5",
  "account_count": 1,
  "by_status": {
    "key": 1342
  }
}

Listar modelos de uma organização

Registos

GET /organizations/{organizationID}/templates

Returns the organization's setting templates, both draft and published, without pagination. Every caller needs the organization:accounts:read scope in the matching organization context. Listing drafts also requires an owner or admin with organization:accounts:manage, so other members must pass published_only=true. A closed organization returns 404.

Parâmetros

organizationIDstring · caminho · obrigatório

ID of the organization whose templates are listed; it must equal the caller's active organization context.

published_onlyboolean · consulta · opcional · predefinição false

Set to true to return only published templates; any other value or no value includes drafts, which only owners and admins may see.

Devolve

200 Organization templates visible in the active organization context

Mostrar atributos
keystring · obrigatório
versionstring · obrigatório
namestring · obrigatório
descriptionstring · opcional
settingsobject · obrigatório

Portable setting snapshots. Implemented kinds are tariffs, billing_schedules, automation_rules, notification_templates, and connector_definitions. Secret references, health state, customer data, and other tenant records are rejected or omitted; connectors are created disabled and schedules remain paused.

idstring · obrigatório
organization_idstring · obrigatório
statestring · obrigatório

um de draft, published

created_bystring · obrigatório
published_bystring · opcional
published_atstring (date-time) · opcional
created_atstring (date-time) · obrigatório

Erros 403

Permissões organization:accounts:manage, organization:accounts:read · Funções: account_admin, account_owner

curl -X GET "$BUSINESS_API/organizations/{organizationID}/templates" \
  -H "Authorization: Bearer sk_test_..."
Resposta 200
[
  {
    "key": "key",
    "version": "version",
    "name": "Ana Matsinhe",
    "description": "Leitura confirmada no local.",
    "settings": {},
    "id": "org_2sCTxsOpzeEdvmgLlwMjjwUVH08",
    "organization_id": "org_2ZNeUPlw01Za6RbKMZDGGbR4cV5",
    "state": "draft",
    "created_by": "created by",
    "published_by": "published by",
    "published_at": "2026-11-19T09:30:00Z",
    "created_at": "2026-11-19T09:30:00Z"
  }
]

Criar um modelo de organização

Registos

POST /organizations/{organizationID}/templates

Saves a new template in the draft state with a generated ID and returns it with 201. The body needs a key, version (up to 40 characters), name (up to 160 characters), an optional description (up to 1000 characters) and a non-empty settings map. Allowed settings keys are tariffs, billing_schedules, notification_templates, automation_rules, connector_definitions, roles, custom_fields, document_layouts, branding and domains. Each value must be valid JSON up to 256 KB and must not contain secrets; otherwise the call returns 400. Requires an owner or admin with organization:accounts:manage, and the organization must be active.

Parâmetros

organizationIDstring · caminho · obrigatório

ID of the organization that will own the template; it must equal the caller's active organization context.

Corpo application/json

keystring · obrigatório
versionstring · obrigatório
namestring · obrigatório
descriptionstring · opcional
settingsobject · obrigatório

Portable setting snapshots. Implemented kinds are tariffs, billing_schedules, automation_rules, notification_templates, and connector_definitions. Secret references, health state, customer data, and other tenant records are rejected or omitted; connectors are created disabled and schedules remain paused.

Devolve

201 Draft created

Mostrar atributos
keystring · obrigatório
versionstring · obrigatório
namestring · obrigatório
descriptionstring · opcional
settingsobject · obrigatório

Portable setting snapshots. Implemented kinds are tariffs, billing_schedules, automation_rules, notification_templates, and connector_definitions. Secret references, health state, customer data, and other tenant records are rejected or omitted; connectors are created disabled and schedules remain paused.

idstring · obrigatório
organization_idstring · obrigatório
statestring · obrigatório

um de draft, published

created_bystring · obrigatório
published_bystring · opcional
published_atstring (date-time) · opcional
created_atstring (date-time) · obrigatório

Erros 400 · 403

Permissões organization:accounts:manage · Funções: account_admin, account_owner

curl -X POST "$BUSINESS_API/organizations/{organizationID}/templates" \
  -H "Authorization: Bearer sk_test_..." \
  -H "Content-Type: application/json" \
  -d '{
  "key": "key",
  "version": "version",
  "name": "Ana Matsinhe",
  "description": "Leitura confirmada no local.",
  "settings": {}
}'
Resposta 201
{
  "key": "key",
  "version": "version",
  "name": "Ana Matsinhe",
  "description": "Leitura confirmada no local.",
  "settings": {},
  "id": "org_2sCTxsOpzeEdvmgLlwMjjwUVH08",
  "organization_id": "org_2ZNeUPlw01Za6RbKMZDGGbR4cV5",
  "state": "draft",
  "created_by": "created by",
  "published_by": "published by",
  "published_at": "2026-11-19T09:30:00Z",
  "created_at": "2026-11-19T09:30:00Z"
}

Publicar um modelo de organização

Registos

POST /organizations/{organizationID}/templates/{templateID}/publish

Checks a draft template against the settings it would apply, then marks it published with the publisher and time, records an audit entry and returns it. Published templates can be offered to member accounts. Only an organization owner with organization:accounts:manage may publish. A template that is not a draft returns 409, and an unknown template or closed organization returns 404.

Parâmetros

organizationIDstring · caminho · obrigatório

ID of the organization that owns the template; it must equal the caller's active organization context.

templateIDstring · caminho · obrigatório

ID of the draft template to publish.

Devolve

200 Published version

Mostrar atributos
keystring · obrigatório
versionstring · obrigatório
namestring · obrigatório
descriptionstring · opcional
settingsobject · obrigatório

Portable setting snapshots. Implemented kinds are tariffs, billing_schedules, automation_rules, notification_templates, and connector_definitions. Secret references, health state, customer data, and other tenant records are rejected or omitted; connectors are created disabled and schedules remain paused.

idstring · obrigatório
organization_idstring · obrigatório
statestring · obrigatório

um de draft, published

created_bystring · obrigatório
published_bystring · opcional
published_atstring (date-time) · opcional
created_atstring (date-time) · obrigatório

Erros 403 · 409

Permissões organization:accounts:manage · Funções: account_admin, account_owner

curl -X POST "$BUSINESS_API/organizations/{organizationID}/templates/{templateID}/publish" \
  -H "Authorization: Bearer sk_test_..."
Resposta 200
{
  "key": "key",
  "version": "version",
  "name": "Ana Matsinhe",
  "description": "Leitura confirmada no local.",
  "settings": {},
  "id": "org_2sCTxsOpzeEdvmgLlwMjjwUVH08",
  "organization_id": "org_2ZNeUPlw01Za6RbKMZDGGbR4cV5",
  "state": "draft",
  "created_by": "created by",
  "published_by": "published by",
  "published_at": "2026-11-19T09:30:00Z",
  "created_at": "2026-11-19T09:30:00Z"
}

Propor um modelo a uma conta

Registos

POST /organizations/{organizationID}/templates/{templateID}/adoptions

Creates a pending adoption of the template's current version for the account named by tenant_id in the body and returns it with 202. An owner of that account must then accept it. The template must be published, and a draft returns 409. Requires an owner or admin with organization:accounts:manage in the matching organization context, and an audit entry is recorded.

Parâmetros

organizationIDstring · caminho · obrigatório

ID of the organization that owns the template; it must equal the caller's active organization context.

templateIDstring · caminho · obrigatório

ID of the published organization template to offer.

Corpo application/json

tenant_idstring · obrigatório

Devolve

202 Adoption awaits explicit account-owner acceptance

Mostrar atributos
idstring · obrigatório
template_idstring · obrigatório
organization_idstring · obrigatório
tenant_idstring · obrigatório
versionstring · obrigatório
statestring · obrigatório

um de pending_acceptance, active, detached

accepted_bystring · opcional
accepted_atstring (date-time) · opcional
applied_atstring (date-time) · opcional
detached_atstring (date-time) · opcional
created_atstring (date-time) · obrigatório

Erros 403 · 404

Permissões organization:accounts:manage · Funções: account_admin, account_owner

curl -X POST "$BUSINESS_API/organizations/{organizationID}/templates/{templateID}/adoptions" \
  -H "Authorization: Bearer sk_test_..." \
  -H "Content-Type: application/json" \
  -d '{
  "tenant_id": "ten_2ugFXIC316WXzGu1HGal90AxTA6"
}'
Resposta 202
{
  "id": "org_27V0IXXc4PdUU9dGwVzoc5xWqTd",
  "template_id": "tem_2wwLTWQZrCq3poE3JiMXbI6xTEk",
  "organization_id": "org_2ZNeUPlw01Za6RbKMZDGGbR4cV5",
  "tenant_id": "ten_2ugFXIC316WXzGu1HGal90AxTA6",
  "version": "version",
  "state": "pending_acceptance",
  "accepted_by": "accepted by",
  "accepted_at": "2026-11-19T09:30:00Z",
  "applied_at": "2026-11-19T09:30:00Z",
  "detached_at": "2026-11-19T09:30:00Z",
  "created_at": "2026-11-19T09:30:00Z"
}

Definir o modo de facturação de uma organização

Registos

PUT /organizations/{organizationID}/billing

Choose account-level or organization-level subscription ownership

Only an organization owner can change billing mode. The change is audited.

Parâmetros

organizationIDstring · caminho · obrigatório

ID of the organization whose billing mode is changed; it must equal the caller's active organization context.

Corpo application/json

billing_modestring · obrigatório

um de account, organization

Devolve

200 Updated organization profile

Mostrar atributos
idstring · obrigatório
namestring · obrigatório
typestring · obrigatório

um de utility, authority, operator, regulator, partner, group

statusstring · obrigatório
utility_kindstring · opcional

um de authority, municipal, regional, national, rural, private, industrial

billing_modestring · obrigatório

um de account, organization

Erros 400 · 403

Permissões organization:billing:manage · Funções: account_owner

curl -X PUT "$BUSINESS_API/organizations/{organizationID}/billing" \
  -H "Authorization: Bearer sk_test_..." \
  -H "Content-Type: application/json" \
  -d '{
  "billing_mode": "account"
}'
Resposta 200
{
  "id": "org_2ZNeUPlw01Za6RbKMZDGGbR4cV5",
  "name": "Ana Matsinhe",
  "type": "utility",
  "status": "active",
  "utility_kind": "authority",
  "billing_mode": "account"
}

Obter a subscrição de uma organização

Registos

GET /organizations/{organizationID}/subscription

Returns the organization's own subscription: plan, status (for example trialing or active), current period and trial end. Requires the organization:billing:read scope in the matching organization context. Returns 404 when the organization has no subscription.

Parâmetros

organizationIDstring · caminho · obrigatório

ID of the organization; it must equal the caller's active organization context.

Devolve

200 Organization subscription and billing period

Mostrar atributos
idstring · obrigatório
organization_idstring · obrigatório
plan_idstring · obrigatório
statusstring · obrigatório

um de trialing, active, past_due, suspended, cancelled

current_period_startstring (date-time) · obrigatório
current_period_endstring (date-time) · obrigatório
cancel_at_period_endboolean · obrigatório
trial_ends_atstring (date-time) · opcional
past_due_sincestring (date-time) · opcional
suspended_atstring (date-time) · opcional
created_atstring (date-time) · opcional
updated_atstring (date-time) · opcional
by_workspace_stateobject · opcional

Erros 403 · 404

Permissões organization:billing:read · Funções: account_finance, account_owner

curl -X GET "$BUSINESS_API/organizations/{organizationID}/subscription" \
  -H "Authorization: Bearer sk_test_..."
Resposta 200
{
  "id": "org_2TJGGLnwsdLEujr8YxdEEn36uJN",
  "organization_id": "org_2ZNeUPlw01Za6RbKMZDGGbR4cV5",
  "plan_id": "pla_2lVU4nTwUfHw6nxUwjbOeRn8u5D",
  "status": "trialing",
  "current_period_start": "2026-11-19T09:30:00Z",
  "current_period_end": "2026-11-19T09:30:00Z",
  "cancel_at_period_end": true,
  "trial_ends_at": "2026-11-19T09:30:00Z",
  "past_due_since": "2026-11-19T09:30:00Z",
  "suspended_at": "2026-11-19T09:30:00Z",
  "created_at": "2026-11-19T09:30:00Z",
  "updated_at": "2026-11-19T09:30:00Z",
  "by_workspace_state": {
    "key": 1342
  }
}

Criar a subscrição de uma organização

Registos

POST /organizations/{organizationID}/subscription

Requires organization billing mode and the organization owner; the subscription covers administered member accounts.

Parâmetros

organizationIDstring · caminho · obrigatório

ID of the organization to subscribe; it must equal the caller's active organization context, and the caller must be an owner with organization:billing:manage.

Corpo application/json

plan_idstring · obrigatório

Devolve

201 Organization subscription created

Mostrar atributos
idstring · obrigatório
organization_idstring · obrigatório
plan_idstring · obrigatório
statusstring · obrigatório

um de trialing, active, past_due, suspended, cancelled

current_period_startstring (date-time) · obrigatório
current_period_endstring (date-time) · obrigatório
cancel_at_period_endboolean · obrigatório
trial_ends_atstring (date-time) · opcional
past_due_sincestring (date-time) · opcional
suspended_atstring (date-time) · opcional
created_atstring (date-time) · opcional
updated_atstring (date-time) · opcional
by_workspace_stateobject · opcional

Erros 403 · 409

Permissões organization:billing:manage · Funções: account_owner

curl -X POST "$BUSINESS_API/organizations/{organizationID}/subscription" \
  -H "Authorization: Bearer sk_test_..." \
  -H "Content-Type: application/json" \
  -d '{
  "plan_id": "pla_2lVU4nTwUfHw6nxUwjbOeRn8u5D"
}'
Resposta 201
{
  "id": "org_2TJGGLnwsdLEujr8YxdEEn36uJN",
  "organization_id": "org_2ZNeUPlw01Za6RbKMZDGGbR4cV5",
  "plan_id": "pla_2lVU4nTwUfHw6nxUwjbOeRn8u5D",
  "status": "trialing",
  "current_period_start": "2026-11-19T09:30:00Z",
  "current_period_end": "2026-11-19T09:30:00Z",
  "cancel_at_period_end": true,
  "trial_ends_at": "2026-11-19T09:30:00Z",
  "past_due_since": "2026-11-19T09:30:00Z",
  "suspended_at": "2026-11-19T09:30:00Z",
  "created_at": "2026-11-19T09:30:00Z",
  "updated_at": "2026-11-19T09:30:00Z",
  "by_workspace_state": {
    "key": 1342
  }
}

Listar facturas da subscrição de uma organização

Registos

GET /organizations/{organizationID}/subscription/invoices

Returns one cursor-paginated page of the invoices the platform issued to the organization for its subscription. Pass limit and after to page, and status to filter. Requires the organization:billing:read scope in the matching organization context.

Parâmetros

organizationIDstring · caminho · obrigatório

ID of the organization whose subscription invoices are listed; it must equal the caller's active organization context.

limitinteger · consulta · opcional

Maximum resources to return (default 20, maximum 100).

afterstring · consulta · opcional

Opaque cursor returned by the previous page.

Devolve

200 Organization invoices and account-level plan lines

Mostrar atributos
dataarray of PlatformInvoice · opcional
Mostrar atributos filhos
payment_methodsarray of string · opcional

The payment methods the platform accepts for this invoice; recording or proving a payment by any other is refused with payment.method_not_configured.

idstring · opcional
tenant_idstring · opcional
organization_idstring · opcional
subscription_idstring · opcional
numberstring · opcional
plan_idstring · opcional
period_startstring (date-time) · opcional
period_endstring (date-time) · opcional
linesarray of PlatformInvoiceLine · opcional
Mostrar atributos filhos
codestring · opcional

Stable line code: plan, account_plan, overage_connections, overage_users, proration. Clients word it with params and fall back to description.

descriptionstring · opcional
paramsobject · opcional

Values the code's wording fills in: plan; plan, account, pro_rata; over, included (account, pro_rata); from, to.

tenant_idstring · opcional

Account covered by this line

plan_idstring · opcional

Plan applied to this account

quantitynumber · opcional
unit_price_centsinteger · opcional
amount_centsinteger · opcional
total_centsinteger · opcional
balance_centsinteger · opcional
currencystring · opcional
statusstring · opcional

um de open, paid, void

issued_atstring (date-time) · opcional
due_atstring (date-time) · opcional
paid_atstring (date-time) · opcional
has_moreboolean · opcional
next_cursorstring · opcional

Erros 403

Permissões organization:billing:read · Funções: account_finance, account_owner

curl -X GET "$BUSINESS_API/organizations/{organizationID}/subscription/invoices" \
  -H "Authorization: Bearer sk_test_..."
Resposta 200
{
  "data": [
    {
      "payment_methods": [
        "payment method"
      ],
      "id": "pla_2FBOA71OWNnW0zzkW3NgMb7QEdr",
      "tenant_id": "ten_2ugFXIC316WXzGu1HGal90AxTA6",
      "organization_id": "org_2ZNeUPlw01Za6RbKMZDGGbR4cV5",
      "subscription_id": "sub_2vVmyFDcAD9ag9fGg1XkQfxiYTR",
      "number": "NUM-2026-000142",
      "plan_id": "pla_2lVU4nTwUfHw6nxUwjbOeRn8u5D",
      "period_start": "2026-11-19T09:30:00Z",
      "period_end": "2026-11-19T09:30:00Z",
      "lines": [
        {
          "code": "COD-2026-000142",
          "description": "Leitura confirmada no local.",
          "params": {
            "key": "value"
          },
          "tenant_id": "ten_2ugFXIC316WXzGu1HGal90AxTA6",
          "plan_id": "pla_2lVU4nTwUfHw6nxUwjbOeRn8u5D",
          "quantity": 1,
          "unit_price_cents": 125000,
          "amount_cents": 125000
        }
      ],
      "total_cents": 125000,
      "balance_cents": 125000,
      "currency": "MZN",
      "status": "open",
      "issued_at": "2026-11-19T09:30:00Z",
      "due_at": "2026-11-19T09:30:00Z",
      "paid_at": "2026-11-19T09:30:00Z"
    }
  ],
  "has_more": true,
  "next_cursor": "next cursor"
}

Obter uma factura da subscrição de uma organização

Registos

GET /organizations/{organizationID}/subscription/invoices/{id}

Returns one platform invoice issued to the organization. An invoice that belongs to another organization or to a single account returns 404. Requires the organization:billing:read scope in the matching organization context.

Parâmetros

organizationIDstring · caminho · obrigatório

ID of the organization that owns the invoice; it must equal the caller's active organization context.

idstring · caminho · obrigatório

ID of the platform invoice.

Devolve

200 Organization subscription invoice

Mostrar atributos
payment_methodsarray of string · opcional

The payment methods the platform accepts for this invoice; recording or proving a payment by any other is refused with payment.method_not_configured.

idstring · opcional
tenant_idstring · opcional
organization_idstring · opcional
subscription_idstring · opcional
numberstring · opcional
plan_idstring · opcional
period_startstring (date-time) · opcional
period_endstring (date-time) · opcional
linesarray of PlatformInvoiceLine · opcional
Mostrar atributos filhos
codestring · opcional

Stable line code: plan, account_plan, overage_connections, overage_users, proration. Clients word it with params and fall back to description.

descriptionstring · opcional
paramsobject · opcional

Values the code's wording fills in: plan; plan, account, pro_rata; over, included (account, pro_rata); from, to.

tenant_idstring · opcional

Account covered by this line

plan_idstring · opcional

Plan applied to this account

quantitynumber · opcional
unit_price_centsinteger · opcional
amount_centsinteger · opcional
total_centsinteger · opcional
balance_centsinteger · opcional
currencystring · opcional
statusstring · opcional

um de open, paid, void

issued_atstring (date-time) · opcional
due_atstring (date-time) · opcional
paid_atstring (date-time) · opcional

Erros 403 · 404

Permissões organization:billing:read · Funções: account_finance, account_owner

curl -X GET "$BUSINESS_API/organizations/{organizationID}/subscription/invoices/{id}" \
  -H "Authorization: Bearer sk_test_..."
Resposta 200
{
  "payment_methods": [
    "payment method"
  ],
  "id": "pla_2FBOA71OWNnW0zzkW3NgMb7QEdr",
  "tenant_id": "ten_2ugFXIC316WXzGu1HGal90AxTA6",
  "organization_id": "org_2ZNeUPlw01Za6RbKMZDGGbR4cV5",
  "subscription_id": "sub_2vVmyFDcAD9ag9fGg1XkQfxiYTR",
  "number": "NUM-2026-000142",
  "plan_id": "pla_2lVU4nTwUfHw6nxUwjbOeRn8u5D",
  "period_start": "2026-11-19T09:30:00Z",
  "period_end": "2026-11-19T09:30:00Z",
  "lines": [
    {
      "code": "COD-2026-000142",
      "description": "Leitura confirmada no local.",
      "params": {
        "key": "value"
      },
      "tenant_id": "ten_2ugFXIC316WXzGu1HGal90AxTA6",
      "plan_id": "pla_2lVU4nTwUfHw6nxUwjbOeRn8u5D",
      "quantity": 1,
      "unit_price_cents": 125000,
      "amount_cents": 125000
    }
  ],
  "total_cents": 125000,
  "balance_cents": 125000,
  "currency": "MZN",
  "status": "open",
  "issued_at": "2026-11-19T09:30:00Z",
  "due_at": "2026-11-19T09:30:00Z",
  "paid_at": "2026-11-19T09:30:00Z"
}

Listar planos para uma organização

Registos

GET /organizations/{organizationID}/plans

Returns the plans an organization can subscribe to, wrapped in a data array. Requires the organization:billing:read scope in the matching organization context (403 otherwise). The list is not paginated.

Parâmetros

organizationIDstring · caminho · obrigatório

ID of the organization browsing plans; it must equal the caller's active organization context.

limitinteger · consulta · opcional

Maximum resources to return (default 20, maximum 100).

afterstring · consulta · opcional

Opaque cursor returned by the previous page.

langstring · consulta · opcional

The language to answer plan text in, as a language tag (pt, en, pt-MZ). It wins over Accept-Language. A language without a translation falls back to the plan's default text.

Accept-Languagestring · cabeçalho · opcional

The caller's languages by preference, used when lang is not sent.

Devolve

200 Available platform plans, name, tagline and capability labels in the caller's language

Mostrar atributos
dataarray of Plan · opcional
Mostrar atributos filhos
idstring · opcional
codestring · opcional
namestring · opcional

Display name in the caller's language on reads

taglinestring · opcional

Tagline in the caller's language on reads

name_i18nobject · opcional

One text per language, keyed by language tag (pt, en, pt-MZ).

tagline_i18nobject · opcional

One text per language, keyed by language tag (pt, en, pt-MZ).

default_namestring · opcional

Platform plan list only; the default name behind a localised name

default_taglinestring · opcional

Platform plan list only; the default tagline

price_centsinteger · opcional
currencystring · opcional
max_connectionsinteger · opcional
max_usersinteger · opcional
max_accountsinteger · opcional

Maximum accounts owned by the subscribed organization's legal entity; 0 means no plan cap

max_sandboxesinteger · opcional
trial_daysinteger · opcional
overage_connection_centsinteger · opcional
overage_user_centsinteger · opcional
capabilitiesarray of string · opcional
capability_labelsarray of CapabilityLabel · opcional

The capabilities labelled in the caller's language (reads)

Mostrar atributos filhos
codestring · obrigatório
labelstring · obrigatório

The capability's label in the caller's language

publishedboolean · opcional
display_orderinteger · opcional
highlightedboolean · opcional
created_atstring (date-time) · opcional
offersarray of PlanOffer · opcional

Offers listed beside the plans; the custom offer (code custom) when a published plan has a connection limit.

Mostrar atributos filhos
codestring · obrigatório
labelstring · obrigatório

Title in the caller's language

textstring · obrigatório

One line in the caller's language

ctastring · obrigatório

The link's wording in the caller's language

label_i18nobject · opcional

One text per language, keyed by language tag (pt, en, pt-MZ).

text_i18nobject · opcional

One text per language, keyed by language tag (pt, en, pt-MZ).

cta_i18nobject · opcional

One text per language, keyed by language tag (pt, en, pt-MZ).

contact_pathstring · obrigatório

Path on the public site to contact sales

above_connectionsinteger · obrigatório

The active connection count the offer starts above

Erros 403

Permissões organization:billing:read · Funções: account_finance, account_owner

curl -X GET "$BUSINESS_API/organizations/{organizationID}/plans" \
  -H "Authorization: Bearer sk_test_..."
Resposta 200
{
  "data": [
    {
      "id": "pla_2lVU4nTwUfHw6nxUwjbOeRn8u5D",
      "code": "COD-2026-000142",
      "name": "Ana Matsinhe",
      "tagline": "tagline",
      "name_i18n": {
        "en": "Up to 100 customers",
        "pt": "Até 100 clientes"
      },
      "tagline_i18n": {
        "en": "Up to 100 customers",
        "pt": "Até 100 clientes"
      },
      "default_name": "Ana Matsinhe",
      "default_tagline": "default tagline",
      "price_cents": 125000,
      "currency": "MZN",
      "max_connections": 1,
      "max_users": 1,
      "max_accounts": 1,
      "max_sandboxes": 1,
      "trial_days": 1,
      "overage_connection_cents": 1,
      "overage_user_cents": 1,
      "capabilities": [
        "configure"
      ],
      "capability_labels": [
        {
          "code": "COD-2026-000142",
          "label": "label"
        }
      ],
      "published": true,
      "display_order": 1,
      "highlighted": true,
      "created_at": "2026-11-19T09:30:00Z"
    }
  ],
  "offers": [
    {
      "code": "custom",
      "label": "label",
      "text": "text",
      "cta": "cta",
      "label_i18n": {
        "en": "Up to 100 customers",
        "pt": "Até 100 clientes"
      },
      "text_i18n": {
        "en": "Up to 100 customers",
        "pt": "Até 100 clientes"
      },
      "cta_i18n": {
        "en": "Up to 100 customers",
        "pt": "Até 100 clientes"
      },
      "contact_path": "/contact?topic=sales",
      "above_connections": 1
    }
  ]
}

Encerrar uma organização

Registos

POST /organizations/{organizationID}/close

Marks an active organization as closed, detaches all organization memberships and records an audit entry, then returns the closed organization. Only an organization owner with the organization:accounts:manage scope may close it, and the body must name successor_member_id: another active owner, not the caller. A missing or invalid successor returns 409. The organization must be active (404 otherwise), and the call returns 409 while the organization still owns accounts that need to be transferred first.

Parâmetros

organizationIDstring · caminho · obrigatório

ID of the organization to close; it must equal the caller's active organization context.

Corpo application/json

successor_member_idstring · obrigatório

Devolve

200 Organization closed; linked accounts were detached and retained

Erros 403 · 409

Permissões organization:accounts:manage · Funções: account_admin, account_owner

curl -X POST "$BUSINESS_API/organizations/{organizationID}/close" \
  -H "Authorization: Bearer sk_test_..." \
  -H "Content-Type: application/json" \
  -d '{
  "successor_member_id": "suc_2jVWyrdmOLjMKhhC2nXY4nnW4nZ"
}'
Resposta 200

Organization closed; linked accounts were detached and retained

Obter as instruções de pagamento de uma organização

Registos

GET /organizations/{organizationID}/subscription/payment-instructions

Returns the payment instructions the platform operator has configured, such as bank or mobile money details, wrapped in a data array that is empty when none are set. Requires the organization:billing:read scope in the matching organization context.

Parâmetros

organizationIDstring · caminho · obrigatório

ID of the organization; it must equal the caller's active organization context.

Devolve

200 Organization payment instructions

Erros 403

Permissões organization:billing:read · Funções: account_finance, account_owner

curl -X GET "$BUSINESS_API/organizations/{organizationID}/subscription/payment-instructions" \
  -H "Authorization: Bearer sk_test_..."
Resposta 200

Organization payment instructions

Enviar um comprovativo de pagamento da organização

Registos

POST /organizations/{organizationID}/subscription/invoices/{id}/payment-proofs

Accepts a multipart/form-data upload with a file field (PDF, JPEG or PNG, up to 5 MB by default) and the form fields amount_cents, method, reference (up to 128 characters), paid_on (YYYY-MM-DD, not in the future) and an optional note (up to 500 characters). It stores the proof as pending for platform staff to review and returns 201. Only an organization owner with organization:billing:manage may submit. The invoice must be open (409 otherwise), the method must be one of the enabled platform payment methods, and an open proof with the same method and reference returns 409.

Parâmetros

organizationIDstring · caminho · obrigatório

ID of the organization paying the invoice; it must equal the caller's active organization context.

idstring · caminho · obrigatório

ID of the open platform invoice that the proof pays.

Devolve

201 Created; the proof waits for platform review

Erros 403 · 409

Permissões organization:billing:manage, organization:billing:read · Funções: account_owner

curl -X POST "$BUSINESS_API/organizations/{organizationID}/subscription/invoices/{id}/payment-proofs" \
  -H "Authorization: Bearer sk_test_..."
Resposta 201

Created; the proof waits for platform review

Listar comprovativos de pagamento da organização

Registos

GET /organizations/{organizationID}/subscription/payment-proofs

Returns one cursor-paginated page (limit, after) of the proofs of payment the organization has sent for its subscription invoices, with each proof's review status. Requires the organization:billing:read scope in the matching organization context.

Parâmetros

organizationIDstring · caminho · obrigatório

ID of the organization whose proofs are listed; it must equal the caller's active organization context.

invoice_idstring · consulta · opcional

Optional platform invoice ID; when set, only proofs sent for that invoice are returned.

statusstring · consulta · opcional

Optional review status filter: pending, approved or rejected.

um de pending, approved, rejected

limitinteger · consulta · opcional

Maximum resources to return (default 20, maximum 100).

afterstring · consulta · opcional

Opaque cursor returned by the previous page.

Devolve

200 Organization payment proofs

Erros 403

Permissões organization:billing:read · Funções: account_finance, account_owner

curl -X GET "$BUSINESS_API/organizations/{organizationID}/subscription/payment-proofs" \
  -H "Authorization: Bearer sk_test_..."
Resposta 200

Organization payment proofs

Descarregar um comprovativo de pagamento da organização

Registos

GET /organizations/{organizationID}/subscription/payment-proofs/{id}/file

Streams the stored proof file inline with its original content type and file name, using no-store caching and a sandboxing Content-Security-Policy. A proof that belongs to another organization, or whose file is no longer in storage, returns 404. Requires the organization:billing:read scope in the matching organization context.

Parâmetros

organizationIDstring · caminho · obrigatório

ID of the organization that sent the proof; it must equal the caller's active organization context.

idstring · caminho · obrigatório

ID of the subscription payment proof.

Devolve

200 The stored PDF

Erros 403 · 404

Permissões organization:billing:read · Funções: account_finance, account_owner

curl -X GET "$BUSINESS_API/organizations/{organizationID}/subscription/payment-proofs/{id}/file" \
  -H "Authorization: Bearer sk_test_..."
Resposta 200

The stored PDF