kamiPay LogokamiPay Docs

Withdraw

Send USDT or Matic back to your whitelisted address

This endpoint allows you to withdraw USDT or Matic from your kamiPay wallet to a previously whitelisted address.

Instructions are simple, just add the chain, token, amount, the address from and address to. If the addresses are not previously mapped to your user, the endpoint will fail with status 400.

Request Body

NameTypeDescription
chainstringRequired. Indicates the blockchain network in use. Currently only 'polygon' is supported.
tokenstringRequired. Represents the token to withdraw: 'usdt' or 'matic'.
amountfloatRequired. Specifies the amount to withdraw, expressed as a float.
from_addressstringRequired. Represents the sending wallet's address.
to_addressstringRequired. Represents the receiving wallet's address. Must be previously whitelisted.

The receiving address must be previously whitelisted for your account. Non-whitelisted addresses will result in a 400 error.

Example Request

const url = `${baseURL}/v1/wallet/withdraw`;
 
const body = {
  "chain": "polygon",
  "token": "usdt",
  "amount": 0.10,
  "from_address": "0x1c0aCxxxxxx488fEdce1ab4",
  "to_address": "0x6Fe712cxxxxxx0E72988e68"
};
 
const response = await fetch(url, {
  method: "POST",
  headers: {
    Authorization: `Bearer ${access_token}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify(body),
});

Response

{
  "status": "ok",
  "msg": "transaction succesful",
  "data": {
    "status": "mined",
    "transactionHash": "0x0c5fabf2a7c76c809b345b6xxxxxd2d414b405033619067c9b425",
    "to": "00x6Fe712cxxxxxx0E72988e68",
    "usdt amount": 0.1
  }
}

Withdrawal transactions are processed on the blockchain and may take some time to complete depending on network conditions.

Always double-check the receiving address before initiating a withdrawal, as blockchain transactions cannot be reversed once confirmed.

On this page