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}
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
Headers
Authorization: Bearer
200
Headers
Content-Type: application/json
Body
{
"incomes": [
{
"deposit_address": "0QB7BSerVyP9xAKnxp3QpqR8JO2HKwZhl10zsfwg7aJ281ZR",
"time": 1680604643,
"source_address": "0QAUuul9LdYcyJuBHernHo3JkbWTduH_FuEb2H8jCDdGesOP",
"amount": "1000000",
"comment": "hello"
},
{
"deposit_address": "0QCdyiS-fIV9UVfI9Phswo4l2MA-hm8YseHynZ_YiH9Y1oSe",
"time": 1680604648,
"source_address": "0QAUuul9LdYcyJuBHernHo3JkbWTduH_FuEb2H8jCDdGesOP",
"amount": "1000000",
"comment": "hello"
}
]
}
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)
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
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
{
"status": "pending"
}
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.
Example URI
200
Headers
Content-Type: application/json
Body
{
"is_synced": false
}
500
Headers
Content-Type: application/json
Body
{
"error": "error text"
}