githubEdit

POST /transfer

Once you have a Smart Payout Account, you can initiate a transfer of an ERC-20 token using the /payout/transfer endpoint.

Path

// Path Structure
//    /{chain}/account/{address} +
//    /payout/transfer

const dispersePath = `https://api.paymagic.xyz/v1` +
    `/eth/account/0xe9e284277648fcdb09b8efc1832c73c09b5ecf59` + 
    `/payout/transfer`

Request Body

Pass in three fields with this call:

  • asset - token address to payout

  • amount - token amount as a string

  • recipient - recipient address

var data = JSON.stringify({
    "asset":  "0xeb8f08a975Ab53E34D8a0330E0D34de942C95926",
    "amount": "10",
    "recipient": "0x869eC00FA1DC112917c781942Cc01c68521c415e"
});

Use the zero address for native tokens like ETH, MATIC, AVA:

Response

The response from payout endpoints is an ethers.jsarrow-up-right TransactionReponsearrow-up-right with a meta field that has additional information. By default, the meta field comes back with a value of {status: 'pending'}.

For more information on the meta field, see the Transactions page.

Last updated