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.
| Name | Description |
|---|---|
| user | Id of your customer in your system who is performing the withdrawal. |
| amount | Token amount in wei (or smallest unit) |
| chainId | Chain ID of the token |
| symbol | Symbol of the token |
chainId and symbol should be the one you retrieved from Getting Customer Balances API.
- Regarding
userfield, it is recommended to use hashed format to prevent enumeration of user ids. - IMPORTANT: Please ensure that you do not specify
balancesexceeding the amount your user is eligible to withdraw.
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.