---
# System prepended metadata

title: Deposit Notifier Webhook

---

## Deposit Transaction Webhook

The deposit transaction webhook provides an API interface for Exodus's exchange module to notify a service provider about a deposit transaction made against a swap order placed. Should a deposit transaction succeeded or failed from Exodus's wallet (or other clients), the webhook will be called with the status. 

#### Webhook Technical Details
1. **API**

    We can adopt existing API structure to minimize the effort from AERO. The webhook API will require a new method which should be created by AERO for handling the incoming payload. 
    
    The webhook payload should include:
        - `orderId`: The order id / reference returned from the swap request.
        - `txId`: The deposit transaction hash send by Exodus.
        - `userMarkedPaid`: A boolean flag to indicate a transaction is sent successfully or not.

    **Request payload spec**
    ```json
        {
          type: 'object',
          properties: {
            userMarkedPaid: {
              type: 'boolean',
            },
            txId: {
              type: 'string',
              minLength: 1,
              maxLength: 200,
            },
            orderId: {
              type: 'string',
              minLength: 1,
              maxLength: 200,
            }
          },
          required: ['orderId', 'userMarkedPaid'],
        }
    ```
    
    **Response payload spec**
    This is optional. We can cope any response payload TBD on our side. For a success response it can be a 201 code without a body payload. For 4xx/5xx response, the payload can include the error details (we can discuss it later).
    
2. **Authentication**

    The webhook hook endpoint should be authenticated for Exodus usage only. We can adopt the current simple API key authentication (as we used on other AERO endpoints). Or we can discuss a stricter way if needed. One of other provider send a `accessToken` back in the swap response(only) payload. So that we use the token to request their webhook. If this is a practical way we can cope with it as well. 
    
3. **Example requests**

    ```curl
    curl --location 'https://api.aeroswap.io/v2' \
    --header 'Content-Type: application/json' \
    --header 'api-key: {CURRENT/NEW AERO/EXODUS API KEY}' \
    --data '{
        "id":"test",
        "jsonrpc": "2.0",
        "method": "notifyTxWebhook",
        "params": {
            "orderId": "u5vao6xtyup7bmhbb3t"
            "txId": "0xcf96b974cb4f4eb961980a808a8ef60f022073fb510defeb52a91c7c10ba0c22"
            "userMarkedPaid": true
        }
    }'
    ```
    
    ```curl
    curl --location 'https://api.aeroswap.io/v2' \
    --header 'Content-Type: application/json' \
    --header 'api-key: {CURRENT/NEW AERO/EXODUS API KEY}' \
    --data '{
        "id":"test",
        "jsonrpc": "2.0",
        "method": "notifyTxWebhook",
        "params": {
            "orderId": "u5vao6xtyup7bmhbb3t"
            "userMarkedPaid": false
        }
    }'
    ```