💳Payouts

Once you have a Smart Payout Account, customers can send out complex payouts with one simple API call:

  • /payout/disperse - Initiate a batch transfer of ERC-20 tokens

  • /payout/disperseNFT - Initiate a batch transfer of NFTs (ERC-721)

  • /payout/transfer - Initiate a simple transfer of tokens to a single recipient

So the full URL for a /disperse looks like:

// {base}/v1 +
//    /{chain}/account/{address} +
//    /payout/{action}

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

Response

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

{
  "meta": {
    "status": "pending"
  },
  "hash": "0x46c91fd81be30a3212daa3d9a2bdebd72ef63c343d59c381827cc3ccfaf91e24",
  "options": {
    "gasLimit": 8450000,
    "gasPrice": {},
    "from": "0x0D79AfBF97a401968836b9D906F3f87b20d45A72"
  },
  "transactionResponse": {
    "type": 2,
    "chainId": 4,
    "nonce": 203,
    "maxPriorityFeePerGas": {
      "type": "BigNumber",
      "hex": "0x4190aaf6"
    },
    "maxFeePerGas": {
      "type": "BigNumber",
      "hex": "0x4190aaf6"
    },
    "gasPrice": null,
    "gasLimit": {
      "type": "BigNumber",
      "hex": "0x80efd0"
    },
    "to": "0x7328285B4435dbc51897DC2d900D21707d14253e",
    "value": {
      "type": "BigNumber",
      "hex": "0x00"
    },
    "data": "0x6a761202000000000000000000000000a238cbeb142c10ef7ad8442c6d1f9e89e07e776100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000140000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000026000000000000000000000000000000000000000000000000000000000000000e48d80ff0a0000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000009900eb8f08a975ab53e34d8a0330e0d34de942c9592600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000044a9059cbb000000000000000000000000869ec00fa1dc112917c781942cc01c68521c415e0000000000000000000000000000000000000000000000000000000005f5e100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000410000000000000000000000000d79afbf97a401968836b9d906f3f87b20d45a7200000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000",
    "accessList": [],
    "hash": "0x46c91fd81be30a3212daa3d9a2bdebd72ef63c343d59c381827cc3ccfaf91e24",
    "v": 1,
    "r": "0x5af403d2957eed0900abe62d3cb9b02256a3305618f2614d898094849ab15c77",
    "s": "0x2c6afaf7272952f85d00f3d44c9ac510a9fd47e1366c961c3867c4dcdfd61ffc",
    "from": "0x0D79AfBF97a401968836b9D906F3f87b20d45A72",
    "confirmations": 0
  }
}

Last updated