> For the complete documentation index, see [llms.txt](https://aliniex.gitbook.io/alix-pay/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://aliniex.gitbook.io/alix-pay/api-reference/scan-to-pay-api/transactions/listen-updates-of-transaction-via-webhook-ipn_url.md).

# Listen updates of transaction via webhook (IPN\_URL)

Allows the partner listen the transaction details noticed from AliX Pay when change status

**Response**

{% tabs %}
{% tab title="200" %}

```json
{
  "externalOrderId": "string",
  "type": "string",
  "fiatAmount": 0,
  "paidAmount": 0,
  "tokenTransfer": {
    "currency": "string",
    "network": "string",
    "price": 0,
    "amount": 0,
    "walletAddress": "string",
    "txHash": "string"
  },
  "bankTransfer": {
    "bankAccountName": "string",
    "bankAccountNumber": "string",
    "bankName": "string",
    "contentPayment": "string",
    "totalPayment": 0,
    "qrUrl": "string"
  },
  "fees": {
    "systemFee": 0,
    "processingFee": 0
  },
  "status": "string", // AWAITING_PAYMENT | PAYMENT_COMPLETED | PROCESSING_TOKEN_TRANSFER | SUCCESS | ERROR 
  "description": "string",
  "createdAt": "string",
  "expiresAt": "string",
  "signature": "string"
}
```

{% endtab %}

{% tab title="400" %}

```json
{
  "error": "Invalid request"
}
```

{% endtab %}
{% endtabs %}

{% hint style="info" %}
**Signature**&#x20;

* Partner will digitally sign the transmitted data using **`SHA256withRSA`** with RSA algorithm
* The **private key** that has been of yours
* Data shall be signed according to the structure **`externalOrderId|type|fiatAmount|status|secretKey`**
  {% endhint %}

### How to create and verify the signature  <a href="#how-to-do-signature-creation-verification" id="how-to-do-signature-creation-verification"></a>

#### 1. Creation

```typescript
import * as crypto from 'crypto';

function create(data: string, privateKey: string): string 
{
  const signer = crypto.createSign('RSA-SHA256');
  signer.update(data);
  signer.end();

  return signer.sign(privateKey, 'base64');
}
```

#### 2. Verification

```typescript

function verify (data: string, signature: string, pubKey: string): boolean
{
        const verify = createVerify('RSA-SHA256');
        verify.update(data);
        verify.end();
        return verify.verify(pubKey, signature, 'base64');
}
```

**Transaction status**

{% hint style="info" %}
Please refer the [order ](/alix-pay/resources/order-status.md)events and [webhooks](/alix-pay/api-reference/introduction/webhooks.md)
{% endhint %}

| Status name                 | Description                                                                                                                               |
| --------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- |
| AWAITING\_PAYMENT           | <p>The order created successfully. It is waiting <br><mark style="color:red;">(please wait IPN or manual check with operation)</mark></p> |
| PAYMENT\_COMPLETED          | When payment has transferred from AliX Pay to your customer bank account                                                                  |
| PROCESSING\_TOKEN\_TRANSFER | When the token has deducted from your account wallet on AliX Pay                                                                          |
| SUCCESS                     | When an transaction has completed                                                                                                         |
| ERROR                       | When an transaction has error with any reasons                                                                                            |


---

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

```
GET https://aliniex.gitbook.io/alix-pay/api-reference/scan-to-pay-api/transactions/listen-updates-of-transaction-via-webhook-ipn_url.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.
