Implementation Guide

Step 1. Sign up on the Merkle Blockchain Services (MBS) platform


Step 2. Send transactions via the RPC url or the transaction API


Step 3. Tag transactions with a source parameter (see send transactions via the RPC url or the transaction API)


For the following API requests, use the header Authorization: Token <secret key>. Get a secret key in Keyson your MBS Dashboard.

Step 4. Pull the current cashback balance of a source with the following API:

GET https://api.merkle.io/v1/cashback/source/:id

The response will display all the balances this source has in ETH, BSC, MATIC and USD as well as a estimatedUsd that aggregated all these balances using live prices.

{
    "estimatedUsd": 30.1,
    "balances": [
        {
            "asset": "ETH" // can be ETH, USD, MATIC, or BNB
            "amount": 0.004
        },
        {
            "asset": "USD",
            "amount": 20
        }
    ]
}

Step 5. Issue payouts whenever the customers requests it.

The estimatedUsd balance must be at least $10 to issue a payout.

POST https://api.merkle.io/v1/cashback/source/:id/payout

Simply pass the address where to issue the payout for this source:

{
    "address": "0x......."
}

The payout will be issued using USDC on the Ethereum network within 1 minute.

The API will respond with the following body:

{
    // the uuid of the payout
    "id: "0000-0000-0000-0000"
}

Step 6: Check the status of the payout

Call the following API to check the status of the payout:

GET https://mbs-api.merkle.io/v1/cashback/payout/:id

The API will return the following body:

{
    "id": "0000-0000-0000-0000",
    "status": "PENDING" // or PAID, TX_FAILED, TX_PENDING
    "tx_hash": "0x....", // the hash of the payout transaction on Ethereum
}

Last updated