> ## 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.

# List the Events of an Invoice

> Get the change history of an invoice, oldest first.



## OpenAPI

````yaml get /billing/invoices/{invoice_id}/events
openapi: 3.1.0
info:
  title: public
  description: ''
  license:
    name: Apache 2.0
    url: https://www.apache.org/licenses/LICENSE-2.0
  version: 1.122.7
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
  - name: Payment Connector Webhooks
  - name: Moderation
  - name: Invoices
  - name: Workload Identity
paths:
  /billing/invoices/{invoice_id}/events:
    get:
      tags:
        - Invoices
      summary: List the events of an invoice
      description: Returns the change history of the invoice, oldest first.
      operationId: list_invoice_events
      parameters:
        - name: invoice_id
          in: path
          description: Invoice ID
          required: true
          schema:
            type: string
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ListInvoiceEventsResponse'
        '404':
          description: The invoice does not exist (NotFound).
        '500':
          description: Something went wrong :(
      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 response = await client.invoices.listEvents('invoice_id');

            console.log(response.items);
        - 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
            )
            response = client.invoices.list_events(
                "invoice_id",
            )
            print(response.items)
        - 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\tresponse, err := client.Invoices.ListEvents(context.TODO(), \"invoice_id\")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", response.Items)\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.invoices.InvoiceListEventsParams;

            import
            com.dodopayments.api.models.invoices.InvoiceListEventsResponse;


            public final class Main {
                private Main() {}

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

                    InvoiceListEventsResponse response = client.invoices().listEvents("invoice_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.invoices.InvoiceListEventsParams

            import
            com.dodopayments.api.models.invoices.InvoiceListEventsResponse


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

                val response: InvoiceListEventsResponse = client.invoices().listEvents("invoice_id")
            }
        - lang: Ruby
          source: |-
            require "dodopayments"

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

            response = dodo_payments.invoices.list_events("invoice_id")

            puts(response)
        - 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 {
              $response = $client->invoices->listEvents('invoice_id');

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

            using DodoPayments.Client;

            using DodoPayments.Client.Models.Invoices;


            DodoPaymentsClient client = new();


            InvoiceListEventsParams parameters = new() { InvoiceID =
            "invoice_id" };


            var response = await client.Invoices.ListEvents(parameters);


            Console.WriteLine(response);
        - lang: Rust
          source: |-
            use dodopayments::Client;

            #[tokio::main]
            async fn main() -> dodopayments::Result<()> {
                let client = Client::from_env()?;
                let invoice_id = "invoice_id";
                let result = client
                    .invoices()
                    .list_events()
                    .invoice_id(invoice_id)
                    .await?;
                println!("{result:?}");
                Ok(())
            }
components:
  schemas:
    ListInvoiceEventsResponse:
      type: object
      required:
        - items
      properties:
        items:
          type: array
          items:
            $ref: '#/components/schemas/InvoiceEventResponse'
    InvoiceEventResponse:
      type: object
      required:
        - event_id
        - event_type
        - actor
        - row_version
        - payload
        - created_at
      properties:
        actor:
          type: string
          description: A user ID, `api_key`, `customer` or `system`.
        actor_email:
          type:
            - string
            - 'null'
        created_at:
          type: string
          format: date-time
        event_id:
          type: string
        event_type:
          type: string
        payload:
          type: object
        row_version:
          type: integer
          format: int64
  securitySchemes:
    API_KEY:
      type: http
      scheme: bearer
      description: >-
        Send your API key as a bearer token: `Authorization: Bearer <api_key>`.
        A test mode key starts with `dodo_test_`, for example
        `dodo_test_AbCd1234EfGh5678.<secret>`. A live mode key starts with
        `dodo_live_`. Use a test mode key on `test.dodopayments.com` and a live
        mode key on `live.dodopayments.com`. Keys from before these tags have no
        tag and operate as before.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.