Payment processor API
This API describes endpoints of payment processor.
Resource Group ¶
New address ¶
New addressPOST/v1/address/new
Generates new deposit address
Example URI
Headers
Content-Type: application/json
Authorization: Bearer
Body
{
"user_id": "123",
"currency": "TON"
}
200
Headers
Content-Type: application/json
Body
{
"address": "0QB7BSerVyP9xAKnxp3QpqR8JO2HKwZhl10zsfwg7aJ281ZR"
}
400
Headers
Content-Type: application/json
Body
{
"error": "error text"
}
401
500
Headers
Content-Type: application/json
Body
{
"error": "error text"
}
Get all addresses ¶
Get all addressesGET/v1/address/all{?user_id}
Get all created addresses by user_id
Example URI
- user_id
string
(required)an unique identifier of the user
Headers
Authorization: Bearer
200
Headers
Content-Type: application/json
Body
{
"addresses": [
{
"address": "0QB7BSerVyP9xAKnxp3QpqR8JO2HKwZhl10zsfwg7aJ281ZR",
"currency": "TON"
},
{
"address": "0QCdyiS-fIV9UVfI9Phswo4l2MA-hm8YseHynZ_YiH9Y1oSe",
"currency": "TGR"
}
]
}
400
Headers
Content-Type: application/json
Body
{
"error": "error text"
}
401
500
Headers
Content-Type: application/json
Body
{
"error": "error text"
}
Get income ¶
Get incomeGET/v1/income{?user_id}
Get income for deposits by user_id
. The total amount of funds that came to the deposit for the entire time.
Funds sent from the deposit to the hot wallet or all funds received to the deposit are taken into account,
depending on the service settings.
Counting side field options: “hot_wallet”, “deposit”.
Example URI
- user_id
string
(required)an unique identifier of the user
Headers
Authorization: Bearer
200
Headers
Content-Type: application/json
Body
{
"counting_side": "deposit",
"total_income": [
{
"deposit_address": "0QB7BSerVyP9xAKnxp3QpqR8JO2HKwZhl10zsfwg7aJ281ZR",
"amount": "1000000",
"currency": "TON"
},
{
"deposit_address": "0QCdyiS-fIV9UVfI9Phswo4l2MA-hm8YseHynZ_YiH9Y1oSe",
"amount": "1023000",
"currency": "TGR"
}
]
}
400
Headers
Content-Type: application/json
Body
{
"error": "error text"
}
401
500
Headers
Content-Type: application/json
Body
{
"error": "error text"
}
Get history ¶
Get historyGET/v1/deposit/history{?user_id,currency,limit,offset,sort_order}
Get history for deposits by user_id
and currency
. Returns the history of all deposits replenishments with the
sender’s address as source_address
(if it could be determined).
Example URI
- user_id
string
(required)an unique identifier of the user
- currency
string
(required)the text identifier of the currency specified in the processor configuration.
TON
for TON coin.- limit
number
(required)the maximum value of returned records
- offset
number
(required)offset for returned records
- sort_order
string
(required)asc or desc. desc by default if the parameter is not specified.
Headers
Authorization: Bearer
200
Headers
Content-Type: application/json
Body
{
"incomes": [
{
"deposit_address": "0QB7BSerVyP9xAKnxp3QpqR8JO2HKwZhl10zsfwg7aJ281ZR",
"time": 1680604643,
"source_address": "0QAUuul9LdYcyJuBHernHo3JkbWTduH_FuEb2H8jCDdGesOP",
"amount": "1000000",
"comment": "hello",
"tx_hash": "9d0fb69b1ca9371bc9e5260a248cda12a1c42916f9051fe9fc21b4abdd41d744"
},
{
"deposit_address": "0QCdyiS-fIV9UVfI9Phswo4l2MA-hm8YseHynZ_YiH9Y1oSe",
"time": 1680604648,
"source_address": "0QAUuul9LdYcyJuBHernHo3JkbWTduH_FuEb2H8jCDdGesOP",
"amount": "1000000",
"comment": "hello",
"tx_hash": "7d0fb69b1ca9371bc9e5260a248cda12a1c42916f9051fe9fc21b4abdd41d744"
}
]
}
400
Headers
Content-Type: application/json
Body
{
"error": "error text"
}
401
500
Headers
Content-Type: application/json
Body
{
"error": "error text"
}
Send withdrawal ¶
Send withdrawalPOST/v1/withdrawal/send
Send withdrawal request. Amount must be in base units without decimal point (NanoTONs for TONs)
Instead of a comment
, you can specify a binary_comment
in hex notation format.
binary_comment
supports binary string hex representation form with flip bit (example: 9fe7_
)
Example URI
Headers
Content-Type: application/json
Authorization: Bearer
Body
{
"user_id": "123",
"query_id": "321",
"currency": "TON",
"amount": "100",
"destination": "0QCdyiS-fIV9UVfI9Phswo4l2MA-hm8YseHynZ_YiH9Y1oSe",
"comment": "hello"
}
200
Headers
Content-Type: application/json
Body
{
"ID": 1
}
400
Headers
Content-Type: application/json
Body
{
"error": "error text"
}
401
500
Headers
Content-Type: application/json
Body
{
"error": "error text"
}
Send service withdrawal ¶
Send service withdrawalPOST/v1/withdrawal/service/ton
Send service withdrawal request. Withdraw all TONs from from
address to hot wallet.
Returns memo
as comment for transfer message.
Example URI
Headers
Content-Type: application/json
Authorization: Bearer
Body
{
"from": "0QAUuul9LdYcyJuBHernHo3JkbWTduH_FuEb2H8jCDdGesOP",
}
200
Headers
Content-Type: application/json
Body
{
"memo": "123e4567-e89b-12d3-a456-426655440000"
}
400
Headers
Content-Type: application/json
Body
{
"error": "error text"
}
401
500
Headers
Content-Type: application/json
Body
{
"error": "error text"
}
Send service withdrawal ¶
Send service withdrawalPOST/v1/withdrawal/service/jetton
Send service withdrawal request. Withdraw all Jettons from Jetton wallet. Address calculated through owner and Jetton master.
Returns memo
as comment for transfer message.
Example URI
Headers
Content-Type: application/json
Authorization: Bearer
Body
{
"owner": "0QAUuul9LdYcyJuBHernHo3JkbWTduH_FuEb2H8jCDdGesOP",
"jetton_master": "kQCKt2WPGX-fh0cIAz38Ljd_OKQjoZE_cqk7QrYGsNP6wfP0",
}
200
Headers
Content-Type: application/json
Body
{
"memo": "123e4567-e89b-12d3-a456-426655440000"
}
400
Headers
Content-Type: application/json
Body
{
"error": "error text"
}
401
500
Headers
Content-Type: application/json
Body
{
"error": "error text"
}
Get withdrawal status ¶
Get withdrawal statusGET/v1/withdrawal/status{?id}
Get withdrawal status. Returns pending
, processing
, processed
/‘failed’, transaction hash for processed withdrawal and request meta (user_id and query_id).
Example URI
- id
number
(required)An unique identifier of the withdrawal.
Headers
Content-Type: application/json
Authorization: Bearer
200
Headers
Content-Type: application/json
Body
{
"user_id": "123",
"query_id": "321",
"status": "processed",
"tx_hash": "9d0fb69b1ca9371bc9e5260a248cda12a1c42916f9051fe9fc21b4abdd41d744"
}
400
Headers
Content-Type: application/json
Body
{
"error": "error text"
}
401
500
Headers
Content-Type: application/json
Body
{
"error": "error text"
}
Get balance ¶
Get balanceGET/v1/balance{?currency,address}
Get balance for account by address
and currency
. Returns the balance of hot wallet if address
not specified.
For hot wallet also returns total_processing_amount
and total_pending_amount
for withdrawals in queue.
For TON also returns account status: “active”, “uninit”, “frozen”, “non_exist”.
Example URI
- currency
string
(required)the text identifier of the currency specified in the processor configuration.
TON
for TON coin.- address
string
(required)address in URL-safe, user-friendly Base64 form. Hot wallet address by default if the parameter is not specified.
Headers
Authorization: Bearer
200
Headers
Content-Type: application/json
Body
{
"balance": "1000000",
"status": "active",
"total_processing_amount": "1000",
"total_pending_amount": "1000"
}
400
Headers
Content-Type: application/json
Body
{
"error": "error text"
}
401
500
Headers
Content-Type: application/json
Body
{
"error": "error text"
}
Get sync flag ¶
Get sync flagGET/v1/system/sync
Get blockchain sync flag. Returns true
if the service has up-to-date data from the blockchain.
As long as the flag is equal to false
, no withdrawals are made.
Also returns last scanned workchain block gen_utime
(unix time) to evaluate the processor’s lag from the blockchain.
Example URI
200
Headers
Content-Type: application/json
Body
{
"is_synced": false,
"last_block_gen_utime": 1718490850,
}
500
Headers
Content-Type: application/json
Body
{
"error": "error text"
}
Get income by transaction hash ¶
Get income by transaction hashGET/v1/deposit/income{?tx_hash}
Find income for deposit by tx_hash
. Returns the currency and the deposit replenishment with the
sender’s address as source_address
(if it could be determined).
Example URI
- tx_hash
string
(required)an unique hash of replenishment transaction
Headers
Authorization: Bearer
200
Headers
Content-Type: application/json
Body
{
"currency": "TON",
"income": {
"deposit_address": "0QB7BSerVyP9xAKnxp3QpqR8JO2HKwZhl10zsfwg7aJ281ZR",
"time": 1680604643,
"source_address": "0QAUuul9LdYcyJuBHernHo3JkbWTduH_FuEb2H8jCDdGesOP",
"amount": "1000000",
"comment": "hello",
"tx_hash": "9d0fb69b1ca9371bc9e5260a248cda12a1c42916f9051fe9fc21b4abdd41d744"
}
}
400
Headers
Content-Type: application/json
Body
{
"error": "error text"
}
401
404
Headers
Content-Type: application/json
Body
{
"error": "error text"
}
500
Headers
Content-Type: application/json
Body
{
"error": "error text"
}
Resolve domain name ¶
Resolve domain nameGET/v1/resolve{?domain}
Resolve domain name. Returns bounceable user-friendly address for smart-contract (dns_smc_address#9fd3
DNS record).
Example URI
- domain
string
(required)domain name (for example: wallet.ton)
Headers
Authorization: Bearer
200
Headers
Content-Type: application/json
Body
{
"address": "kQCKt2WPGX-fh0cIAz38Ljd_OKQjoZE_cqk7QrYGsNP6wfP0"
}
400
Headers
Content-Type: application/json
Body
{
"error": "error text"
}
401
404
Headers
Content-Type: application/json
Body
{
"error": "error text"
}
500
Headers
Content-Type: application/json
Body
{
"error": "error text"
}