Skip to main content
Cancel a pending Contract before it starts, or terminate an active Contract to end its billing timeline. Lago keeps the Contract record and billing history.

Before you end a Contract

  1. Retrieve the live Contract, save its contract_code and check its status and dates.
  2. Decide between a scheduled end and an immediate end. They are not interchangeable:
    • A scheduled end is the Contract’s ended_at. It must be after the start and not already in the past.
    • An immediate end is DELETE /contracts/{external_id}.
  3. Check the open period in current usage if the Contract is active.

End the Contract immediately

DELETE /contracts/{external_id} ends the Contract lifecycle. It does not delete the record.
Ending a Contract is irreversible. A pending Contract becomes canceled and never starts billing. An active Contract becomes terminated and stops billing from that point, which can produce final fees. Review the Contract and its open usage before you send the request.
Your API key needs contract write permission. Pass the saved contract_code to select the Contract, especially when its external_id has been reused.
The response returns the Contract with its new status.

Check final billing

After the Contract ends, check its status and review any fees and invoices for the closing billing period. The amounts depend on the billing configuration and the period being closed.
  1. Retrieve the ended Contract with GET /contracts/{external_id}?contract_code={contract_code}, using the code you saved. Check that its status is terminated or canceled. This selects the same Contract even if its external_id has since been reused.
  2. List the customer’s invoices and inspect their fees and service periods.
Review invoices, credit notes and refunds separately. Ending a Contract does not by itself confirm that money was collected or returned.
Retrieve the terminated contract
See Contract lifecycle for identifier reuse and historical Contracts.

Contract lifecycle

Statuses and transitions.

Invoices

Check what was billed.

Delete a Contract (API)

DELETE /contracts/{external_id}

Retrieve a Contract (API)

GET /contracts/{external_id}