> ## Documentation Index
> Fetch the complete documentation index at: https://docs.dodopayments.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Get Event

> Get an event by its ID.



## OpenAPI

````yaml get /events/{event_id}
openapi: 3.1.0
info:
  title: public
  description: ''
  license:
    name: Apache 2.0
    url: https://www.apache.org/licenses/LICENSE-2.0
  version: 1.102.0
servers:
  - url: https://test.dodopayments.com/
    description: Test Mode Server Host
  - url: https://live.dodopayments.com/
    description: Live Mode Server Host
security: []
tags:
  - name: Products
  - name: Payments
  - name: Subscriptions
  - name: Addons
  - name: Customers
  - name: Refunds
  - name: Disputes
  - name: Events
  - name: License Keys
  - name: Entitlements
  - name: Licenses
  - name: Discounts
  - name: Meters
  - name: Credit Entitlements
  - name: Credit Entitlement Balances
  - name: Outgoing Webhooks
  - name: Checkout
  - name: Webhook Events
paths:
  /events/{event_id}:
    get:
      tags:
        - Events
      summary: Retrieve a specific event by its unique ID
      description: >-
        Fetch detailed information about a single event using its unique event
        ID. This endpoint is useful for:

        - Debugging specific event ingestion issues

        - Retrieving event details for customer support

        - Validating that events were processed correctly

        - Getting the complete metadata for an event


        ## Event ID Format:

        The event ID should be the same value that was provided during event
        ingestion via the `/events/ingest` endpoint.

        Event IDs are case-sensitive and must match exactly.


        ## Response Details:

        The response includes all event data including:

        - Complete metadata key-value pairs

        - Original timestamp (preserved from ingestion)

        - Customer and business association

        - Event name and processing information


        ## Example Usage:

        ```text

        GET /events/api_call_12345

        ```
      operationId: get_event_by_id
      parameters:
        - name: event_id
          in: path
          description: >-
            Unique event identifier (case-sensitive, must match the ID used
            during ingestion)
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Event retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Event'
        '401':
          description: Unauthorized - invalid or missing API key
        '404':
          description: >-
            Event not found - no event exists with the specified ID for your
            business
        '422':
          description: Unprocessable entity - invalid event ID format
      security:
        - API_KEY: []
      x-codeSamples:
        - lang: JavaScript
          source: |-
            import DodoPayments from 'dodopayments';

            const client = new DodoPayments({
              bearerToken: process.env['DODO_PAYMENTS_API_KEY'], // This is the default and can be omitted
            });

            const event = await client.usageEvents.retrieve('event_id');

            console.log(event.business_id);
        - lang: Python
          source: |-
            import os
            from dodopayments import DodoPayments

            client = DodoPayments(
                bearer_token=os.environ.get("DODO_PAYMENTS_API_KEY"),  # This is the default and can be omitted
            )
            event = client.usage_events.retrieve(
                "event_id",
            )
            print(event.business_id)
        - lang: Go
          source: "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/dodopayments/dodopayments-go\"\n\t\"github.com/dodopayments/dodopayments-go/option\"\n)\n\nfunc main() {\n\tclient := dodopayments.NewClient(\n\t\toption.WithBearerToken(\"My Bearer Token\"),\n\t)\n\tevent, err := client.UsageEvents.Get(context.TODO(), \"event_id\")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", event.BusinessID)\n}\n"
        - lang: Java
          source: >-
            package com.dodopayments.api.example;


            import com.dodopayments.api.client.DodoPaymentsClient;

            import com.dodopayments.api.client.okhttp.DodoPaymentsOkHttpClient;

            import com.dodopayments.api.models.usageevents.Event;

            import
            com.dodopayments.api.models.usageevents.UsageEventRetrieveParams;


            public final class Main {
                private Main() {}

                public static void main(String[] args) {
                    DodoPaymentsClient client = DodoPaymentsOkHttpClient.fromEnv();

                    Event event = client.usageEvents().retrieve("event_id");
                }
            }
        - lang: Kotlin
          source: >-
            package com.dodopayments.api.example


            import com.dodopayments.api.client.DodoPaymentsClient

            import com.dodopayments.api.client.okhttp.DodoPaymentsOkHttpClient

            import com.dodopayments.api.models.usageevents.Event

            import
            com.dodopayments.api.models.usageevents.UsageEventRetrieveParams


            fun main() {
                val client: DodoPaymentsClient = DodoPaymentsOkHttpClient.fromEnv()

                val event: Event = client.usageEvents().retrieve("event_id")
            }
        - lang: Ruby
          source: |-
            require "dodopayments"

            dodo_payments = Dodopayments::Client.new(
              bearer_token: "My Bearer Token",
              environment: "test_mode" # defaults to "live_mode"
            )

            event = dodo_payments.usage_events.retrieve("event_id")

            puts(event)
        - lang: PHP
          source: |-
            <?php

            require_once dirname(__DIR__) . '/vendor/autoload.php';

            use Dodopayments\Client;
            use Dodopayments\Core\Exceptions\APIException;

            $client = new Client(
              bearerToken: getenv('DODO_PAYMENTS_API_KEY') ?: 'My Bearer Token',
              environment: 'test_mode',
            );

            try {
              $event = $client->usageEvents->retrieve('event_id');

              var_dump($event);
            } catch (APIException $e) {
              echo $e->getMessage();
            }
        - lang: C#
          source: >-
            using System;

            using DodoPayments.Client;

            using DodoPayments.Client.Models.UsageEvents;


            DodoPaymentsClient client = new();


            UsageEventRetrieveParams parameters = new() { EventID = "event_id"
            };


            var event_ = await client.UsageEvents.Retrieve(parameters);


            Console.WriteLine(event_);
components:
  schemas:
    Event:
      type: object
      required:
        - event_id
        - business_id
        - customer_id
        - event_name
        - timestamp
      properties:
        business_id:
          type: string
        customer_id:
          type: string
        event_id:
          type: string
        event_name:
          type: string
        metadata:
          oneOf:
            - type: 'null'
            - $ref: '#/components/schemas/EventMetadata'
        timestamp:
          type: string
          format: date-time
    EventMetadata:
      type: object
      title: EventMetadata
      description: >-
        Arbitrary key-value metadata. Values can be string, integer, number, or
        boolean.
      additionalProperties:
        oneOf:
          - type: string
            title: String
          - type: integer
            title: Integer
            format: int64
          - type: number
            title: Number
            format: double
          - type: boolean
            title: Boolean
        title: Event Metadata Value
        description: Metadata value can be a string, integer, number, or boolean
  securitySchemes:
    API_KEY:
      type: http
      scheme: bearer

````