# WEBHOOKS

{% hint style="info" %}
Please provide the callback address from the merchant. Notification will be made after configuration in the merchant backend.
{% endhint %}

When the transaction has the final result, through `webhook` configuration, the development platform will send a transaction notification to the merchant. When the acceptance is unsuccessful or the sending fails, the transaction will be sent 7 times with a time interval of 1m, 5m, 20m, 1h, 12h, 24h.

## Event Template

**Headers**

| Name             | Value             | describtion                                    |
| ---------------- | ----------------- | ---------------------------------------------- |
| Content-Type     | application/json  | Content Type                                   |
| X-WSB-CATEGORY   | ${X-WSB-CATEGORY} | Business identifiers for different event types |
| X-WSB-SIGNATURE  | ${signature}      | signature                                      |
| X-WSB-REQUEST-ID | ${requestId}      | A unique id for request                        |

## Event Response Template

{% hint style="info" %}
When the return structure is as shown below, the callback notification is successful
{% endhint %}

```
{
    "success": true,
    "code": 200,  //must return 200
    "msg": null,
    "data": null
}
```

## Card Operation Transaction Event

{% hint style="info" %}
X-WSB-CATEGORY=card\_transaction
{% endhint %}

**Request Params**

Click on the returned object [**Card Operation Transaction**](https://wsb.gitbook.io/wasabicard-doc/card/cards#card-operation-transaction-v2) Interface to view the response data

**Example Body**

```json
{
    "orderNo": "1852379830190366720",
    "merchantOrderNo": "T1852379826671345664",
    "cardNo": "23424290324234454242",
    "currency": "USD",
    "amount": 15,
    "fee": 0,
    "receivedAmount": 0,
    "receivedCurrency": "USD",
    "type": "create",
    "status": "success",
    "description": null,
    "remark": null,
    "transactionTime": 1730476742000,
    "giftCardActivateUrl":""
}
```

## Card Authorization Transaction Event

{% hint style="info" %}
X-WSB-CATEGORY=card\_auth\_transaction\
\
The same transaction serial number may be pushed multiple times.&#x20;

1. The status may flow. For example, when type=auth, the first push status=authorized (authorized), after the authorization is successfully received, the status=succeed or other status will be pushed again.&#x20;
2. The settlement amount and other information will be pushed, and the amount may change. For example, crossBoardFee and settleAmount will change from 0 to a value.
   {% endhint %}

**Request Params**

Click on the returned object [**Card Authorization Transaction**](https://wsb.gitbook.io/wasabicard-doc/card/cards#card-authorization-transaction-consumption-bill) Interface to view the response data

**Example Body**

{% tabs %}
{% tab title="Example 1" %}

```json
{
    "cardNo": "1242352328671924231",
    "tradeNo": "trans1232435363435463432",
    "originTradeNo": null,
    "currency": "SGD",
    "amount": 16.96,
    "authorizedAmount": 2.45,
    "authorizedCurrency": "USD",
    "fee": 0.3,
    "feeCurrency": "USD",
    "crossBoardFee": 0.2,
    "crossBoardFeeCurrency": "USD",
    "settleAmount": 0,
    "settleCurrency": null,
    "settleDate": null,
    "authorizationCode": "478198",
    "merchantName": "HUQQABAZ RESTAURANTS B DUBAI ARE",
    "merchantData":
    {
        "name": "HUQQABAZ RESTAURANTS B DUBAI ARE",
        "categoryCode": "5811",
        "category": "",
        "country": "ARE",
        "state": "",
        "city": "",
        "zipCode": "",
        "mid": 213028402482045,
        "walletType": "ApplePay"
    },
    "type": "auth",
    "status": "authorized",
    "description": "Auth",
    "transactionTime": 1729422898000
}
```

{% endtab %}

{% tab title="Example 2" %}

```json
{
    "cardNo": "1242352328671924231",
    "tradeNo": "trans1232435363435463432",
    "originTradeNo": null,
    "currency": "SGD",
    "amount": 16.96,
    "authorizedAmount": 2.45,
    "authorizedCurrency": "USD",
    "fee": 0.3,
    "feeCurrency": "USD",
    "crossBoardFee": 0.2,
    "crossBoardFeeCurrency": "USD",
    "settleAmount": 2.45,
    "settleCurrency": "USD",
    "settleDate": 1730995200,
    "authorizationCode": "478198",
    "merchantName": "HUQQABAZ RESTAURANTS B DUBAI ARE",
    "merchantData":
    {
        "name": "HUQQABAZ RESTAURANTS B DUBAI ARE",
        "categoryCode": "5811",
        "category": "",
        "country": "ARE",
        "state": "",
        "city": "",
        "zipCode": "",
        "mid": 213028402482045,
        "walletType": "ApplePay"
    },
    "type": "auth",
    "status": "succeed",
    "description": "Auth",
    "transactionTime": 1729422898000
}
```

{% endtab %}
{% endtabs %}

## Card Authorization Fee Transaction Event

{% hint style="info" %}
X-WSB-CATEGORY=card\_fee\_patch<br>
{% endhint %}

**Request Params**

Click on the returned object [**Card Authorization Fee Transaction**](https://wsb.gitbook.io/wasabicard-doc/card/cards#card-authorization-fee-transaction) Interface to view the response data

**Example Body**

```json
{
    "cardNo": "1242352328671924231",
    "tradeNo": "CAF1232435363435463432",
    "originTradeNo": "trans1232435363435463432",
    "currency": "USD",
    "amount": 0.5,
    "type": "card_patch_fee",
    "deductionSourceFunds": "wallet",
    "status": "success",
    "transactionTime": 1729422898000
}
```

## Card 3DS Transaction Event

{% hint style="info" %}
X-WSB-CATEGORY=card\_3ds
{% endhint %}

**Request Params**

Click on the returned object [**Card 3DS Transaction**](https://wsb.gitbook.io/wasabicard-doc/card/cards#card-3ds-transaction) Interface to view the response data

**Example Body**

{% tabs %}
{% tab title="third\_3ds\_otp" %}

```json
{
    "cardNo": "1242352328671924231",
    "tradeNo": "trans1232435363435463432",
    "originTradeNo": null,
    "currency": "CNY",
    "amount": 16.96,
    "merchantName": "ULTRA MOBILE",
    "values": "ajfon34nNOIN24nafaiw4onnfn0iw32ngfn0IF0Q34NFQFOFAW", //Plain text example: 204566
    "type": "third_3ds_otp",
    "transactionTime": 1729422898000,
    "description": null,
    "expirationTime": 1729422899000
}
```

{% endtab %}

{% tab title="auth\_url" %}

```json
{
    "cardNo": "1242352328671924231",
    "tradeNo": "trans1232435363435463432",
    "originTradeNo": null,
    "currency": "CNY",
    "amount": "16.96",
    "merchantName": "ULTRA MOBILE",
    "values": "ajfon34nNOIN24nafaiw4onnfn0iw32ngfn0IF0Q34NFQFOFAW",//Plain text example: https://www.google.com
    "type": "auth_url",
    "transactionTime": 1729422898000,
    "description": null,
    "expirationTime": 1729422899000
}
```

{% endtab %}

{% tab title="activation\_code" %}

```json
{
    "cardNo": "1242352328671924231",
    "tradeNo": "trans1232435363435463432",
    "originTradeNo": null,
    "currency": null,
    "amount": "0",
    "merchantName": null,
    "values": "ajfon34nNOIN24nafaiw4onnfn0iw32ngfn0IF0Q34NFQFOFAW", //Plain text example：20834634
    "type": "activation_code",
    "description": null,
    "transactionTime": 1729422898000
}
```

{% endtab %}
{% endtabs %}

## Card Holder Event

{% hint style="info" %}
X-WSB-CATEGORY=card\_holder
{% endhint %}

**Request Params**

Click on the returned object [**Cardholder-List**](https://wsb.gitbook.io/wasabicard-doc/card/card-holder#cardholder-list) Interface to view the response data

**Example Body**

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

```json
{
    "holderId": 123456,
    "cardTypeId": 111016,
    "email": "test@test.com",
    "firstName": "first",
    "lastName": "last",
    "status": "reject",
    "description": "Email wrong",
    "respMsg": null
}
```

{% endtab %}
{% endtabs %}

## Activate Card Event

{% hint style="info" %}
X-WSB-CATEGORY=physical\_card
{% endhint %}

**Request Params**

{% tabs %}
{% tab title="Activate Card" %}

```json
{
    "merchantOrderNo": "35nigjaongaognaeorig", //Merchant order number
    "cardNo": "jojaga3-35mg-35saga-3535dfg", //Card ID
    "type": "card_activated", //Type
    "status": "success", //Status. wait_process  processing  success  fail
    "description": "SUCCESS",
    "remark": null // equal description, will remove
}
```

{% endtab %}
{% endtabs %}

## Work Order event

{% hint style="info" %}
X-WSB-CATEGORY=work
{% endhint %}

**Request Params**

Click on the returned object [**Work Order List**](https://wsb.gitbook.io/wasabicard-doc/common#work-order-list) Interface to view the response data

**Example Body**

```json
{
  "merchantOrderNo": "13243897979979797999008085",
  "orderNo": "WORK-202508071953472304731676672",
  "title": "ApplePay",
  "target": "5533700042831234",
  "content": "Active",
  "tradeType": "CARD_ACTIVE",
  "tradeStatus": "success", //wait_process; processing; success; fail
  "description": "SUCCESS",
  "remark": null,
  "createTime": 1754607865000,
  "updateTime": 1754648044000
}
```

## Wallet Transaction event

**Note:**\
that if status=fail is not considered the final state, we can manually enter the final status=success (this is a possibility).

{% hint style="info" %}
X-WSB-CATEGORY=wallet\_transaction
{% endhint %}

**Request Params**

Click on the returned object **\[**[**Wallet Transaction**](https://wsb.gitbook.io/wasabicard-doc/wallet#wallet-deposit-transaction)**]** Interface to view the response data

**Example Body**

```json
{
    "orderNo": "CND1985645689502720000",
    "needDepositTxAmount": 20,
    "txAmount": 20,
    "feeRate": 1.5,
    "fee": 0.3,
    "fixedFee": 0,
    "currency": "USDT",
    "receivedAmount": 19.7,
    "receivedCurrency": "USD",
    "chain": "TRC20",
    "fromAddress": "TVwdXFHzD5mJP52xkxtRfVCLrWNaLGiiaB",
    "toAddress": "TF9fZHk27TmEznSRHiirWkX23zbZJC299M",
    "txId": "b5eccb05e227fab979182905e3ff1ec8a0995f43bc407aaaaaaaaaaaaaaa",
    "block": 65567635,
    "confirmTime": 1727351235000,
    "type": "chain_deposit",
    "status": "success",
    "remark": "Chain deposit",
    "createTime": 1762249798000,
    "updateTime": 1762249920000
}
```

## Wallet Transaction event-v2

{% hint style="info" %}
X-WSB-CATEGORY=wallet\_transaction\_v2
{% endhint %}

**Request Params**

Click on the returned object **\[**[**Wallet Transaction History**](https://wsb.gitbook.io/wasabicard-doc/wallet#wallet-transaction-history-v2)**]** Interface to view the response data

**Example Body**

```json
{
    "orderNo": "CND2031235349498847232",
    "coinKey": "USDT_TRC20",
    "block": 80817428,
    "sourceAddress": "TK4ykR48cQQoyFcZ5N4xZCbsBaHcg6n3gJ",
    "destinationAddress": "TReJ9YfvmpPTXuq3kzQneXDco1fQprqZ9v",
    "txHash": "1c19a9635e8c11c6b7be0e402017e81e64e9f7f1ad1a10e1ea1304955745b434",
    "transactionTime": 1773119090000,
    "confirmTime": 1773119194000,
    "coinName": "USDT",
    "txAmount": "9",
    "feeRate": "1.5",
    "fee": "0.135",
    "fixedFee": "0",
    "receivedAmount": "8.86",
    "receivedCurrency": "USD",
    "type": "DEPOSIT",
    "status": "success",
    "createTime": 1773119220000,
    "updateTime": 1773119220000
}
```
