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}

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=
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

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"
    },
    {
      "deposit_address": "0QCdyiS-fIV9UVfI9Phswo4l2MA-hm8YseHynZ_YiH9Y1oSe",
      "time": 1680604648,
      "source_address": "0QAUuul9LdYcyJuBHernHo3JkbWTduH_FuEb2H8jCDdGesOP",
      "amount": "1000000",
      "comment": "hello"
    }
  ]
}
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)

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

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
{
  "status": "pending"
}
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.

Example URI

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

Generated by aglio on 26 Sep 2023