xRocket Pay REST API
xRocket Pay API allows developers integrating xRocket Pay features in their projects to to manage cheques, transfers, invoices, request withdrawal links, execute withdrawals, mass-transfers, request rates etc.
Most Pay API endpoints are private meaning that they require authorization with the Bearer token. Requests to private endpoints without a valid token will be rejected.
Use REST API on this website or our API Swagger to test and review request/response examples and other details:
Production -Testnet
Authorization
- Get your Bearer token (API Key) to use any private endpoints. In Telegram bot go to Settings➡Exchange settings➡API token or contact xRocket support for assistance.
- Add the Bearer token in the requests while using any private endpoints as follows:
"Authorization: Bearer SpjEQPuvEGMae7QLaNzR8I47D3qzUP"
Your Bearer token grants full access to your xRocket Pay account -- including transfers, withdrawals, and cheque creation. Never share it publicly, commit it to version control, embed it in client-side code, or transmit it over unencrypted connections. If you suspect your token has been compromised, regenerate it immediately in the bot settings.
Use the testnet bot to get a Bearer token for testnet integration. Testnet tokens work only with the testnet API base URL and do not affect real balances.
Request/response example
The tokens, IDs, and amounts shown below are placeholder values for illustration purposes. Replace them with your actual credentials and data when making real requests.
In this example the GET /api/v1/transfer method is used to request info about a specified transfer from one xRocket user to another. The method requests an xRocket account-related data. Such requests require authorization token that can be issued to a user account by xRocket bot.
curl -L 'https://pay.api.pp.xrocket.tg/api/v1/transfer?transferId=123321232&clientTransferId=123456789' \
-H 'Accept: application/json'
-H 'Authorization: Bearer 10Q9DG5BG0ReG3jCdyEQ6C5yQkhHRX'
The request is sent to URL of the API method: https://pay.api.pp.xrocket.tg/api/v1/transfer
| Example field and value | Description |
|---|---|
transferId: 123321232 | Transfer ID. |
clientTransferId: 123456789 | Client transfer ID. |
'Authorization: Bearer 10Q9DG5BG0ReG3jCdyEQ6C5yQkhHRX' | The GET /api/v1/transfer method requests an xRocket account-related data. Such requests require authorization token that can be issued to a user account by xRocket bot. |
Example response:
{
"transferId": "123321232",
"clientTransferId": "123456789",
"target": "87209764",
"targetType": "telegram_user_id",
"asset": "TONCOIN",
"amount": "1.23",
"description": "You are awesome!"
}
| Example field and value | Description |
|---|---|
| "transferId": "123321232" | Transfer unique ID. |
| "clientTransferId": "123456789" | Client transfer unique ID. |
| "target": "123" | Receiver identifier (Telegram user ID, phone number, etc.). |
| "targetType": "telegram_user_id" | Type of the receiver identifier. Available values: telegram_user_id. |
| "asset": "TONCOIN" | The transferred currency. |
| "amount": "1.23" | The transfer amount. |
| "description": "You are awesome!" | Optional description added by the transfer sender. |
Methods
Several Pay API methods execute irreversible financial operations (transfers, withdrawals, mass transfers). Double-check recipient addresses, amounts, and asset types before calling these endpoints. Incorrect transfers and withdrawals to external addresses cannot be reversed.
| Method | Description |
|---|---|
| Cheques | Methods for processing payouts with xRocket personalized cheques. |
| Create cheque | Create a new personal cheque for a accept-type transfer. The amount of the created cheque is reserved on the wallet balance and can be redeemed by the recipient or cancelled before redemption. Requires authorization |
| Get list of cheques | Request the list of all personal cheques issued for accept-type transfers. Use this method to review pending, redeemed, or cancelled cheques. Requires authorization |
| Delete cheque | Delete an unredeemed personal cheque. Upon cancellation, the reserved funds are released on the wallet balance. Requires authorization |
| Get cheque info | Get details of a specified personal cheque used for an accept-type payout, including status and reserved amount. Requires authorization |
| Transfers | Methods for non-acceptance automatic payments to users directly on the platform. |
| Transfer funds to a user | Transfer funds from xRocket wallet to another xRocket user. Requires authorization |
| Get transfers list | Get the list of all the transfers. Requires authorization |
| Get transfer info | Get info about a transfer by its ID. Requires authorization |
| Create mass transfers (Telegram users only) | Mass transfer assets to xRocket users. Requires authorization |
| Invoices | Methods for managing one-time invoices that can be paid by xRocket users via link. |
| Create invoice | Create one-time invoices that can be paid by xRocket users via link. Requires authorization |
| Get list of invoices | Get the list of active invoices. Requires authorization |
| Get invoice info | Get invoice info by ID. Requires authorization |
| Delete invoice | Delete an invoice by ID. Requires authorization |
| Pay invoice for test only | (Test only) method to pay an invoice. Requires authorization |
| Withdrawal | Methods for withdrawal of assets from xRocket wallet to external addresses. |
| Create withdrawal link | Create deep links for withdrawals for simplified integration. User will need to confirm the withdrawal after following the link. Requires authorization |
| Withdraw funds from application to external wallet | Withdraw assets from xRocket wallet to an external blockchain address. Requires authorization |
| Get application withdrawals | Get info about withdrawals from xRocket wallet to an external blockchain address. Requires authorization |
| Get application withdrawal info | Get info about a withdrawal from xRocket wallet to an external blockchain address by ID. Requires authorization |
| Get application withdrawal quotas | Get info about current withdrawal fees. |
| Currencies and rates | Get info about currencies and their rates. |
| Get available currencies | Get the list of available currencies. |
| Get currencies rates | Get the rates of a specified currency in a specified currencies. |
| App | Methods for getting info about your app. |
| Get info about your application | Get info about your app. |
| Get balances of your application | Get balances of your wallet. Requires authorization |