Back to top

Payment processor API

This API describes endpoints of payment processor.

Resource Group

New address

New address
POST/v1/address/new

Generates new deposit address

Example URI

POST /v1/address/new
Request
HideShow
Headers
Content-Type: application/json
Authorization: Bearer
Body
{
  "user_id": "123",
  "currency": "TON"
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "address": "0QB7BSerVyP9xAKnxp3QpqR8JO2HKwZhl10zsfwg7aJ281ZR"
}
Response  400
HideShow
Headers
Content-Type: application/json
Body
{
  "error": "error text"
}
Response  401
Response  500
HideShow
Headers
Content-Type: application/json
Body
{
  "error": "error text"
}

Get all addresses

Get all addresses
GET/v1/address/all{?user_id}

Get all created addresses by user_id

Example URI

GET /v1/address/all?user_id=
URI Parameters
HideShow
user_id
string (required) 

an unique identifier of the user

Request
HideShow
Headers
Authorization: Bearer
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "addresses": [
    {
      "address": "0QB7BSerVyP9xAKnxp3QpqR8JO2HKwZhl10zsfwg7aJ281ZR",
      "currency": "TON"
    },
    {
      "address": "0QCdyiS-fIV9UVfI9Phswo4l2MA-hm8YseHynZ_YiH9Y1oSe",
      "currency": "TGR"
    }
  ]
}
Response  400
HideShow
Headers
Content-Type: application/json
Body
{
  "error": "error text"
}
Response  401
Response  500
HideShow
Headers
Content-Type: application/json
Body
{
  "error": "error text"
}

Get income

Get income
GET/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

GET /v1/income?user_id=
URI Parameters
HideShow
user_id
string (required) 

an unique identifier of the user

Request
HideShow
Headers
Authorization: Bearer
Response  200
HideShow
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"
    }
  ]
}
Response  400
HideShow
Headers
Content-Type: application/json
Body
{
  "error": "error text"
}
Response  401
Response  500
HideShow
Headers
Content-Type: application/json
Body
{
  "error": "error text"
}

Get history

Get history
GET/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

GET /v1/deposit/history?user_id=&currency=&limit=&offset=&sort_order=
URI Parameters
HideShow
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.

Request
HideShow
Headers
Authorization: Bearer
Response  200
HideShow
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"
    }
  ]
}
Response  400
HideShow
Headers
Content-Type: application/json
Body
{
  "error": "error text"
}
Response  401
Response  500
HideShow
Headers
Content-Type: application/json
Body
{
  "error": "error text"
}

Send withdrawal

Send withdrawal
POST/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

POST /v1/withdrawal/send
Request
HideShow
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"
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "ID": 1
}
Response  400
HideShow
Headers
Content-Type: application/json
Body
{
  "error": "error text"
}
Response  401
Response  500
HideShow
Headers
Content-Type: application/json
Body
{
  "error": "error text"
}

Send service withdrawal

Send service withdrawal
POST/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

POST /v1/withdrawal/service/ton
Request
HideShow
Headers
Content-Type: application/json
Authorization: Bearer
Body
{
  "from": "0QAUuul9LdYcyJuBHernHo3JkbWTduH_FuEb2H8jCDdGesOP",
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "memo": "123e4567-e89b-12d3-a456-426655440000"
}
Response  400
HideShow
Headers
Content-Type: application/json
Body
{
  "error": "error text"
}
Response  401
Response  500
HideShow
Headers
Content-Type: application/json
Body
{
  "error": "error text"
}

Send service withdrawal

Send service withdrawal
POST/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

POST /v1/withdrawal/service/jetton
Request
HideShow
Headers
Content-Type: application/json
Authorization: Bearer
Body
{
  "owner": "0QAUuul9LdYcyJuBHernHo3JkbWTduH_FuEb2H8jCDdGesOP",
  "jetton_master": "kQCKt2WPGX-fh0cIAz38Ljd_OKQjoZE_cqk7QrYGsNP6wfP0",
}
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "memo": "123e4567-e89b-12d3-a456-426655440000"
}
Response  400
HideShow
Headers
Content-Type: application/json
Body
{
  "error": "error text"
}
Response  401
Response  500
HideShow
Headers
Content-Type: application/json
Body
{
  "error": "error text"
}

Get withdrawal status

Get withdrawal status
GET/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

GET /v1/withdrawal/status?id=
URI Parameters
HideShow
id
number (required) 

An unique identifier of the withdrawal.

Request
HideShow
Headers
Content-Type: application/json
Authorization: Bearer
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "user_id": "123",
  "query_id": "321",
  "status": "processed",
  "tx_hash": "9d0fb69b1ca9371bc9e5260a248cda12a1c42916f9051fe9fc21b4abdd41d744"
}
Response  400
HideShow
Headers
Content-Type: application/json
Body
{
  "error": "error text"
}
Response  401
Response  500
HideShow
Headers
Content-Type: application/json
Body
{
  "error": "error text"
}

Get balance

Get balance
GET/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

GET /v1/balance?currency=&address=
URI Parameters
HideShow
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.

Request
HideShow
Headers
Authorization: Bearer
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "balance": "1000000",
  "status": "active",
  "total_processing_amount": "1000",
  "total_pending_amount": "1000"
}
Response  400
HideShow
Headers
Content-Type: application/json
Body
{
  "error": "error text"
}
Response  401
Response  500
HideShow
Headers
Content-Type: application/json
Body
{
  "error": "error text"
}

Get sync flag

Get sync flag
GET/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

GET /v1/system/sync
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "is_synced": false,
  "last_block_gen_utime": 1718490850,
}
Response  500
HideShow
Headers
Content-Type: application/json
Body
{
  "error": "error text"
}

Get income by transaction hash

Get income by transaction hash
GET/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

GET /v1/deposit/income?tx_hash=
URI Parameters
HideShow
tx_hash
string (required) 

an unique hash of replenishment transaction

Request
HideShow
Headers
Authorization: Bearer
Response  200
HideShow
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"
  }
}
Response  400
HideShow
Headers
Content-Type: application/json
Body
{
  "error": "error text"
}
Response  401
Response  404
HideShow
Headers
Content-Type: application/json
Body
{
  "error": "error text"
}
Response  500
HideShow
Headers
Content-Type: application/json
Body
{
  "error": "error text"
}

Resolve domain name

Resolve domain name
GET/v1/resolve{?domain}

Resolve domain name. Returns bounceable user-friendly address for smart-contract (dns_smc_address#9fd3 DNS record).

Example URI

GET /v1/resolve?domain=
URI Parameters
HideShow
domain
string (required) 

domain name (for example: wallet.ton)

Request
HideShow
Headers
Authorization: Bearer
Response  200
HideShow
Headers
Content-Type: application/json
Body
{
  "address": "kQCKt2WPGX-fh0cIAz38Ljd_OKQjoZE_cqk7QrYGsNP6wfP0"
}
Response  400
HideShow
Headers
Content-Type: application/json
Body
{
  "error": "error text"
}
Response  401
Response  404
HideShow
Headers
Content-Type: application/json
Body
{
  "error": "error text"
}
Response  500
HideShow
Headers
Content-Type: application/json
Body
{
  "error": "error text"
}

Generated by aglio on 17 Jun 2024