PT EN

Casos de cobrança

URL base: $CONSUMER_API

O objecto

idstring · obrigatório
tenant_idstring · obrigatório
customer_idstring · obrigatório
customer_namestring · opcional

Display name of the referenced customer. Omitted when unknown.

account_idstring · obrigatório
account_numberstring · opcional

Number of the referenced account, e.g. CTA-000044. Omitted when unknown.

account_holder_namestring · opcional

Display name of the customer who holds the referenced account. Omitted when unknown.

total_debt_centsinteger (int64) · obrigatório
currencystring · obrigatório
aging_bucketstring · obrigatório

um de current, 30_days, 60_days, 90_days, 120_days_plus

statusstring · obrigatório

um de open, notice_sent, payment_plan_active, enforcement_requested, resolved, written_off

notesstring · opcional

The case log rendered as text, one note per line. Kept for older clients and search; prefer note_entries.

note_entriesarray of CollectionCaseNote · opcional

The case log as entries, oldest first. A case written before entries existed has its whole notes text as one entry without a code.

Mostrar atributos filhos
atstring (date-time) · obrigatório
actor_idstring · opcional
codestring · opcional

Stable code of a note the server wrote (collection.case.opened_for_cutoff, collection.case.resolved, collection.case.enforcement_requested, collection.case.reopened_reversal); clients word it and fall back to text. Absent for notes people typed.

paramsobject · opcional

Values the code's wording fills in: reason (resolved, enforcement_requested), payment (reopened_reversal).

textstring · obrigatório

The note as typed, or the server's wording of code.

dunning_levelinteger · obrigatório
dunning_statusstring · opcional

um de in_notice, cutoff_pending, disconnected, settled

connection_idstring · opcional
connection_holder_namestring · opcional

Display name of the customer who holds the referenced connection. Omitted when unknown.

cutoff_order_idstring · opcional
reconnect_order_idstring · opcional
created_atstring (date-time) · obrigatório
updated_atstring (date-time) · obrigatório
O objecto
{
  "id": "col_2Zzko7TconRiwLFAepryspvaAXL",
  "tenant_id": "ten_2ugFXIC316WXzGu1HGal90AxTA6",
  "customer_id": "cus_2UuXtOGTHWKlvkoF5so5Joi3Hck",
  "customer_name": "Ana Matsinhe",
  "account_id": "act_2JFioNDgIfvkgflk8RtcqhBaARP",
  "account_number": "ACC-2026-000142",
  "account_holder_name": "Ana Matsinhe",
  "total_debt_cents": 125000,
  "currency": "MZN",
  "aging_bucket": "current",
  "status": "open",
  "notes": "Leitura confirmada no local.",
  "note_entries": [
    {
      "at": "2026-11-19T09:30:00Z",
      "actor_id": "act_2HXCuXB4S938w5lomxpoS73e8fr",
      "code": "COD-2026-000142",
      "params": {
        "key": "value"
      },
      "text": "text"
    }
  ],
  "dunning_level": 1,
  "dunning_status": "in_notice",
  "connection_id": "con_2wuJTWy9FOCTPGA3noGbHegbLaU",
  "connection_holder_name": "Ana Matsinhe",
  "cutoff_order_id": "cut_242PpqM5vCQBPkUpDe2pnkSb7MC",
  "reconnect_order_id": "rec_2WinfG4fbWCx7oAXJyqJniKJdW2",
  "created_at": "2026-11-19T09:30:00Z",
  "updated_at": "2026-11-19T09:30:00Z"
}

Listar casos de cobrança

Registos

GET /cases

Pages the collection (debt) cases on accounts linked to the caller, across tenants unless X-Tenant-ID selects one. Filter with account_id (which must be one of the caller's accounts) and status; pagination uses limit and after.

Parâmetros

limitinteger · consulta · opcional

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

afterstring · consulta · opcional

Opaque cursor returned by the previous page.

Devolve

200 Collection cases

curl -X GET "$CONSUMER_API/cases" \
  -H "Authorization: Bearer sk_test_..."
Resposta 200

Collection cases

Obter um caso de cobrança

Registos

GET /cases/{id}

Returns one collection (debt) case, with its debt, aging bucket, status, dunning state and notes, when it belongs to an account on which the caller holds the invoice.read account permission. The lookup searches every tenant where the caller holds such an account, unless X-Tenant-ID narrows it to one of them. A case on any other account, in any other tenant, or that does not exist returns 404, so existence never leaks. No staff scope is involved for a consumer caller; the access check is the account membership.

Parâmetros

idstring · caminho · obrigatório

Id of the collection case (prefix col).

X-Tenant-IDstring · cabeçalho · opcional

Narrow the lookup to one of the caller's tenants; a tenant the caller has no account in finds nothing.

Devolve

200 Collection case on one of the caller's accounts

Mostrar atributos
idstring · obrigatório
tenant_idstring · obrigatório
customer_idstring · obrigatório
customer_namestring · opcional

Display name of the referenced customer. Omitted when unknown.

account_idstring · obrigatório
account_numberstring · opcional

Number of the referenced account, e.g. CTA-000044. Omitted when unknown.

account_holder_namestring · opcional

Display name of the customer who holds the referenced account. Omitted when unknown.

total_debt_centsinteger (int64) · obrigatório
currencystring · obrigatório
aging_bucketstring · obrigatório

um de current, 30_days, 60_days, 90_days, 120_days_plus

statusstring · obrigatório

um de open, notice_sent, payment_plan_active, enforcement_requested, resolved, written_off

notesstring · opcional

The case log rendered as text, one note per line. Kept for older clients and search; prefer note_entries.

note_entriesarray of CollectionCaseNote · opcional

The case log as entries, oldest first. A case written before entries existed has its whole notes text as one entry without a code.

Mostrar atributos filhos
atstring (date-time) · obrigatório
actor_idstring · opcional
codestring · opcional

Stable code of a note the server wrote (collection.case.opened_for_cutoff, collection.case.resolved, collection.case.enforcement_requested, collection.case.reopened_reversal); clients word it and fall back to text. Absent for notes people typed.

paramsobject · opcional

Values the code's wording fills in: reason (resolved, enforcement_requested), payment (reopened_reversal).

textstring · obrigatório

The note as typed, or the server's wording of code.

dunning_levelinteger · obrigatório
dunning_statusstring · opcional

um de in_notice, cutoff_pending, disconnected, settled

connection_idstring · opcional
connection_holder_namestring · opcional

Display name of the customer who holds the referenced connection. Omitted when unknown.

cutoff_order_idstring · opcional
reconnect_order_idstring · opcional
created_atstring (date-time) · obrigatório
updated_atstring (date-time) · obrigatório

Erros 401 · 403 · 404

curl -X GET "$CONSUMER_API/cases/{id}" \
  -H "Authorization: Bearer sk_test_..."
Resposta 200
{
  "id": "col_2Zzko7TconRiwLFAepryspvaAXL",
  "tenant_id": "ten_2ugFXIC316WXzGu1HGal90AxTA6",
  "customer_id": "cus_2UuXtOGTHWKlvkoF5so5Joi3Hck",
  "customer_name": "Ana Matsinhe",
  "account_id": "act_2JFioNDgIfvkgflk8RtcqhBaARP",
  "account_number": "ACC-2026-000142",
  "account_holder_name": "Ana Matsinhe",
  "total_debt_cents": 125000,
  "currency": "MZN",
  "aging_bucket": "current",
  "status": "open",
  "notes": "Leitura confirmada no local.",
  "note_entries": [
    {
      "at": "2026-11-19T09:30:00Z",
      "actor_id": "act_2HXCuXB4S938w5lomxpoS73e8fr",
      "code": "COD-2026-000142",
      "params": {
        "key": "value"
      },
      "text": "text"
    }
  ],
  "dunning_level": 1,
  "dunning_status": "in_notice",
  "connection_id": "con_2wuJTWy9FOCTPGA3noGbHegbLaU",
  "connection_holder_name": "Ana Matsinhe",
  "cutoff_order_id": "cut_242PpqM5vCQBPkUpDe2pnkSb7MC",
  "reconnect_order_id": "rec_2WinfG4fbWCx7oAXJyqJniKJdW2",
  "created_at": "2026-11-19T09:30:00Z",
  "updated_at": "2026-11-19T09:30:00Z"
}