Step 3. Tag transactions with a source parameter (see send transactions via or the)
For the following API requests, use the header Authorization: Token <secret key>. Get a secret key in Keyson your .
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 $100 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:
The payout will be issued in kind (ETH on Ethereum, SOL on Solana, BNB on Binance Smart Chain).
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://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
}