Skip to main content
A Contract’s status shows whether it is waiting to start, active or ended. Check the status before changing its terms or ending it.

Statuses

Contract status describes the agreement, not money. Check invoices and payments separately to see what was billed, paid or remains due.

Transitions

  • Create. Omitting started_at starts the Contract now. A future timestamp creates a pending Contract.
  • Activate. A pending Contract becomes active at its start. On a pending Contract, updating started_at to the current time or earlier activates it.
  • End. DELETE /contracts/{external_id} ends the lifecycle. It cancels a pending Contract and terminates an active one. It does not delete the record. See End or cancel a Contract.
Do not try to set status directly. The field is read-only. Use the documented actions and date fields.

Example

A Contract scheduled to start on January 1, 2027 is pending before that date and active from it. Ending it while pending sets canceled and fills canceled_at. Ending it while active sets terminated and fills terminated_at.

What each status allows

Canceled and terminated Contracts are history. Retrieve a specific record with its external_id and contract_code.

Retrieve a specific Contract

Each Contract has a required contract_code. Use GET /contracts/{external_id}?contract_code={contract_code} to retrieve that specific Contract, including after it has ended. After a Contract ends, a new Contract can use the same external_id. Only one pending or active Contract can use it at a time, but several terminated or canceled Contracts can share it. A status alone does not identify which historical Contract you want. For example, these three Contracts can share contract_example: To retrieve the 2026 Contract, pass contract_code=contract_example_2026. If several Contracts share the external_id, you must provide contract_code. Lago does not automatically select the pending or active Contract. Use this selector for current usage, ending a Contract and requests for its applied Rate Cards or phases too. Pass contract_code as a query parameter to target the specific Contract.

List Contracts by status

GET /contracts accepts status[] and defaults to active. Pass several values to list more.

Contract dates

Check the status

Retrieve the Contract using its external_id and contract_code after changing its start or ending it. Check its status and the corresponding dates. Review invoices and payments separately to check financial outcomes.

End or cancel a Contract

End the billing timeline and review billing records.

Contracts

Start date, anchor and inherited terms.

Retrieve a Contract (API)

GET /contracts/{external_id}

List Contracts (API)

GET /contracts