> For the complete documentation index, see [llms.txt](https://docs.digitalriver.com/commerce-api/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.digitalriver.com/commerce-api/events/event-types/post-order-event-types/invoice-created-event.md).

# Invoice created event

When an order's invoice is generated, the `order.invoice.created` event is triggered. This event is crucial in tracking and managing order invoices and ensuring that financial records are accurate and up-to-date. This notification provides essential invoice details, such as the unique invoice identifier, the associated file ID for invoice access, the order and customer IDs, the purpose of the invoice, and a downloadable URL for the invoice itself.

Integrating this event into your system via our API streamlines financial documentation and enhances the overall order management process. To fully use this functionality, ensure the API service is activated on your site's key. Your Digital River Customer Success Manager (CSM) can support you if you require any assistance or have questions regarding the setup.

{% code title="Webhook response" %}

```json
{
    "id": "db375d32-52c0-4188-a05c-552933d254c5",
    "type": "order.invoice.created",
    "data": {
        "object": {
            "id": "9e00869b-e2f5-4663-aacb-e33687466020",
            "fileId": "9e00869b-e2f5-4663-aacb-e33687466020",
            "orderId": "851511800082",
            "customerId": "503451273389",
            "purpose": "customer_invoice",
            "invoiceURL": "https://api.digitalriver.com/files/9e00869b-e2f5-4663-aacb-e33687466020/content"
        }
    },
    "liveMode": false,
    "createdTime": "2020-10-14T09:03:33.988Z"
}
```

{% endcode %}

This event is crucial for monitoring and handling invoice processing within your system, ensuring the seller and the customer can access financial documents related to their transactions.

See the [Creating a webhook](/commerce-api/events/webhooks/creating-a-webhook.md) section for instructions on creating the webhook and the [Downloading the invoice PDF via a webhook notification](/commerce-api/admin-apis/order-management/downloading-the-invoice.md#downloading-the-invoice-pdf-via-a-webhook-notification) section for instructions on downloading the invoice PDF file. These instructions include information on [getting the file identifier for the invoice](/commerce-api/admin-apis/order-management/downloading-the-invoice.md#step-1-getting-the-file-identifier-for-the-invoice).


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.digitalriver.com/commerce-api/events/event-types/post-order-event-types/invoice-created-event.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
