# Fiat Callbacks

## Invoice

First of all, invoices can be in three statuses:

* :hourglass\_flowing\_sand:**Pending** – client entered his email and goes to "Enter card" form, email is available here
* :white\_check\_mark: **Done** – invoice was paid successfully.&#x20;
* **😡 Failed** – payment has failed

**Webhook request body:**

<table><thead><tr><th width="261.2822686690928">Field</th><th width="277.78002262809116">Type</th><th>Description</th></tr></thead><tbody><tr><td>id</td><td>string*</td><td>Identifier</td></tr><tr><td>kind</td><td>string* </td><td>"Invoice"</td></tr><tr><td>ticker</td><td>string*</td><td>"KZT"</td></tr><tr><td>amount</td><td>string</td><td>amount specified when invoice was created or entered by user</td></tr><tr><td>paidAmount</td><td>string</td><td>The field is optional and exists only when the status of the invoice is "Done". Look at the "status" field. This field can differ from amount field in specific bank cases so it should be used as source of true. </td></tr><tr><td>cardNumber</td><td>string</td><td>optional, exists only on status "DONE", displays the number of recipients banking card used for withdrawal operation</td></tr><tr><td>fee</td><td>string</td><td>optional and exists only when status is "Done"</td></tr><tr><td>meta</td><td>string</td><td>metadata you defined when <a href="/pages/NzsQOCYaWvM0rbwFyiYG#sending-an-asset">withdrawal was created</a></td></tr><tr><td>description</td><td>string</td><td>Invoice description</td></tr><tr><td>status</td><td>string*</td><td>"Failed", "Pending", "Done"</td></tr><tr><td>time</td><td>number*</td><td>timestamp when withdrawal was created in ms</td></tr></tbody></table>

## Withdrawal

First of all, withdrawals can be in two statuses:

* **😡 Failed** – withdrawal is failed
* :white\_check\_mark: **Done** – withdrawal was sent

**Webhook request body:**

<table><thead><tr><th width="265">Field</th><th width="150">Type</th><th>Description</th></tr></thead><tbody><tr><td>id</td><td>string*</td><td>Identifier</td></tr><tr><td>kind</td><td>"Withdraw"</td><td></td></tr><tr><td>ticker</td><td>string*</td><td>"KZT"</td></tr><tr><td>cardNumber</td><td>string*</td><td>destination card number</td></tr><tr><td>amount</td><td>string*</td><td>amount in decimal format, look at the example</td></tr><tr><td>fee</td><td>string</td><td>service fee, learn more <a href="/pages/0AFl5R1WbizXQrZ6mNTy">here</a></td></tr><tr><td>meta</td><td>string</td><td>metadata you defined when <a href="/pages/NzsQOCYaWvM0rbwFyiYG#sending-an-asset">withdrawal was created</a></td></tr><tr><td>localId</td><td>string</td><td>localId you defined when <a href="/pages/NzsQOCYaWvM0rbwFyiYG#sending-an-asset">withdrawal was created</a></td></tr><tr><td>status</td><td>string*</td><td>"Failed", "Done"</td></tr><tr><td>time</td><td>number*</td><td>timestamp when withdrawal was created in ms</td></tr></tbody></table>

## Batch Withdrawal

{% hint style="info" %}
Fiat batch withdrawals are split into single withdraws, so some of them may fail.

Fail withdraws will be refunded to your balance, but you should pay attention to paidAmount, amount and failedAmount fields in body.

You should use paid amount field which represents success withdrawal amount
{% endhint %}

First of all, batch withdraw can be in single status:

* :white\_check\_mark: **Done** – withdrawal was sent

**Webhook request body:**

<table><thead><tr><th width="265">Field</th><th width="150">Type</th><th>Description</th></tr></thead><tbody><tr><td>kind</td><td>"WithdrawBatch"</td><td></td></tr><tr><td>id</td><td>string*</td><td>Identifier</td></tr><tr><td>ticker</td><td>string*</td><td>"KZT"</td></tr><tr><td>amount</td><td>string*</td><td>amount in decimal format, look at the example</td></tr><tr><td>paidAmount</td><td>string*</td><td>This field can differ from amount field in specific bank cases so it should be used as source of true. </td></tr><tr><td>failedAmount</td><td>string*</td><td>withdraw amount that not sent on bank side</td></tr><tr><td>fee</td><td>string</td><td>service fee, learn more <a href="/pages/0AFl5R1WbizXQrZ6mNTy">here</a></td></tr><tr><td>to</td><td>string*</td><td>destination card number</td></tr><tr><td>meta</td><td>string</td><td>metadata you defined when <a href="/pages/NzsQOCYaWvM0rbwFyiYG#sending-an-asset">withdrawal was created</a></td></tr><tr><td>localId</td><td>string</td><td>localId you defined when <a href="/pages/NzsQOCYaWvM0rbwFyiYG#sending-an-asset">withdrawal was created</a></td></tr><tr><td>status</td><td>string*</td><td>"Done"</td></tr><tr><td>time</td><td>number*</td><td>timestamp when withdrawal was created in ms</td></tr></tbody></table>


---

# Agent Instructions: 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:

```
GET https://docs.0xpay.app/public-api/notifications/fiat-callbacks.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
