> ## Documentation Index
> Fetch the complete documentation index at: https://lago-ftr-wallet-improvements.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# The event object

> Events represents usage measurement sent to lago application that will then be aggregated into invoice line items.

<RequestExample>
  ```json The event object
  {
    "event": {
      "lago_id": "b7ab2926-1de8-4428-9bcd-779314ac129b",
      "transaction_id": "transaction_1234567890",
      "lago_customer_id": "99a6094e-199b-4101-896a-54e927ce7bd7",
      "external_customer_id": "5eb02857-a71e-4ea2-bcf9-57d3a41bc6ba",
      "code": "storage",
      "timestamp": "2022-04-29T08:59:51Z",
      "properties": {
        "gb": 10
      },
      "lago_subscription_id": "b7ab2926-1de8-4428-9bcd-779314ac129b",
      "external_subscription_id": "sub_1234567890",
      "created_at": "2022-04-29T08:59:51Z"
    }
  }
  ```
</RequestExample>

## Attributes

<ResponseField name="event" type="object">
  <Expandable title="object" defaultOpen="true">
    <ResponseField name="lago_subscription_id" type="string" required>
      Unique identifier assigned to the subscription within the Lago application.
      This ID is exclusively created by Lago and serves as a unique identifier for the subscription’s
      record within the Lago system.
    </ResponseField>

    <ResponseField name="transaction_id" type="string" required>
      This field represents a unique identifier for the event. It is crucial for ensuring idempotency,
      meaning that each event can be uniquely identified and processed without causing any unintended side effects.
    </ResponseField>

    <ResponseField name="external_customer_id (deprecated)" type="string">
      The customer external unique identifier (provided by your own application).
      This field is optional if you send the `external_subscription_id`, targeting a specific subscription.

      <Warning>This field is deprecated and is no longer supported or maintained. Please use the `external_subscription_id` instead.</Warning>
    </ResponseField>

    <ResponseField name="external_subscription_id" type="string" required>
      The unique identifier of the subscription within your application.
      It is a mandatory field when the customer possesses multiple subscriptions or when the `external_customer_id`
      is not provided.
    </ResponseField>

    <ResponseField name="code" type="string" required>
      The code that identifies a targeted billable metric. It is essential that this code matches the `code` property of one
      of your active billable metrics. If the provided code does not correspond to any active billable metric,
      it will be ignored during the process.
    </ResponseField>

    <ResponseField name="timestamp" type="integer">
      This field captures the Unix timestamp in seconds indicating the occurrence of the event in
      Coordinated Universal Time (UTC). If this timestamp is not provided, the API will automatically set it
      to the time of event reception.
    </ResponseField>

    <ResponseField name="properties" type="object">
      <Expandable title="properties">
        <ResponseField name="operation_type" type="string">
          The `operation_type` field is only necessary when adding or removing a specific unit when the
          targeted billable metric adopts a `unique_count_agg` aggregation method.
          In other cases, the `operation_type` field is not required. The valid values for the `operation_type` field are `add` or `remove`,
          which indicate whether the unit is being added or removed from the unique count aggregation, respectively.
        </ResponseField>
      </Expandable>
    </ResponseField>

    <ResponseField name="created_at" type="string" required>
      The creation date of the event's record in the Lago application, presented in the ISO 8601 datetime format,
      specifically in Coordinated Universal Time (UTC). It provides the precise timestamp of when the event's record
      was created within the Lago application.
    </ResponseField>
  </Expandable>
</ResponseField>
