> For the complete documentation index, see [llms.txt](https://docs.aquanow.io/pay/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.aquanow.io/pay/webhooks/invoicing-webhook.md).

# Invoicing Webhook

We offer webhook callbacks for clients that want to be updated when a deposit is detected on-chain or finalized.

## Webhook payload examples

{% hint style="info" %}
Aquanow invoice guarantees at-least-once delivery of our webhook messages, and to avoid duplicates, you can utilize txHash and adminApproval as deduplication IDs.
{% endhint %}

{% tabs %}
{% tab title="Invoice Closed / Fully Paid" %}

```javascript
{
  invoiceId: 'e7a12656-107d-414d-b48b-fdbe5e1711ac',
  username: 'AqPay',
  createdAt: '2025-02-06T05:38:36.993Z',
  invoiceStatus: 'CLOSED',
  paymentStatus: 'PAID',
  customerPaysFee: true,
  invoiceSymbol: 'USD',
  amountDue: 50,
  invoiceAmount: 50.4,
  invoicingFee: 0.4,
  processingFee: 0.39999999744,
  invoiceReceivedAmount: 50.39999967744,
  expirationTime: 1739079520534,
  activatedAt: '2025-02-06T05:38:40.534Z',
  accountId: 'CA1001112C'
}
```

{% endtab %}
{% endtabs %}

## Callback parameter values

<table data-header-hidden><thead><tr><th width="172.4">parameter</th><th width="150"></th><th>description</th></tr></thead><tbody><tr><td><strong>Parameter</strong></td><td><strong>Type</strong></td><td><strong>Description</strong></td></tr><tr><td>invoiceId</td><td><code>string</code></td><td>Invoice Id provided by Aquanow, can be used for query an invoice status</td></tr><tr><td>username</td><td><code>string</code></td><td>Your username</td></tr><tr><td>createdAt</td><td><code>string</code></td><td>Time of invoice creation in epoch</td></tr><tr><td>invoiceStatus</td><td><code>"CREATED" | "OPEN" | "CLOSED"</code></td><td>Status of the invoice. <br>NOTE: Closed means that the invoice has been finalized; look at payment Status for whether or not the invoice was fully paid off</td></tr><tr><td>paymentStatus</td><td><code>"PAID" | "NOT PAID" | "PARTIALLY_PAID" | "OVERPAID" | "UNDERPAID"</code></td><td>Status of payment for the invoice</td></tr><tr><td>customerPaysFee</td><td><code>string</code></td><td><p>If the customer pays the fee <br>→ The invoiced amount includes both the amount due and the fee. </p><p></p><p>If the customer does NOT pay the fee </p><p>→ The invoiced amount includes only the amount due, and your business covers the fee after conversion.</p></td></tr><tr><td>invoiceSymbol</td><td><code>string</code></td><td>Symbol for the invoice </td></tr><tr><td>amountDue</td><td><code>number</code></td><td>Total value of the invoice (in fiat)</td></tr><tr><td>invoiceAmount</td><td><code>number</code></td><td>Total amount of the invoice after fees (in fiat)</td></tr><tr><td>invoicingFee</td><td><code>number</code></td><td>Fee of the invoice (in fiat)</td></tr><tr><td>processingFee</td><td><code>string</code></td><td>Fee (in fiat) applied after crypto conversion</td></tr><tr><td>invoiceReceivedAmount</td><td><code>number</code></td><td>Amount received from the client in crypto</td></tr><tr><td>expirationTime</td><td><code>number</code></td><td>Time of expiration in epoch</td></tr><tr><td>activatedAt</td><td><code>string</code></td><td>Time of activation in epoch</td></tr><tr><td>accountId</td><td><code>string</code></td><td>accountId for your Aquanow account</td></tr></tbody></table>


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.aquanow.io/pay/webhooks/invoicing-webhook.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
