Skip to main content

Withdrawl Token Generation

For your customers to withdraw their balance, your backend should call this endpoint to generate a withdrawl token, which is used to show withdrawl UI to your customer. You need to subscribe to Premium to use this API.

For more information of customer withdrawl steps, please refer to Withdrawl Integration page.

Endpoint

https://app.paycoinly.xyz/v1/withdraw/token

It is a POST request.

Headers

{ "x-api-key": "<api key>", "content-type": "application/json" }

The request should include x-api-key in its header. Please check this page to get API key in your Paycoinly dashboard.

Body

You can see the syntax of the request body below.

{
user: string;
balances: {
amount: string
chainId: number
symbol: string
}[]
}

The meaning of each field is provided in the table below.

NameDescription
userId of your customer in your system who is performing the withdrawal.
amountToken amount in wei (or smallest unit)
chainIdChain ID of the token
symbolSymbol of the token

chainId and symbol should be the one you retrieved from Getting Customer Balances API.

Security Tip
  • Regarding user field, it is recommended to use hashed format to prevent enumeration of user ids.
  • IMPORTANT: Please ensure that you do not specify balances exceeding the amount your user is eligible to withdraw.
info

You can't provide greater value than the amount returned from Getting Customer Balances API.

Response

{ "token": "<value>" }

Use this token to show Paycoinly withdrawl UI on your frontend code showing to your customers.