API Reference

Events

You'll receive JSON encoded events in the server you're listening whenever a MINT, a BURN or a SWAP operation is executed, for example.

The body data you can expect to receive is presented below:

{
    "subscription":"MINT",
    "createdAt":int,
    "id":"string",
    "userId":"string",
    "data": {
        "status":"QUEUED",
        "depositId":"string", // If reason was order paid, will point to deposit id
        "walletAddress":"string",
      	"referenceLabel":"string", // If order paid had a referenceLabel, will be present here
        "externalId":"string",
        "amount":int, // Final mint amount
        "discountedFee":int, // How much was already discounted from amount
        "chain":"string",
        "reason":"string", // Reason this MINT is happening
        "taxId":"string", // If reason was order paid, taxId of the payer
        "id":"string"
    }
}

{
    "subscription":"BURN",
    "createdAt":int,
    "id":"string",
    "userId":"string",
    "data": {
        "status":"QUEUED",
        "walletAddress":"string",
        "amount":int,      // Amount of tokens that will be burned
        "transferFee":int, // Fee that will be applied when transferring the money to the bank account (i.e. PIX transfer amount will be amount-transferFee)
      	"chain":"string",
        "reason":"string", // Reason this BURN is happening
        "id":"string",
        "externalId":"string",
    }
}
{
    "subscription":"SWAP",
    "createdAt":int,
    "id":"string",
    "userId":"string",
    "data": {
      	"id":"string",
        "externalId":"string",
        "status":"QUEUED",
        "walletAddress":"string",   // Wallet that is giving tokens
        "receiverAddress":"string", // Wallet that is receiving tokens
        "brlaAmount":int,
        "usdAmount":int,
      	"usdToBrla":bool,
      	"coin":"string",   // Which dollar stable coin is being used
        "chain":"string",
      	"reason":"string", // Reason this SWAP is happening
    }
}
{
    "subscription":"PIX-TO-USD",
    "createdAt":int,
    "id":"string",
    "userId":"string",
    "data": {
        "status":"QUEUED",
        "pixToUsdId":"string", // If reason was order paid, will point to pix-to-usd id
        "walletAddress":"string",
        "amountBrl":int,
        "amountUsd":int,
        "chain":"string",
        "coin":"string",
        "reason":"string", // Reason this PIX-TO-USD is happening
        "id":"string",
        "externalId":"string"
    }
}
{
    "subscription":"PIX-TO-TOKEN",
    "createdAt":int,
    "id":"string",
    "userId":"string",
    "data": {
        "status":"QUEUED",
        "token":"string",
        "walletAddress":"string",
        "amountBrl":int,
        "amountToken":"string",
        "chain":"string",
        "pixToTokenId":"string", // If reason was order paid, will point to pix-to-token id
        "reason":"string",       // Reason this PIX-TO-TOKEN is happening
        "id":"string",
        "externalId":"string"
    }
}
{
    "subscription":"USD-TO-PIX",
    "createdAt":int,
    "id":"string",
    "userId":"string",
    "data": {
        "status":"QUEUED",
        "amountBrl":int,
        "amountUsd":int,
        "coin":"string",   // E.g: USDC or USDT 
        "reason":"string", // Reason this USD-TO-PIX is happening
        "id":"string",
        "externalId":"string",
    }
}
{
    "subscription":"MINT",
    "createdAt":int,
    "id":"string",
    "userId":"string",
    "data": {
        "status":"POSTED",
        "tx":"string", // Blockchain transaction hash
        "id":"string",
        "externalId":"string"
    }
}
{
    "subscription":"BURN",
    "createdAt":int,
    "id":"string",
    "userId":"string",
    "data": {
        "status":"POSTED",
        "tx":"string", // Blockchain transaction hash
        "id":"string",
        "externalId":"string"
    }
}
{
    "subscription":"SWAP",
    "createdAt":int,
    "id":"string",
    "userId":"string",
    "data": {
        "status":"POSTED",
        "type":"string", // Either ATOMIC, PARTIAL-BRLA or PARTIAL-USD
        "tx":"string",   // Blockchain transaction hash
        "id":"string",
        "externalId":"string"
    }
}
{
    "subscription":"PIX-TO-USD",
    "createdAt":int,
    "id":"string",
    "userId":"string",
    "data": {
        "status":"POSTED",
        "pixToUsdId":"string", // If reason was order paid, will point to pix-to-usd id
        "tx":"string",   // Blockchain transaction hash
        "type":"string", // Either ATOMIC, PARTIAL-BRLA or PARTIAL-USD
        "id":"string",
        "externalId":"string"
    }
}
{
    "subscription":"PIX-TO-TOKEN",
    "createdAt":int,
    "id":"string",
    "userId":"string",
    "data": {
        "status":"POSTED",
        "token":"string", 
        "tx":"string",   // Blockchain transaction hash
        "id":"string",
        "type":"string", // Either ATOMIC, PARTIAL-BRLA or PARTIAL-TOKEN
        "externalId":"string"
    }
}
{
    "subscription":"USD-TO-PIX",
    "createdAt":int,
    "id":"string",
    "userId":"string",
    "data": {
        "status":"POSTED",
        "tx":"string",   // Blockchain transaction hash
        "type":"string", // Either empty, or REFUND if payment failed
        "id":"string",
        "externalId":"string"
    }
}
{
    "subscription":"KYC",
    "createdAt":int,
    "id":"string",
    "userId":"string",
    "data": {
      	"id":"string",
        "status":"POSTED",
        "level":int,
      	"kycStatus":"PENDING",
        "taxId":"string"
    }
}
{
    "subscription":"MONEY-TRANSFER",
    "createdAt":int,
    "id":"string",
    "userId":"string",
    "data": {
      	"id":"string",
        "status":"POSTED",
        "associatedOperationId":"string", // Links to the id of the operation that created this transfer
      	"associatedOperationType":"string" // "BURN", for example, if it came from a burn operation
    }
}
{
    "subscription":"MINT",
    "createdAt":int,
    "id":"string",
    "userId":"string",
    "data": {
        "status":"SUCCESS",
        "id":"string",
        "externalId":"string"
    }
}
{
    "subscription":"BURN",
    "createdAt":int,
    "id":"string",
    "userId":"string",
    "data": {
        "status":"SUCCESS",
        "id":"string",
        "externalId":"string"
    }
}
{
    "subscription":"SWAP",
    "createdAt":int,
    "id":"string",
    "userId":"string",
    "data": {
        "status":"SUCCESS",
        "type":"string", // Either ATOMIC, PARTIAL-BRLA or PARTIAL-USD
        "id":"string",
        "externalId":"string"
    }
}
{
    "subscription":"PIX-TO-USD",
    "createdAt":int,
    "id":"string",
    "userId":"string",
    "data": {
        "status":"SUCCESS",
        "pixToUsdId":"string", // If reason was order paid, will point to pix-to-usd id
        "type":"string",       // Either ATOMIC, PARTIAL-BRLA or PARTIAL-USD
        "id":"string",
        "externalId":"string"
    }
}
{
    "subscription":"PIX-TO-TOKEN",
    "createdAt":int,
    "id":"string",
    "userId":"string",
    "data": {
        "status":"SUCCESS",
        "token": "string",
        "type":"string", // Either ATOMIC, PARTIAL-BRLA or PARTIAL-TOKEN
        "id":"string",
        "externalId":"string"
    }
}
{
    "subscription":"USD-TO-PIX",
    "createdAt":int,
    "id":"string",
    "userId":"string",
    "data": {
        "status":"SUCCESS",
        "type":"string", // Either empty, or REFUND if payment failed
        "id":"string"
        "externalId":"string",
    }
}
{
    "subscription":"KYC",
    "createdAt":int,
    "id":"string",
    "userId":"string",
    "data": {
      	"id":"string",
        "status":"SUCCESS",
        "level":int,
      	"kycStatus":"APPROVED",
        "taxId":"string"
    }
}
{
    "subscription":"MONEY-TRANSFER",
    "createdAt":int,
    "id":"string",
    "userId":"string",
    "data": {
      	"id":"string",
        "status":"SUCCESS",
        "associatedOperationId":"string",   // Links to the id of the operation that created this transfer
      	"associatedOperationType":"string", // "BURN", for example, if it came from a burn operation
        "e2e":"string"                      // Pix transaction End to End ID
    }
}
{
    "subscription":"MINT",
    "createdAt":int,
    "id":"string",
    "userId":"string",
    "data": {
        "status":"FAILED",
        "failureReason":"string",
        "id":"string",
        "externalId":"string"
    }
}
{
    "subscription":"BURN",
    "createdAt":int,
    "id":"string",
    "userId":"string",
    "data": {
        "status":"FAILED",
        "failureReason":"string",
        "id":"string",
        "externalId":"string"
    }
}
{
    "subscription":"SWAP",
    "createdAt":int,
    "id":"string",
    "userId":"string",
    "data": {
        "status":"FAILED",
        "type":"string", // Either ATOMIC, PARTIAL-BRLA or PARTIAL-USD
        "failureReason":"string",
        "id":"string",
        "externalId":"string"
    }
}
{
    "subscription":"PIX-TO-USD",
    "createdAt":int,
    "id":"string",
    "userId":"string",
    "data": {
        "status":"FAILED",
        "pixToUsdId":"string", // If reason was order paid, will point to pix-to-usd id
        "type":"string",       // Either ATOMIC, PARTIAL-BRLA or PARTIAL-USD
        "failureReason":"string",
        "id":"string",
        "externalId":"string"
    }
}
{
    "subscription":"PIX-TO-TOKEN",
    "createdAt":int,
    "id":"string",
    "userId":"string",
    "data": {
        "status":"FAILED",
        "token": "string",
        "id": "string",
        "type":"string", // Either ATOMIC, PARTIAL-BRLA or PARTIAL-USD
        "failureReason":"string",
        "externalId":"string"
    }
}
{
    "subscription":"USD-TO-PIX",
    "createdAt":int,
    "id":"string",
    "userId":"string",
    "data": {
        "status":"FAILED",
        "type":"string", // Either empty, or REFUND if payment failed
        "failureReason":"string",
        "id":"string",
        "externalId":"string",
    }
}
{
    "subscription":"KYC",
    "createdAt":int,
    "id":"string",
    "userId":"string",
    "data": {
      	"id":"string",
        "status":"FAILED",
        "level":int,
      	"kycStatus":"REJECTED",
        "taxId":"string",
        "failureReason":"string" // Reason why KYC was rejected
    }
}
{
    "subscription":"MONEY-TRANSFER",
    "createdAt":int,
    "id":"string",
    "userId":"string",
    "data": {
      	"id":"string",
        "status":"FAILED",
        "associatedOperationId":"string",   // Links to the id of the operation that created this transfer
      	"associatedOperationType":"string", // "BURN", for example, if it came from a burn operation
      	"failureReason":"string",
        "e2e":"string" // Pix transaction End to End ID
    }
}
{
    "subscription":"BALANCE-UPDATE",
    "createdAt":int,
    "id":"string",
    "userId":"string",
    "data": {
        "tokenAddress":"string", // Address of the token received
        "fromAddress":"string",  // Address of who sent the tokens
        "amount":"string",       // Amount (two decimal places, rounded down) received
        "tx":"string",           // Blockchain transaction hash of the transfer operation
        "tokenName":"string"     // Friendly token name (e.g. BRLA, USDC, USDT...)
    }
}
{
    "subscription":"REPOST-TRANSACTION",
    "createdAt":int,
    "id":"string",
    "userId":"string",
    "data": {
        "id":"string",     // Id of the operation
        "status":"string", // Always POSTED
        "oldTx":"string",  // Tx hash of old (not mined) transaction
        "newTx":"string",  // Tx hash of new (reposted) transaction
        "chain":"string", 
        "reason":"string", // Reason for the repost
    }
}
// When a Pay Out gets refunded (action executed by the receiver)
{
    "subscription":"MONEY-TRANSFER",
    "createdAt":int,
    "id":"string",
    "userId":"string",
    "data": {
      	"id":"string",
        "status":"REVERSED",
        "associatedOperationId":"string",   // Links to the id of the operation that created this transfer
      	"associatedOperationType":"string", // "BURN", for example, if it came from a burn operation
      	"failureReason":"string",
        "e2e":"string",       // Pix transaction End to End ID
        "revertedAmount":int, // Amount that was received back
    }
}

The userId field identifies either the main account or a subaccount.

CreatedAt is the timestamp in UNIX milliseconds. The outtermost ID identifies the event, and the innermost ID identifies the operation.

DepositId connects the MINT event with a paid deposit for QUEUED events. The same is valid for pixToUsdId, for PIX-TO-USD events.

KYC events come with an extra kycStatus, which can be either PENDING, APPROVED or REJECTED, as well as the taxId and the level being processed.

Some things to note:

  • The URL must be https, otherwise we won't accept it
  • Our requests have a 5 second timeout limit
  • Our system expect a response status code smaller than 500. Anything equal or higher than 500 will be treated as a failure. Events which failed to be delivered will be marked with a false acknowledged status, which you can use as a filter in Get user's webhook events.

The BALANCE-UPDATE event notifies only increments of tokens in your account (that is, only if someone sent you tokens). It does not trigger when sending out tokens from your account.

The REPOST-TRANSACTION event can happen when a transaction needs to be reposted due to some reason. Most of the time, a repost occurs when a transaction takes too long to be mined, and we need to readjust the blockchain gas price.