---
title: "An order has been executed"
method: POST
path: "order_executed"
---

# An order has been executed

`POST order_executed` (webhook)

An order has been carried out, and what it produced is listed in `execution_record`. For an `execute_in_lago` order that means the subscriptions, coupons, wallets or one-off invoice the quote described; an `order_only` order records the mode and the timestamp alone.
It is emitted on success only: a failed attempt is rolled back and leaves the order in the `failed` status with the reasons in `execution_record.errors`, without emitting anything.
The `billing_snapshot` returned by the REST endpoints is omitted from this payload, being a heavy blob; retrieve the order to get it.
This is a premium feature.

## Headers

- `X-Lago-Signature` string, required
- `X-Lago-Signature-Algorithm` 'jwt' | 'hmac', required
- `X-Lago-Unique-Key` string, uuid, required

## Payload

- object
  - `webhook_type` 'order.executed', required
  - `object_type` 'order', required
  - `organization_id` string, uuid, required: Unique identifier of the organization, created by Lago.
  - `order` OrderObject, required
    - `lago_id` string, uuid, required: Unique identifier of the order, created by Lago.
    - `number` string, required: The unique number assigned to the order by Lago.
    - `status` 'created' | 'executed' | 'failed', required: The status of the order. It can be any of the following values: - `created`: the order has been created from a signed order form and is waiting to be executed. - `executed`: the order has been carried out. What it produced is listed in `execution_record`. - `failed`: the execution was attempted and rolled back. The reasons are listed in `execution_record.errors`. Lago does not retry on its own, so a new attempt has to be triggered through the execute endpoint.
    - `order_type` 'subscription_creation' | 'subscription_amendment' | 'one_off', required: The commercial motion the quote describes. It can be any of the following values: - `subscription_creation`: the quote creates one or more subscriptions. - `subscription_amendment`: the quote amends an existing subscription, named by the quote's own `lago_subscription_id`. - `one_off`: the quote bills add-ons once, without any subscription.
    - `execution_mode` 'null' | 'execute_in_lago' | 'order_only', nullable, required: How the order is carried out. It is `null` while the order has neither been scheduled nor executed. It can be any of the following values: - `execute_in_lago`: Lago applies the quoted deal itself, creating the subscriptions, coupons, wallets or one-off invoice it describes. - `order_only`: Lago records the order without applying it, leaving the execution to your own systems.
    - `currency` 'null' | 'AED' | 'AFN' | 'ALL' | 'AMD' | 'ANG' | 'AOA' | 'ARS' | 'AUD' | 'AWG' | 'AZN' | 'BAM' | 'BBD' | 'BDT' | 'BGN' | 'BIF' | 'BMD' | 'BND' | 'BOB' | 'BRL' | 'BSD' | 'BWP' | 'BYN' | 'BZD' | 'CAD' | 'CDF' | 'CHF' | 'CLF' | 'CLP' | 'CNY' | 'COP' | 'CRC' | 'CVE' | 'CZK' | 'DJF' | 'DKK' | 'DOP' | 'DZD' | 'EGP' | 'ETB' | 'EUR' | 'FJD' | 'FKP' | 'GBP' | 'GEL' | 'GIP' | 'GMD' | 'GNF' | 'GTQ' | 'GYD' | 'HKD' | 'HNL' | 'HRK' | 'HTG' | 'HUF' | 'IDR' | 'ILS' | 'INR' | 'ISK' | 'JMD' | 'JPY' | 'KES' | 'KGS' | 'KHR' | 'KMF' | 'KRW' | 'KYD' | 'KZT' | 'LAK' | 'LBP' | 'LKR' | 'LRD' | 'LSL' | 'MAD' | 'MDL' | 'MGA' | 'MKD' | 'MMK' | 'MNT' | 'MOP' | 'MRO' | 'MUR' | 'MVR' | 'MWK' | 'MXN' | 'MYR' | 'MZN' | 'NAD' | 'NGN' | 'NIO' | 'NOK' | 'NPR' | 'NZD' | 'PAB' | 'PEN' | 'PGK' | 'PHP' | 'PKR' | 'PLN' | 'PYG' | 'QAR' | 'RON' | 'RSD' | 'RUB' | 'RWF' | 'SAR' | 'SBD' | 'SCR' | 'SEK' | 'SGD' | 'SHP' | 'SLL' | 'SOS' | 'SRD' | 'STD' | 'SYP' | 'SZL' | 'THB' | 'TJS' | 'TND' | 'TOP' | 'TRY' | 'TTD' | 'TWD' | 'TZS' | 'UAH' | 'UGX' | 'USD' | 'UYU' | 'UZS' | 'VND' | 'VUV' | 'WST' | 'XAF' | 'XCD' | 'XOF' | 'XPF' | 'YER' | 'ZAR' | 'ZMW', nullable, required
    - `executed_at` string, date-time, nullable, required: The date and time in UTC (ISO 8601) when the order was executed. It is `null` unless the `status` is `executed`.
    - `execution_record` OrderExecutionRecordObject, required: A trace of what the execution produced. Every key is always present, whichever the order type, so a reader never has to tell a missing key from an empty one; the keys that do not apply keep their empty value. Which ones are filled depends on the `order_type` of the quote, and only for an `execute_in_lago` order: `invoice_id` for `one_off`, `subscription_ids` with `applied_coupon_ids` and `wallet_ids` for `subscription_creation`, and the same plus `terminated_subscription_ids` for `subscription_amendment`. An `order_only` order records the mode and the timestamp alone.
      - `executed_at` string, date-time, nullable, required: The date and time in UTC (ISO 8601) when the execution succeeded. It is `null` until then, and stays `null` on a failed attempt.
      - `execution_mode` 'null' | 'execute_in_lago' | 'order_only', nullable, required: How the order is carried out. It is `null` while the order has neither been scheduled nor executed. It can be any of the following values: - `execute_in_lago`: Lago applies the quoted deal itself, creating the subscriptions, coupons, wallets or one-off invoice it describes. - `order_only`: Lago records the order without applying it, leaving the execution to your own systems.
      - `invoice_id` string, uuid, nullable, required: Unique identifier of the one-off invoice created by the execution, created by Lago. Only for a `one_off` order.
      - `subscription_ids` string[], required: Unique identifiers of the subscriptions created by the execution, created by Lago.
      - `terminated_subscription_ids` string[], required: Unique identifiers of the subscriptions terminated by the execution, created by Lago. Only for a `subscription_amendment` order, and only when the amendment took effect immediately and terminated the subscription it replaced. It stays empty for an amendment scheduled for the next billing period.
      - `applied_coupon_ids` string[], required: Unique identifiers of the coupons applied to the customer by the execution, created by Lago.
      - `wallet_ids` string[], required: Unique identifiers of the prepaid credit wallets created by the execution, created by Lago.
      - `errors` string[], required: The reasons why the execution failed. It is empty unless the `status` is `failed`.
    - `lago_organization_id` string, uuid, required: Unique identifier of the organization, created by Lago.
    - `lago_customer_id` string, uuid, required: Unique identifier of the customer the order was placed for, created by Lago.
    - `lago_order_form_id` string, uuid, required: Unique identifier of the signed order form the order comes from, created by Lago. An order form carries at most one order.
    - `created_at` string, date-time, required: The date and time in UTC (ISO 8601) when the order was created.
    - `updated_at` string, date-time, required: The date and time in UTC (ISO 8601) when the order was last updated.

## Acknowledgement `200`

Return a 200 status to indicate that the data was received successfully

---

[API](https://skmtc.dev/getlago/apis/lago-api-documentation.md) - [All operations](https://skmtc.dev/getlago/apis/lago-api-documentation/llms.txt) - [OpenAPI document](https://skmtc.dev/getlago/apis/lago-api-documentation/revisions/b216574b9612?raw)
