Transfer methods

Transfer object

confirmations number

The number of blockchain confirmations received.

op_id number

Identifier of the associated operation.

op_type number

Type of the associated operation:

  • 1 — an invoice

  • 2 — a payout

  • 5 — an incoming transfer due to exchange execution

  • 9 — the writing off costs associated with sending tokens; the amount of such transfer includes blockchain fee for withdrawal of tokens

  • 14 — the direct deposit to the wallet address

  • 16 — other wallet fees charging

  • 17 — an outgoing transfer due to exchange execution

  • 19 — a non-withdrawable activation transfer for Ripple, Stellar, Binance Coin

risk_status number

The status of the AML check:

  • 1 — transfer is checked and marked as green

  • 2 — transfer is in the queue for checking

  • 3 — transfer is checked and marked as red

  • 4 — transfers of this type are unavailable for the check

risk number

The percent of the AML risk for the transfer. Possible value range is from 0 to 100. The field can have null value if the AML check was not performed.

status number

Transfer status:

  • -3 — the transfer is cancelled due to security reasons or a small transaction amount

  • -2 — the transfer is temporarily blocked due to security reasons

  • -1 — the transfer has failed in the blockchain

  • 0 — the transfer is created (pending in queue for processing)

  • 1 — the transfer is unconfirmed (not enough confirmations or AML check is still being performed)

  • 2 — the transfer is confirmed

amount string

Useful part of the transfer amount. It is calculated as the transfer amount minus the blockchain fee. For the invoice transfers, this field reflects the amount received.

amount_target string

The transfer amount, in the wallet currency.

amount_cleared string

The amount to be deposited to a wallet or the amount to be withdrawn from the wallet.

commission string

Processing fee amount.

txid string

The address for the received payment.

fee string

The blockchain fee. For invoices the value is always 0.

user_message string

Notes or errors descriptions.

created_at string

The time of the transfer creation as per ISO 8601 with μs precision and timezone included: YYYY-MM-DDThh:mm:ss[.SSSSSS]±hh:mm.

updated_at string

The time of the transfer update as per ISO 8601 with μs precision and timezone included: YYYY-MM-DDThh:mm:ss[.SSSSSS]±hh:mm.

currency object

The transaction currency. Contains currency id (refer to Currency codes for supported values).

wallet object

The wallet with which the transaction is associated. Contains wallet id and a link to the wallet.

parent object

Applicable mainly for tokens. Contains a link to the parent transfer, if the current transfer depends on the parent one. In other cases returns null.

TRANSFER OBJECT
{
  "data": {
    "type": "transfer",
    "id": "82",
    "attributes": {
      "confirmations": 487,
      "op_id": 2,
      "op_type": 18,
      "risk_status": 1,
      "risk": 15,
      "amount": "0.00001500",
      "commission": "0.00000000",
      "fee": "0.00000329",
      "txid": "4642e3ed5f78b9b9f08a6ca2799e0b9a840a0f4eae3ca4bffebae",
      "status": 2,
      "user_message": null,
      "created_at": "2020-11-06T06:25:37.151758Z",
      "updated_at": "2020-11-06T08:17:16.453885Z"
    },
    "relationships": {
      "currency": {
        "data": {
          "type": "currency",
          "id": "1000"
        }
      },
      "wallet": {
        "data": {
          "type": "wallet",
          "id": "14"
        }
      },
      "parent": {
        "data": null
      }
    }
  }
}

Get transfer

Request

id string

The transfer identifier.

Filtering by any object parameters can be applied according to the JSON API Specification.

GET[base]/transfer/{id}

$ curl --request GET \
       --url https://api.b2binpay.com/transfer/ \
       --header 'authorization: Bearer eyJ0eXAiOiJKV1QiLC...' \
       --header 'content-type: application/vnd.api+json'
import requests

url = 'https://api.b2binpay.com/transfer/'

headers = {
    'authorization': 'Bearer <Change to your access token>',
    'content-type': 'application/vnd.api+json',
}

requests.get(url, headers=headers)
<?php

use GuzzleHttp\Client;
use GuzzleHttp\Exception\RequestException;

$client = new GuzzleHttp\Client();
try {
    $res = $client->get('https://api.b2binpay.com/transfer/', [
        'headers' => [
            'Authorization' => 'Bearer <Change to your access token>',
            'Content-Type' => 'application/vnd.api+json',
        ],
    ]);
    echo $res->getBody();
} catch (RequestException $e) {}

Response

In case of a successful response, a transfer object or an array of objects (if id was not specified) is returned.

HTTP status codes

200 Success.

400 Bad request.

404 Transfer with given id not found.

Transfer filtering

For quick search through lists, filtering can be used. The filtering is performed by means of adding GET parameters to the query string. You can filter by the object fields name. Note that some fields cannot be used as filter criteria.

Request

No parameters

GET[base]/transfer/

$ curl --request GET \
       --url ‘http://0.0.0.0:80/transfer/?%5Bop_type%5D=2&filter%5Bop_id%5D=100\
       --header ‘Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ0b2tlbl90eXBlIjoiYWNjZXNzIiwiZXhwIjoxNjM5MDAzODg5LCJqdGkiOiJmYzM2ZGIyMWU3NmM0ODk4OWI1ZjYwNDlkNmZmYjQ2YSIsInVzZXJfaWQiOjR9.axybuLc5qVBiyTw12O1kap1mzcIeB-s4GVnYX_NDGDI’
import requests

url = 'https://api.b2binpay.com/transfer/'

headers = {
    'Authorization': 'Bearer <Change to your access token>',
    'Content-Type': 'application/vnd.api+json',
}

params = (
    ('filter[op_type]', '1'),
    ('filter[op_id]', '105'),
)

requests.get(url, headers=headers, params=params)
<?php

use GuzzleHttp\Client;
use GuzzleHttp\Exception\RequestException;

$client = new GuzzleHttp\Client();
try {
    $res = $client->get('https://api.b2binpay.com/transfer/', [
        'headers' => [
            'Authorization' => 'Bearer <Change to your access token>',
            'Content-Type' => 'application/vnd.api+json',
        ],
        'query' => [
          'filter[op_type]' => 1,
          'filter[op_id]' => 105,
        ],
    ]);
    echo $res->getBody();
} catch (RequestException $e) {}

HTTP status codes

200 Success.

400 Bad request.