# Receipt Invoice Callback

**Introduction**

The Invoice Callback functionality allows you to receive real-time updates about changes in the status of invoices and their associated payment transactions. By including the `callback_url` parameter when creating an invoice, you can ensure that a POST request is sent to the specified URL upon changes in the invoice status or upon the completion or cancellation of a payment transaction associated with the invoice.

**The `callback_url` Parameter**

When creating an invoice, if you include the `callback_url` parameter in your request, a POST request will be sent to the specified URL upon changes in the invoice status or upon the completion or cancellation of a payment transaction associated with the invoice.

**Callback Structure**

The callback sent to the specified `callback_url` will have the following structure:

```json
code{
  "invoice": {
    "id": "1-13",
    "invoice": "2794c4d4-6feb-4b46-9334-1849af7b1a0f",
    "ticker": "USDT",
    "currencyName": "Tether USD",
    "networkName": "ERC-20",
    "payment_method": "ETHER",
    "actualAmount": "100001.000000000000000000",
    "invoiceAmount": "100",
    "amountTransaction": "99000.99000000",
    "feeTransaction": "1000.010000000000000000",
    "address": "0xC1Dc25f17d2d767A103F881dC5c363E9Df3e01D8",
    "sysAddress": null,
    "hash": "test_hash1",
    "type": "CRYPTO",
    "status": "SUCCESS",
    "sender_name": "user name",
    "purpose_of_payment": "payment for items",
    "order_number": "14556-HF1000-KL5",
    "createdAt": "2023-08-11 21:12:00",
    "updatedAt": "2023-08-11 16:05:11",
    "expireAt": "2023-08-12 00:12:00",
    "redirectContinue": "http://test.com/success"
  },
  "api-key": "B1ulGwM8oJqB48GEdfAWeMNRFcr1QCCH0z6qAvJZfvlSzkoWg8ScrR4xickxb6sl",
  "signature": "c7a289f2238fa5eb3859a6d73a2b0e6a919371d0546d38c73419007b2fdb3fa9"
}
```

**Signature Verification**

The `signature` field in the callback is formed using the same algorithm as for regular API requests. You should use this `signature` along with the provided `api-key` to verify the authenticity of the callback data.

By utilizing the Invoice Callback functionality, you can receive updates about changes in the status of your invoices and payment transactions in real time, enhancing your ability to efficiently manage and track payment operations.
