PT EN

Billing

Eventos de Billing: 12 no total. Ver o envelope comum.

billing_run.executed

A billing run finished.

Recurso: billing_run

Não suportado por `events trigger` (use o fluxo normal da API).

Exemplo de payload
{
  "id": "wev_hpDL3x7Rxpn8ZWSraVQK8c76DqS",
  "type": "billing_run.executed",
  "api_version": "v1",
  "tenant_id": "ten_dMtYBHqoMswJA34fM24koBkTzKe",
  "created_at": "2026-11-19T09:30:00Z",
  "data": {
    "resource_type": "billing_run",
    "resource_id": "brn_hpDL3x7RxpnFuqFkrVc7h4j7aay",
    "resource": {
      "type": "billing_run",
      "id": "brn_hpDL3x7RxpnFuqFkrVc7h4j7aay",
      "sequence": 1
    }
  }
}

billing_schedule.created

A billing schedule was created.

Recurso: billing_schedule

Não suportado por `events trigger` (use o fluxo normal da API).

Exemplo de payload
{
  "id": "wev_hpDL3x7RmtWvFESrq9CN5ThL2PT",
  "type": "billing_schedule.created",
  "api_version": "v1",
  "tenant_id": "ten_dMtYBHqoMswJA34fM24koBkTzKe",
  "created_at": "2026-11-19T09:30:00Z",
  "data": {
    "resource_type": "billing_schedule",
    "resource_id": "bsc_hpDL3x7RmtWvFESrX2ZhHoxhpc5",
    "resource": {
      "type": "billing_schedule",
      "id": "bsc_hpDL3x7RmtWvFESrX2ZhHoxhpc5",
      "sequence": 1
    }
  }
}

billing_schedule.updated

A billing schedule changed.

Recurso: billing_schedule

Não suportado por `events trigger` (use o fluxo normal da API).

Exemplo de payload
{
  "id": "wev_hpDL3x7RmtWvFESrqDUXCasrWE6",
  "type": "billing_schedule.updated",
  "api_version": "v1",
  "tenant_id": "ten_dMtYBHqoMswJA34fM24koBkTzKe",
  "created_at": "2026-11-19T09:30:00Z",
  "data": {
    "resource_type": "billing_schedule",
    "resource_id": "bsc_hpDL3x7RmtWvFESrX2ZhHoxhpc5",
    "resource": {
      "type": "billing_schedule",
      "id": "bsc_hpDL3x7RmtWvFESrX2ZhHoxhpc5",
      "sequence": 1
    }
  }
}

invoice.adjusted

A credit or debit note changed an invoice.

Recurso: invoice

Não suportado por `events trigger` (use o fluxo normal da API).

Exemplo de payload
{
  "id": "wev_fHugZN3NkFtbtRCYwAevcUkVpVF",
  "type": "invoice.adjusted",
  "api_version": "v1",
  "tenant_id": "ten_dMtYBHqoMswJA34fM24koBkTzKe",
  "created_at": "2026-11-19T09:30:00Z",
  "data": {
    "resource_type": "invoice",
    "resource_id": "inv_fHugZN3VrLNRGcQztt9Z7PCX7RG",
    "resource": {
      "type": "invoice",
      "id": "inv_fHugZN3VrLNRGcQztt9Z7PCX7RG",
      "sequence": 1
    }
  }
}

invoice.issued

An invoice was issued, by hand or by a billing run.

Recurso: invoice

Disparar na CLI: gotactl events trigger invoice.issued

Exemplo de payload
{
  "id": "wev_fHugZN3NJqbpAXWTkrw2CHiWT3A",
  "type": "invoice.issued",
  "api_version": "v1",
  "tenant_id": "ten_dMtYBHqoMswJA34fM24koBkTzKe",
  "created_at": "2026-11-19T09:30:00Z",
  "data": {
    "resource_type": "invoice",
    "resource_id": "inv_fHugZN3VrLNRGcQYYcigzJZK54b",
    "resource": {
      "type": "invoice",
      "id": "inv_fHugZN3VrLNRGcQYYcigzJZK54b",
      "sequence": 1
    }
  }
}

invoice.paid

An invoice reached a zero balance and is paid.

Recurso: invoice

Disparar na CLI: gotactl events trigger invoice.paid

Exemplo de payload
{
  "id": "wev_fHugZN3NejcvvpJfmmimho23KWi",
  "type": "invoice.paid",
  "api_version": "v1",
  "tenant_id": "ten_dMtYBHqoMswJA34fM24koBkTzKe",
  "created_at": "2026-11-19T09:30:00Z",
  "data": {
    "resource_type": "invoice",
    "resource_id": "inv_fHugZN3VrLNRGcQ7w4rmjzaM8jJ",
    "resource": {
      "type": "invoice",
      "id": "inv_fHugZN3VrLNRGcQ7w4rmjzaM8jJ",
      "sequence": 1
    }
  }
}

invoice.reconciled

An estimated invoice was reconciled with a reading.

Recurso: invoice

Não suportado por `events trigger` (use o fluxo normal da API).

Exemplo de payload
{
  "id": "wev_fHugZN3NGxYdGwd2FPeV2a4e92W",
  "type": "invoice.reconciled",
  "api_version": "v1",
  "tenant_id": "ten_dMtYBHqoMswJA34fM24koBkTzKe",
  "created_at": "2026-11-19T09:30:00Z",
  "data": {
    "resource_type": "invoice",
    "resource_id": "inv_fHugZN3VrLNRGcQiqd7bPihudgZ",
    "resource": {
      "type": "invoice",
      "id": "inv_fHugZN3VrLNRGcQiqd7bPihudgZ",
      "sequence": 1
    }
  }
}

invoice.status_changed

An invoice changed status.

Recurso: invoice

Não suportado por `events trigger` (use o fluxo normal da API).

Exemplo de payload
{
  "id": "wev_fHugZN3NTTpwMbXSzZQApZb38gc",
  "type": "invoice.status_changed",
  "api_version": "v1",
  "tenant_id": "ten_dMtYBHqoMswJA34fM24koBkTzKe",
  "created_at": "2026-11-19T09:30:00Z",
  "data": {
    "resource_type": "invoice",
    "resource_id": "inv_fHugZN3VrLNRGcQXBGBdM5adFYR",
    "resource": {
      "type": "invoice",
      "id": "inv_fHugZN3VrLNRGcQXBGBdM5adFYR",
      "sequence": 1
    }
  }
}

invoice.voided

An invoice was voided.

Recurso: invoice

Não suportado por `events trigger` (use o fluxo normal da API).

Exemplo de payload
{
  "id": "wev_fHugZN3N3MRs9QY2d8d3aUaftYH",
  "type": "invoice.voided",
  "api_version": "v1",
  "tenant_id": "ten_dMtYBHqoMswJA34fM24koBkTzKe",
  "created_at": "2026-11-19T09:30:00Z",
  "data": {
    "resource_type": "invoice",
    "resource_id": "inv_fHugZN3VrLNRGcQwT2BEBhEK2NS",
    "resource": {
      "type": "invoice",
      "id": "inv_fHugZN3VrLNRGcQwT2BEBhEK2NS",
      "sequence": 1
    }
  }
}

invoice.written_off

An unpaid balance was written off as bad debt.

Recurso: invoice

Não suportado por `events trigger` (use o fluxo normal da API).

Exemplo de payload
{
  "id": "wev_fHugZN3NEJiAYVcsyDMWai2GGLW",
  "type": "invoice.written_off",
  "api_version": "v1",
  "tenant_id": "ten_dMtYBHqoMswJA34fM24koBkTzKe",
  "created_at": "2026-11-19T09:30:00Z",
  "data": {
    "resource_type": "invoice",
    "resource_id": "inv_fHugZN3VrLNRGcQkFUdjpnFKAwA",
    "resource": {
      "type": "invoice",
      "id": "inv_fHugZN3VrLNRGcQkFUdjpnFKAwA",
      "sequence": 1
    }
  }
}

tariff.activated

A tariff version was activated.

Recurso: tariff

Não suportado por `events trigger` (use o fluxo normal da API).

Exemplo de payload
{
  "id": "wev_daLjYyHHhpDXyo4aY7K36Vnhaer",
  "type": "tariff.activated",
  "api_version": "v1",
  "tenant_id": "ten_dMtYBHqoMswJA34fM24koBkTzKe",
  "created_at": "2026-11-19T09:30:00Z",
  "data": {
    "resource_type": "tariff",
    "resource": {
      "type": "tariff",
      "sequence": 1
    }
  }
}

tariff.created

A tariff version was created.

Recurso: tariff

Não suportado por `events trigger` (use o fluxo normal da API).

Exemplo de payload
{
  "id": "wev_daLjYyHtjHRDVCvUbnqptWda6No",
  "type": "tariff.created",
  "api_version": "v1",
  "tenant_id": "ten_dMtYBHqoMswJA34fM24koBkTzKe",
  "created_at": "2026-11-19T09:30:00Z",
  "data": {
    "resource_type": "tariff",
    "resource": {
      "type": "tariff",
      "sequence": 1
    }
  }
}

Receber estes eventos

O seu endpoint de webhook recebe cada um destes eventos num POST com o envelope comum, descrito na tabela abaixo. Verifique a assinatura antes de agir, responda depressa com um código 2xx e faça o trabalho depois: uma resposta lenta ou falhada é enviada outra vez. O mesmo evento pode chegar mais de uma vez, por isso use o seu id para ignorar repetições.

CampoTipoSignificado
idstringIdentificador do evento; o mesmo em todas as tentativas de entrega.
typestringO nome do evento, por exemplo invoice.issued.
api_versionstringA versão da API em que o corpo é escrito.
tenant_idstringA empresa (espaço de trabalho) onde o evento aconteceu.
created_atstring (RFC 3339)Quando o evento foi registado.
request_idstringO pedido à API que causou a mudança, quando houve um; liga ao registo de pedidos.
data.resource_typestringO tipo do recurso que mudou.
data.resource_idstringO identificador desse recurso, para o ler na API.
data.attributesobjectCampos próprios de cada evento; podem não existir. Leia o recurso na API para o estado completo.
data.resource.sequenceintegerConta os eventos do mesmo recurso; ignore um evento que não seja mais recente do que o último que aplicou.

Outras categorias de eventos