LogoLogo
Release notesHomepageTry demo
  • Welcome to B2BINPAY docs
  • Get started
    • Quick start guide
    • Explore the Web interface
  • User guide
    • Wallet management
      • Wallets
      • Transfers
      • Deposits
      • Payouts
      • Events
      • Callbacks
    • Custody
      • Wallets
      • Requests
      • History
    • Staking
      • TRX staking
    • Rates
    • Swaps
      • Wallets
      • Swap
      • History
  • How-tos
    • Manage your profile and system
      • How to change your password
      • How to enable 2FA
      • How to whitelist IP addresses
      • How to access the API
      • How to enable additional AML check
    • Manage your wallets
      • How to create a wallet
      • How to grant access to your wallet
      • How to manage user roles
      • How to restrict access to your wallet
      • How to generate a report on wallet balances
      • How to set withdrawal thresholds
    • Manage your assets
      • How to create a deposit
      • How to create a payout
      • How to create a bank withdrawal
      • How to create an internal transfer
      • How to select the optimal blockchain fee
      • How to speed up your payout by changing the blockchain fee
      • How to whitelist a payout address
      • How to swap funds
      • How to top up or withdraw funds from your Custody wallet
  • API guide
    • API overview
    • Authentication
    • Wallet methods
    • Transfer methods
    • Deposit methods
    • Payout methods
    • Currency methods
    • Rate methods
  • References
    • Key terms
    • User roles
    • Transfer types
    • Currency codes
    • Block explorer list
    • Address types
    • Useful links
  • Troubleshooting
    • Error: No active account found with the given credentials
    • Error: Invalid 2FA code
    • Error: You IP is not whitelisted
    • Unresolved deposits
    • Missing deposits
    • Canceled transfers
    • Unconfirmed transfers
  • Release notes
Powered by GitBook
On this page
  • Rate object
  • Get rates
  • Request
  • Response

Was this helpful?

  1. API guide

Rate methods

Rate object

Name
Type
Description

left

string

The base currency.

right

string

The quote currency.

bid

string

The current bid price.

ask

string

The current ask price.

exp

number

The currency precision, that is the number of digits after the decimal separator, for the bid and ask fields.

created_at

string

The date and time when a rate was received.

expired_at

string

The date and time of rate expiration.

Rate object example

{
  "type": "rate",
  "id": "0",
  "attributes": {
    "left": "ZRX",
    "right": "USDC",
    "bid": "0.381855018600000000",
    "ask": "0.389670322000000000",
    "exp": 18,
    "expired_at": "2024-02-28T09:45:48.314413Z",
    "created_at": "2024-02-28T09:40:48.314413Z"
  }
}

Get rates

Request

GET [base]/rates/

Request example

curl --request GET \
--url [base]/rates/ \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/vnd.api+json'
import requests

url = '[base]/rates/'

headers = {
  'Authorization': 'Bearer <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('[base]/rates/', [
    'headers' => [
      'Authorization' => 'Bearer <token>',
      'Content-Type' => 'application/vnd.api+json',
    ],
  ]);
echo $res->getBody();
} catch (RequestException $e) {}

Response

Response codes

HTTP code
Application code
Description
Suggested action

200

—

The request succeeded.

—

400

—

bad request.

—

500

—

Internal server error.

Try again later.

502

—

Bad gateway.

Try again later.

503

—

Service unavailable.

Try again later.

504

—

Gateway timeout.

Try again later.

5xx

—

Other server errors.

Try again later.

PreviousCurrency methodsNextKey terms

Last updated 7 months ago

Was this helpful?

Rates can be filtered by the left and right parameters according to the . For example, the response body will only contain the rates with the BTC base currency: /rates?filter[left]=BTC. You can specify more than one currency, for example, the response body will contain the rates with the BTC and USDT base currencies: /rates?filter[left]=BTC,USDT.

In case of success, the response body contains an array of .

JSON API Specification
rate objects