Rest API

Rest API

General API Information
  • The base endpoints are: and https://stream.paybito.com/
  • All endpoints return either a JSON object or array.
  • Data is returned in ascending order. Oldest first, newest last
  • All time and timestamp related fields are in milliseconds.
HTTP Return Codes
  • HTTP 4XX return codes are used for malformed requests; the issue is on the sender's side.
  • HTTP 403 return code is used when the WAF Limit (Web Application Firewall) has been violated.
  • HTTP 429 return code is used when breaking a request rate limit.
  • HTTP 418 return code is used when an IP has been auto-banned for continuing to send requests after receiving 429 codes.
  • HTTP 5XX return codes are used for internal errors; the issue is on PayBitoPro side. It is important to NOT treat this as a failure operation; the execution status is UNKNOWN and could have been a success.
General Information on Endpoints
  • For GET endpoints, parameters must be sent as a query string.
  • For POST, PUT, and DELETE endpoints, the parameters may be sent as a json object or array or in the request body with content type application/json.
  • Parameters may be sent in any order.
  • If a parameter sent in both the query string and request body, the query string parameter will be used.
Terminology

These terms will be used throughout the documentation, so it is recommended especially for new users to read to help their understanding of the API.

  • base asset refers to the asset that is the quantity of a symbol. For the symbol BTCUSD, BTC would be the base asset.
  • quote asset refers to the asset that is the price of a symbol. For the symbol BTCUSD, USD would be the quote asset.

Market Data Endpoints

Order book

GET

Name Type Mandatory Description
symbol STRING YES BTCUSD etc.
limit INT NO Default All; max 5000. Valid limits:[5, 10, 20, 50, 100, 500, 1000, 5000]

Response :

{

"ask": [

{

"price": "59000.618333",

"amount": "0.55"

}

],

"bid": [

{

"price": "58998.406682",

"amount": "0.493"

}

]

}

Recent Trade List

GET

Name Type Mandatory Description
symbol STRING YES BTCUSD etc.
limit INT NO Default All; max 5000. Valid limits:[5, 10, 20, 50, 100, 500, 1000, 5000]

Response :

[

{

"quantity": "0.743",

"price": "58961.1433",

"timestamp": "2021-03-19T16:09:10.222",

"side": "BID"

},

{

"quantity": "1.233",

"price": "59085.9472043",

"timestamp": "2021-03-19T16:04:55.384",

"side": "ASK"

}

]

24hr ticker price change statistics

GET

24 hour rolling window price change statistics. Careful when accessing this with no symbol.

Name Type Mandatory Description
counter STRING YES BTC
base STRING YES USD

Response :

[

{

"baseCurrency": "USD",

"openPrice": "58131.40352",

"closePrice": "58900.16101",

"highPrice": "59150.620965",

"lowPrice": "57662.889924",

"ltp": "58900.16101",

"volume": "53252931.59",

"roc": "1.3051874168",

"ctp": "58900.16101",

"currency": "BTC",

"action": "sell"

}

]

Tradingview Chart endpoints

Check server time

GET

Get the current server time.

Response :

1616172746

Check trading view config

GET

Trading view configuration settings.

Response :

"supports_marks": false,

"supports_marks": false,

"supports_search": true,

"supports_group_request": false,

"symbols_types": [

{

"name": "All types",

"value": ""

},

{

"name": "Crypto",

"value": "crypto"

}

],

"supported_resolutions": [

"1",

"15",

"30",

"D",

"2D",

"3D",

"W",

"3W",

"M",

"6M"

],

"supports_timescale_marks": false

}

Check trading view symbol config

GET

Trading view symbol configuration settings.

Name Type Mandatory Description
symbol STRING YES BTC/USD

Response :

{

"ticker": "BTC/USD",

"minmov2": 0,

"timezone": "Etc/UTC",

"session": "24x7",

"has_intraday": true,

"description": "",

"supported_resolutions": ["1","15","30","D","2D","3D","W","3W","M","6M"],

"type": "crypto",

"volume_precision": 8,

"pointvalue": 1,

"name": "BTC/USD",

"minmov": 1,

"pricescale": 100,

"exchange": "",

"data_status": "delayed_streaming"

}

Get trading view chart data

GET

Name Type Mandatory Description
symbol STRING YES BTC/USD
resolution STRING YES Chart intervals like D,2D,W,M,6M etc. D-> days, W-> week, M-month
from STRING YES Beginning unix timestamp, exp - 1615304149
to STRING YES End unix timestamp, exp- 1616168149

Response :

{

"t": [

"1615334400",

],

"o": [

"55244.9348434",

],

"c": [

"55795.26302",

],

"h": [

"57375.854025",

],

"l": [

"53342.072242",

],

"v": [

"311021419.829424283955",

],

"s": "ok"

}

Types

Timestamps

Unless otherwise specified, all timestamps from API are returned in ISO 8601 with microseconds. Make sure you can parse the following ISO 8601 format. Most modern languages and libraries will handle this without issues.

2020-05-19 16:49:39.003637

Rate Limit

When a rate limit is exceeded, a status of 429 Too Many Requests will be returned.

REST API

We limit endpoints by IP: 5 requests per second. It limits the number of requests an API accepts within a window of time. The API rejects requests that exceed the limit.

Private

Private endpoints are available for order management, and account management. Every private request must be signed using the described authentication scheme.

Private endpoints require authentication using your PayBitoPro API key.

Authentication

Generating an API Key

Before being able to sign any requests, you must create an API key via the PayBitoPro website. The API key will be scoped to a specific profile. Upon creating a key you will have 2 pieces of information which you must remember:

  • Key
  • Secret

The Key and Secret will be randomly generated and provided by PayBitoPro;

API Key Permissions

You can restrict the functionality of API keys. Before creating the key, you must choose what permissions you would like the key to have. The permissions are:

  • READ- Allows a key read permissions. This includes all GET endpoints.
  • DEPOSIT- Allows a key to deposit currency on behalf of an account.
  • WITHDRAW- Enable with caution - Allows a key to withdrawal currency from an account.
  • TRADE - Allows a key to create a new order, as well as modify or cancel existing order.
Creating a Request

All REST requests must contain the following headers:

  • API-KEY The api key as a string.
  • SECRET-KEY The base64-encoded signature.

Accounts

End point :

List Accounts

Get a list of trading accounts assets and their holdings from the profile of the API key.

HTTP REQUEST : POST

/getUserBalance

API KEY PERMISSIONS

This endpoint requires the "READ" permission.

Name Description
currencyId Asset Id
currencyCode Asset Code
currencyName Asset Name
closingBalance Total holdings
holdingInUsd Total holdings in USD
currencyType Asset type (Fiat/Crypto)
isMargin Allow for margin?
isFund Allow for funding?

Response:

{

"userBalanceList": [

{

"currencyId": 1,

"currencyCode": "USD",

"currencyName": "US Dollar",

"closingBalance": 4.836,

"holdingInUsd": 4.84,

"currencyType": 1,

"isMargin": 1,

"isFund": 1

}

],

"checkBeforeBuy": false,

"error": {

"error_data": 0,

"error_msg": ""

}

}

Get Account History

List account activity of the API key's profile. Account activity either increases or decreases your account balance. Items are paginated and sorted latest first.

HTTP REQUEST : POST

/getUserAllTransaction

API KEY PERMISSIONS

This endpoint requires the "READ" permission.

Name Description
transactionId Unique id for this transaction
userId User account Id
fullName User account name
email User account email
description Transaction description
action Transaction type
status Transaction status (0 - Pending, 1 - Confirmed)
orderId Allow for margin?
currency Transaction currency
debitAmount Amount to be debit
creditAmount Amount to be credit
miningfees Network fees
currencyUrl Crypto Explorer url
totalCount Total no of rows

Request:

{"pageNo":1,"noOfItemsPerPage":20,"timeSpan":"all","transactionType":"all"}

Response:

{

"userTransactionsResult": [

{

"transactionId": 228975484,

"description": "Tether sent to address 0xf35d9E66c919A22eF55E36543c8Be23CA906d0C4",

"action": "Send",

"status": 0,

"transactionTimestamp": "2021-03-19 08:56:03.156409",

"orderId": "SD210228975485",

"currency": "USDT",

"debitAmount": "1",

"creditAmount": "0",

"miningfees": "20",

"tradeAssetAmount": "USDT 1 Dr. ",

"currencyUrl": "https://etherscan.io/tx/"

}

],

"totalCount": 83,

"error": {

"error_data": 0,

"error_msg": ""

}

}

Orders

End point :

Name Description
offer_id Unique id for new order
code Order status (1 - create, 2 - update, 3 - Matched, 4 - Partial matched, 5-Delete )
amount Order quantity
price Order price
selling_asset_code Asset will be sold
buying_asset_code Asset will be bought
offerType Market/Limit (M - Market, L - Limit)
txn_type Buy/Sell (1 - Buy, 2 -Sell)
action An order update type (to update amount - ‘amountupdate’)Buy/Sell (1 - Buy, 2 -Sell)
New Order

You can place two types of orders: limit and market. Orders can only be placed if your account has sufficient funds. Once an order is placed, your account funds will be put on hold for the duration of the order. How much and which funds are put on hold depends on the order type and parameters specified. See the Holds details below.

HTTP REQUEST : POST

/TradeCreateOffer

API KEY PERMISSIONS

This endpoint requires the "TRADE" permission.

Request:

{"selling_asset_code":"INR","buying_asset_code":"HBAR","amount":1,"price":20.60522919,"offerType":"L","txn_type":"1",”orderType”:”GTC”}

Response:

{

"error": {

"error_data": 0,

"error_msg": "Offer created successfully."

},

"tradeResult": {

"offer_id": "61190230",

"code": 1,

"amount": "1.0",

"price": "20.60522919",

}

}

Modify Order

Update a previously placed order. Order must belong to the profile that the API key belongs to.

HTTP REQUEST : POST

/TradeManageOffer

API KEY PERMISSIONS

This endpoint requires the "TRADE" permission.

Request to modify amount:

{"offer_id":"61190230","selling_asset_code":"INR","buying_asset_code":"HBAR","amount":"1","price":20.60522919,"txn_type":1,"action":"amountupdate"}

Response:

{

"error": {

"error_data": 0,

"error_msg": "Offer amount updated successfully."

},

"tradeResult": {

"code": 2,

}

}

Request to modify price:

{"selling_asset_code":"INR","buying_asset_code":"HBAR","price":"19.60522919","txn_type":1}

Response:

{

"error": {

"error_data": 0,

"error_msg": "Offer price updated successfully."

},

"tradeResult": {

"userId": 2037,

"code": 2,

}

}

Counter Order Check

Orders can only be placed if the user doesn’t have an open counter order to restrict the order matched with the same account.

HTTP REQUEST : POST

/OfferPriceCheck

API KEY PERMISSIONS

This endpoint requires the "TRADE" permission.

Request:

{"selling_asset_code":"HBAR","buying_asset_code":"INR","price":"19.60522919","txn_type":2}

Response:

{

"error": {

"error_data": 1,

"error_msg": "Counter offers are not allowed."

}

}

Cancel an Order

Cancel a previously placed order. Order must belong to the profile that the API key belongs to.

HTTP REQUEST : POST

/TradeManageOffer

API KEY PERMISSIONS

This endpoint requires the "TRADE" permission.

Request:

{"offer_id":"61190230","selling_asset_code":"INR","buying_asset_code":"HBAR","amount":"0","txn_type":1,"price":"19.60522919"}

Response:

{

"error": {

"error_data": 1,

"error_msg": "Offer deleted successfully."

}

}

Limits

End point :

Get Tier Wise Current Exchange Limits

This request will return information on your payment method transfer limits, as well as buy/sell limits per currency per user tier.

HTTP REQUEST : POST

/GetUserAppSettings

API KEY PERMISSIONS

This endpoint requires the "READ" permission.

Response:

{

"userAppSettingsResult": {

"user_app_settings_id": 1972,

"lock_outgoing_transactions": 0,

"rate_alert": 0,

"vibrate_alert": 1,

"incoming_transactions_alert": 1,

"pin_lock": 0,

"sound_alert": 1,

"alert_rate": 0.0,

"two_factor_auth": 0,

"unit": 0,

"user_docs_status": "0",

"bank_details_status": "2",

"userTierDocsStatus": "0",

"txnCurrencyId": 0

},

"tierWiseTransactionSettingsList": [

{

"tierType": 1,

"currencyId": 2,

"dailySendLimit": 0.0,

"minLimit": 0.0,

"txnCharge": 0.0,

"sendOtherMCharges": "",

"gatewayTxnCharge": 3.0,

"minBalance": 0.0

}

],

"error": {

"error_data": 0,

"error_msg": ""

}

}

Deposits

End point :

Generate Payment Order

Deposit funds from a payment method.

HTTP REQUEST : POST

/createPaymentOrder

API KEY PERMISSIONS

This endpoint requires the "DEPOSIT" permission.

PARAMETERS

Param Required Description
sendAmount Yes The amount to deposit
currencyId Yes The type of currency
bankId Yes The bank id where the amount will deposit

Request:

{"sendAmount":"2000.00","currencyId":1,"bankId":1}

Response:

{

"paymentOrdersListResult": [

{

"order_id": 2367,

"order_no": "P10552",

}

"error": {

"error_data": 0,

"error_msg": ""

}

}

List Deposits

Get a list of deposits from the profile of the API key, in descending order by created time.

HTTP REQUEST : POST

/getInvoicesList

API KEY PERMISSIONS

This endpoint requires the "READ" permission.

PARAMETERS

Param Required Description
pageNo Yes Current page no
noOfItemsPerPage Yes Total value show in one page

Request:

{"pageNo":"1","noOfItemsPerPage":"20"}

Response:

{

"invoicesListResult": [

{

"invoice_id": 0,

"orderId": 0,

"fiat_amount": 0.0,

"created": null,

"order_id": 2347,

"order_no": "P10547",

"userId": 2037,

"invoice_id": 0,

"amount": 1000.0,

"created": "2021-03-16 07:24:28.513058",

"status": 15,

"currencyId": 1,

"currency": "USD"

}

],

"totalCount": 1,

"error": {

"error_data": 0,

"error_msg": ""

}

}

Single Deposit

Get information on a single deposit.

HTTP REQUEST : POST

/getInvoiceDetails

API KEY PERMISSIONS

This endpoint requires the "READ" permission.

PARAMETERS

Param Required Description
invoiceId Yes Invoice id for that particular deposit

Request:

{"invoiceId":"1"}

Response:

{

"invoicesListResult": [

{

"invoice_id": 1619,

"fiat_amount": 3000.0,

"userId": 2058,

"orderId": 2365,

"created": "2021-03-22 10:58:52.473364",

"order_no": "P10550",

"amount": 3000.0,

"reference_no": "Test",

"status": 17,

"currencyId": 28,

"currency": "AED"

}

],

"error": {

"error_data": 0,

"error_msg": ""

}

}

Generate a Crypto Deposit Address

You can generate an address for crypto deposits.

HTTP REQUEST : POST

transaction/getCryptoAddress

API KEY PERMISSIONS

This endpoint requires the "DEPOSIT" permission.

PARAMETERS

Param Required Description
currencyId The type of currency
publicKey Address of request currency

Request:

{"currencyId":16}

Response:

{

"customerLedgerResult": {

"publicKey": "0x70C68Fe4e1B6BB010A44bf58e0E1EAC00F82c1b1",

"currencyId": 16,

}

"error": {

"error_data": 0,

"error_msg": ""

}

}

Crypto Deposit History

Get a list of crypto deposits from the profile of the API key, in descending order by created time.

HTTP REQUEST : POST

transaction/getCryptoAddress

API KEY PERMISSIONS

This endpoint requires the "READ" permission.

Request:

{"pageNo":1,"noOfItemsPerPage":20,"timeSpan":"all","transactionType":"received"}

Response:

{

"userTransactionsResult": [

{

"transactionId": 64291556,

"description": "receive Bitcoin to Partha from Hi Sam",

"action": "Received",

"status": 1,

"transactionTimestamp": "2020-10-23 15:24:08.003088",

"orderId": "R200064291557",

"debitAmount": "0",

"creditAmount": "0.0001",

"miningfees": "0",

"tradeAssetAmount": "BTC 0.0001 Cr.",

"currencyUrl": "https://live.blockcypher.com/btc/tx/"

}

],

"totalCount": 5,

"error": {

"error_data": 0,

"error_msg": ""

}

}

Withdrawals

End point :

Generate Withdrawal Order

Withdraw funds to a payment method.

HTTP REQUEST : POST

/createWithdrawalOrder

API KEY PERMISSIONS

This endpoint requires the "WITHDRAW" permission.

PARAMETERS

Param Required Description
sendAmount Yes The amount to deposit
currencyId Yes The type of currency
userBankId Yes The bank id where the amount will send

Request:

{"currencyId":1,"sendAmount":"1000.00","userBankId":1972}

Response:

{

"error": {

"error_data": 0,

"error_msg": ""

}

}

List Fiat Withdrawals

Get a list of fiat withdrawals from the profile of the API key, in descending order by created time.

HTTP REQUEST : POST

/getInvoicesList

API KEY PERMISSIONS

This endpoint requires the "READ" permission.

PARAMETERS

Param Required Description
pageNo Yes Current page no
noOfItemsPerPage Yes Total value show in one page

Request:

{"pageNo":"1","noOfItemsPerPage":"20"}

Response:

{

"withdrawalListResult": [

{

"withdrawalId": 1506,

"timestamp": "24-03-2021 07:44:09",

"currency": "USD",

"amount": 1020.0,

"txnCharge": 20.0,

"withdrawalAmount": 1000.0,

"status": "pending"

},

{

"withdrawalId": 1505,

"timestamp": "24-03-2021 07:39:28",

"currency": "USD",

"amount": 1020.0,

"txnCharge": 20.0,

"withdrawalAmount": 1000.0,

"status": "pending"

}

],

"totalCount": 2,

"error": {

"error_data": 0,

"error_msg": ""

}

}

Crypto

Withdraws funds to a crypto address.

HTTP REQUEST : POST

/sendToOther

End Point:https://accounts.paybito.com/ApiKeyService/transaction/sendToOther

API KEY PERMISSIONS

This endpoint requires the "WITHDRAW" permission.

PARAMETERS

Param Required Description
memo no Memo type of currency
currencyId Yes Id of the type of currency
currency Yes The type of currency
toAdd Yes A crypto address of the recipient
sendAmount Yes The amount to withdraw
tokenType no Null or can be native or ERC20

Request:

{"currency":"USDT","toAdd":"0xf35d9E66c919AeF5536543c8Be23CA906","sendAmount":"1",”memo”:null,”tokenType”:null}

Response:

{

"error": {

"error_data": 0,

"error_msg": ""

}

}

Node Address Validation

Validate crypto address.

HTTP REQUEST : POST

/checkNodeAddress

API KEY PERMISSIONS

This endpoint requires the "WITHDRAW" permission.

Request:

{"toAdd":"0xf35d9E66c919AeF5536543c8Be23CA906","currencyId":16}

Response:

{

"isValid": 1,

"error": {

"error_data": 0,

"error_msg": "Valid address."

}

}

Fee Estimate

Gets the network fee estimate when sending to the given address.

HTTP REQUEST : POST

/checkNodeAddress

API KEY PERMISSIONS

This endpoint requires the "WITHDRAW" permission.

Request:

{"currencyId":16,"sendAmount":"10"}

Response:

{

"feesListResult": [

{

"currency": "USDT",

"fromFee": 0.0,

"toFee": 50000.0,

"minFee": 20.0,

"feeRate": 0.0,

"totalFees": 20.0,

"currencyPrecision": 2

}

],

"totalCount": 1,

"error": {

"error_data": 0,

"error_msg": ""

}

}

Crypto Withdrawal History

Get a list of crypto withdrawals from the profile of the API key, in descending order by created time.

HTTP REQUEST : POST

/getUserAllTransaction

API KEY PERMISSIONS

This endpoint requires the "READ" permission.

Request:

{"pageNo":1,"noOfItemsPerPage":20,,"timeSpan":"all","transactionType":"all"}

Response:

{

"userTransactionsResult": [

{

"transactionId": 228975484,

"userId": 2037,

"fullName": "Partha",

"email": "jane.doe@mydomain.com",

"description": "Tether sent to address 0xf35d9E66c919A22eF55E36543c8Be23CA906d0C4",

"action": "Send",

"status": 0,

"transactionTimestamp": "2021-03-19 08:56:03.156409",

"orderId": "SD210228975485",

"currency": "USDT",

"debitAmount": "1"

"creditAmount": "0",

"miningfees": "20",

"tradeAssetAmount": "USDT 1 Dr.",

"currencyUrl": "https://etherscan.io/tx/"

},

....

....

],

"totalCount": 5,

"error": {

"error_data": 0,

"error_msg": ""

}

}

Transaction History

End point :

All transaction details from the profile of the API key, in descending order by created time.

HTTP REQUEST : POST

/getUserAllTransaction

API KEY PERMISSIONS

This endpoint requires the "READ" permission.

Request:

{"pageNo":1,"noOfItemsPerPage":20,"timeSpan":"all","transactionType":"all"}

Response:

{

"userTransactionsResult": [

{

"transactionId": 235004071,

"description": "Withdrawal USD 1000",

"action": "Withdrawal",

"status": 1,

"transactionTimestamp": "2021-03-24 07:44:09.314986",

"orderId": "W210235004070",

"baseCurrency": "USD",

"currencyTxnid": "1506",

"debitAmount": "1020"

"creditAmount": "0",

"miningfees": "0",

"txncharge": "20",

"closingBalance": "1964.83",

"tradeAssetAmount": "USD 1020 Dr. ",

},

....

....

],

"totalCount": 94,

"error": {

"error_data": 0,

"error_msg": ""

}

}

Margin (Isolated & Cross)

marginType = 1 means Isolated Margin and marginType = 2 means Cross margin.

SPOT to Margin Account Transfer (ISOLATED OR CROSS)

HTTP REQUEST : POST

/margin/transferBalanceToMWB

API KEY PERMISSIONS

This endpoint requires the "DEPOSIT" permission.

Request:

{"amount":100,"currencyId":1,"baseCurrencyId":1,"unitPrice":100,"marginType":2 }

Response:

{

"transactionId": 5,

"returnId": 1,

"message": "currency : USD has been modified 100 to margin wallet... !"

}

User wise Margin Account Info

HTTP REQUEST : GET

/margin/marginWalletByUser?customerId=9306&marginType=2

API KEY PERMISSIONS

This endpoint requires the "READ" permission.

Response:

{

"marginWalletViewList": [

{

"marginWalletId": 5,

"customerId": 9306,

"currencyId": 1,

"currencyName": "USD",

"marginWalletBalance": 587.4,

"marginWallet": 1800.0,

"usedBalance": 12.6,

"availableBalance": 1762.2,

"amount": 0.0,

"marginType": 0

}

]

}

Margin Account Info By User And Currency

HTTP REQUEST : GET

/margin/getMarginWalletByCurrency?customerId=9306¤cyName=USD&marginType=2

API KEY PERMISSIONS

This endpoint requires the "READ" permission.

Response:

{

"marginWalletId": 5,

"customerId": 9306,

"currencyId": 1,

"currencyName": "USD",

"marginWalletBalance": 587.4,

"usedBalance": 12.6,

"availableBalance": 1762.2,

"amount": 0.0,

"marginType": 0

}

Get All Margin And Funding Assets

HTTP REQUEST : GET

/margin/fundingHomeView

API KEY PERMISSIONS

This endpoint requires the "READ" permission.

Response:

{

"P_FUNDING_CURRENCY": [

{

"CURRENCYID": 16,

"CURRENCY_NAME": "USDT",

"INTEREST": 0.06,

"LENDER_EARNED_INTEREST": 0.85,

"EXCHANGE_EARNED_INTEREST": 0.15,

"CURRENCY_TYPE": 2

},

{

"CURRENCYID": 2,

"CURRENCY_NAME": "BTC",

"INTEREST": 0.06,

"LENDER_EARNED_INTEREST": 0.85,

"EXCHANGE_EARNED_INTEREST": 0.15,

"CURRENCY_TYPE": 2

},

{

"CURRENCYID": 1,

"CURRENCY_NAME": "USD",

"INTEREST": 0.06,

"LENDER_EARNED_INTEREST": 0.85,

"EXCHANGE_EARNED_INTEREST": 0.15,

"CURRENCY_TYPE": 1

},

{

"CURRENCYID": 8,

"CURRENCY_NAME": "HCX",

"INTEREST": 0.06,

"LENDER_EARNED_INTEREST": 0.85,

"EXCHANGE_EARNED_INTEREST": 0.15,

"CURRENCY_TYPE": 2

},

……….

],

"P_CROSS_MARGIN_CURRENCY": [

{

"CURRENCYID": 16,

"CURRENCY_NAME": "USDT",

"CURRENCY_TYPE": 2

},

{

"CURRENCYID": 2,

"CURRENCY_NAME": "BTC",

"CURRENCY_TYPE": 2

},

{

"CURRENCYID": 1,

"CURRENCY_NAME": "USD",

"CURRENCY_TYPE": 1

},

{

"CURRENCYID": 8,

"CURRENCY_NAME": "HCX",

"CURRENCY_TYPE": 2

},

……….

],

"P_ISO_MARGIN_CURRENCY": [

{

"CURRENCYID": 16,

"CURRENCY_NAME": "USDT",

"CURRENCY_TYPE": 2

},

{

"CURRENCYID": 2,

"CURRENCY_NAME": "BTC",

"CURRENCY_TYPE": 2

},

{

"CURRENCYID": 1,

"CURRENCY_NAME": "USD",

"CURRENCY_TYPE": 1

},

{

"CURRENCYID": 8,

"CURRENCY_NAME": "HCX",

"CURRENCY_TYPE": 2

},

……….

]

}

Deposit Fund to Exchange

HTTP REQUEST : POST

/margin/transferFund

API KEY PERMISSIONS

This endpoint requires the "DEPOSIT" permission.

Request:

{

"customerId":2037,"amount":100,"currencyId":1,"baseCurrencyId":1,"unitPrice":100,"returnDate":"30-04-2021"

}

Response:

{

"transactionId": 599,

"returnId": 1,

"message": "Customer Id : 9306 , currency : USD has been modified 100 to Fund Master... !"

}

Get User all funding details between two dates

HTTP REQUEST : POST

/margin/fundingViewByInputValue

API KEY PERMISSIONS

This endpoint requires the "READ" permission.

Request:

{ "customerId":9306,"currencyId":1,"fromDate":"15-04-2021","toDate":"30-04-2021" }

Response:

{

"fundingHomeResponseDtoList": [

{

"customerId": 9306,

"currencyId": null,

"currencyName": "US Dollar",

"lendingDate": "15-04-2021",

"returnDate": "25-04-2021",

"rate": 50.0,

"interestRate": null,

"amount": 500.0,

"totalIntamount": null

},

....

]

}

Margin Account New Order

HTTP REQUEST : POST

/margin/createOffer

API KEY PERMISSIONS

This endpoint requires the "TRADE" permission.

Request:

{"selling_asset_code":"USD","buying_asset_code":"BTC","amount":"0.0002","price":"55000","offerType":"L","txn_type":"1","assetCode":"241","marginType":2}

Response:

{"offerId":73924340,"error":0,"message":"Offer created successfully."}

Margin Account Modify Order

HTTP REQUEST : POST

/margin/manageOffer

API KEY PERMISSIONS

This endpoint requires the "TRADE" permission.

Request:

{"offer_id":"73924340","userId":"9306","selling_asset_code":"USD","buying_asset_code":"BTC","amount":"0.0003","price":55000,"txn_type":1,"offerType":"U","assetCode":"241","action":"amountupdate","marginType":"2"}

Response:

{"offerId":0,"message":"Offer amount updated successfully."}

Margin Account Cancel Order

HTTP REQUEST : POST

/margin/manageOffer

API KEY PERMISSIONS

This endpoint requires the "TRADE" permission.

Request:

{"offer_id":"73928410","selling_asset_code":"USD","buying_asset_code":"BTC","amount":"0","txn_type":1,"price":"54000","offerType":"D","marginType":"2","assetCode":"241"}

Response:

{"message":"Offer deleted successfully."}

User Portfolio Account Balance

HTTP REQUEST : GET

/margin/userPortfolioBalance?customerId=9306&marginType=2

API KEY PERMISSIONS

This endpoint requires the "READ" permission.

Response:

{

"userBalance": [

{

"currencyName": "BTC",

"amount": 0.0011,

}

.....

],

"error": 0,

"message": "Success."

}

User Portfolio Account Details

HTTP REQUEST : GET

/margin/portfolioDetails?customerId=9306&marginType=2

API KEY PERMISSIONS

This endpoint requires the "READ" permission.

Response:

{

"values": [

{

"transactionId": 89,

"transactionDate": "2021-04-23 09:53:28.847092",

"fullName": "Partha",

"description": "US Dollar Debit",

"transactionType": "SHORTSELL: BTC / USD",

"debit": 3.23,

"credit": 0.0,

"operationMode": "Margin"

},

{

"transactionId": 599,

"transactionDate": "2021-04-19 14:30:03.62886",

"fullName": "Partha",

"description": "US Dollar Deposit",

"transactionType": "Deposit",

"debit": 100.0,

"credit": 0.0,

"operationMode": "Funding"

},

....

],

"header": [

"TRANSACTION ID",

"TRANSACTION DATE",

"FULLNAME",

"DESCRIPTION",

"TRANSACTION TYPE",

"DEBIT",

"CREDIT",

"OPERATION MODE"

],

"error": 0,

"message": "Success."

}

User Margin and Funding Transaction Details

HTTP REQUEST : GET

/margin/marginFundingTransactionHistory?customerId=9306&marginType=2

API KEY PERMISSIONS

This endpoint requires the "READ" permission.

Response:

{

"values": [

{

"transactionId": 89,

"fullName": "Partha",

"currencyName": "BTC",

"baseCurrency": "USD",

"amount": 2.0E-4,

"price": 48487.390512,

"portfolioType": "SHORT-SELL",

"transactionType": 2,

"transactionDate": "2021-04-23 09:53:28.940291",

"assetCode": "241"

},

....

],

"header": [

"MP TRANSACTION ID",

"TRANSACTION DATE",

"FULL NAME",

"CURRENCY NAME",

"BASECURRENCY",

"BALANCE",

"PRICE",

"PORTFOLIO_TYPE"

],

"error": 0,

"message": "Success."

}

WebSocket API

WebSocket API

General WSS information
  • The base endpoint is:
  • Streams can be accessed either in a single raw stream or in a combined stream
  • Send data socket channel is /app/sendRequest
  • Receive data socket channel is /user/topic/stream
Live Subscribing/Unsubscribing to streams
  • The following data can be sent through the websocket instance in order to subscribe/unsubscribe from streams. Examples can be seen below.
  • The id used in the JSON payloads is an unsigned INT used as an identifier to uniquely identify the messages going back and forth.
  • In the response, if the e received is null this means the request sent was a success for non-query requests (e.g. Subscribing/Unsubscribing).
Subscribe to a stream

Request

{

"method": "SUBSCRIBE",

"params": [

"btc/usd@ticker",

"btcusd@depth",

"btcusd@trade"

],

"id": 1

}

Response

{

"e": null,

"id": 1

}

Unsubscribe to a stream

Request

{

"method": "UNSUBSCRIBE",

"params": [

"btc/usd@ticker",

"btcusd@depth",

"btcusd@trade"

],

"id": 51

}

Response

{

"e": null,

"id": 51

}

Detailed Stream information

Individual Symbol Ticker Streams

24hr rolling window ticker statistics for a single symbol. These are NOT the statistics of the UTC day, but a 24hr rolling window for the previous 24hrs.

Stream Name: < base asset / quote asset >@ticker

Update Speed: 2000ms

Payload:

{

"e": "24hrTicker",

"tR": {

"baseCurrency": "USD",

"openPrice": "10600",

"closePrice": "10753.7922377",

"highPrice": "10753.8022964",

"lowPrice": "10600",

"ltp": "10753.7922377",

"volume": "7030111.03",

"roc": "1.4301209685",

"ctp": "10753.7922377",

"currency": "BTC",

"action": "sell"

},

"t": 1602089684

}

Trade Streams

The Trade Streams push raw trade information; each trade has a unique buyer and seller.

Stream Name: <symbol>@trade

Update Speed: Real-time

Payload:

{

"e": "trade",

"tH": [

{

"price": "1600.0",

"quantity": "1.0",

"symbol": "BTCUSD",

"timestamp": "2020-10-13T21:37:00.176",

"side": "BID"

}

],

"t": 1602089684

}

Depth Stream

Order book price and quantity depth updates used to locally manage an order book.

Stream Name: <symbol>@depth

Update Speed: Real-time

Payload:

{

"e": "depthUpdate",

"bid": [

{

"symbol": "BTCUSD",

"price": "1500.0",

"quantity": "0.2",

"side": "BID",

"action": "NEW"

},

{

"symbol": "BTCUSD",

"price": "1501.0",

"quantity": "0.5",

"side": "BID",

"action": "CHANGE"

}

],

"ask": [

{

"symbol": "BTCUSD",

"price": "1700.0",

"quantity": "0.2",

"side": "ASK",

"action": "DELETE"

}

],

"t": 1602089684

}

How to manage a local order book correctly
  • Open a stream to btcusd@depth.
  • Buffer the events you receive from the stream.
  • Get a depth snapshot from https://stream.paybito.com/SocketStream/api/depth?symbol=BTCUSD&limit=50
  • The data in each event is the absolute quantity for a price level.
  • If the action is NEW, add the price level in order.
  • If the action is CHANGE, update the quantity in the respective price level.
  • If the action is DELETE, delete the price level.
  • Receiving an event that removes a price level that is not in your local order book can happen and is normal.

Fix API

Fix API

FIX (Financial Information eXchange) is an electronic messaging protocol widely adopted by financial institutions to transmit trading activity such as submitting or canceling orders and receiving execution information. PayBitoPro’s FIX API is based on FIX 4.4 and modeled after common forex FIX implementations.

Contact contact@paybito.com for information regarding fix connectivity. Before an initial FIX connection, PayBitoPro will reach out with information about setting up your account via email. It will also contain instructions on creating a staging account.

The informational section of the email may look like this:

Our CompID will be: paybitoserver

Your CompID will be: YOUR CLIENTNAME

Your UserID will be: YOUR USERID

Your Password will be: YOUR PASSWORD

Our FIX service Host: fix.paybito.com or 184.72.11.42 (if staging)

The port number you will connect on is: 4405

IDENTITY MAPPING
PayBitoPro Identity FIX Tag
User ID Account (1)
Wallet ID ClientID (109)
Client’s CompID SenderCompID (49)
PayBitoPro’s CompID TargetCompID (56)
Cancel on Disconnect

Cancel on Disconnect is a PayBitoPro FIX API feature that will automatically submit a request to the exchange to cancel all open FIX orders whenever you disconnect from the FIX API. It is enabled by default.

FIX Connection

We will expect an non SSL connection over TCP to the host and port you are assigned.

NOTE: PayBitoPro’s FIX connection resets every Friday at 5pm IST, causing a sequence number reset.

Messages

Check server time

The baseline specification for this API is FIX 4.4. There are additional tags from later versions of FIX, and custom tags in the high number range as allowed by the standard.

A standard header must be present at the start of every message in both directions.

Id Name Description
8 BeginString Must be FIX.4.4
49 SenderCompID Client API key (on messages from the client)
56 TargetCompID Must be paybitoserver(on messages from the client)

Message Types

The supported message types and corresponding fields are listed in this section. The required fields outside of the standard headers for the message type are highlighted.

LOGON WITH RESET SEQ NUM

A FIX session is initiated by the client with a logon message. EncryptedMethod (FIX tag 98) must be set to 0. HeartBtInt (108) needs to be set, the default value is 30 seconds.

PayBitoPro supports client initiated message sequence number resets via logon with ResetSeqNumFlag (141) set to Y.

Message Format

Outgoing Message

Tag Field Name Req. Value Description
8 BeginString FIX.4.4
9 BodyLength 92
35 MsgType A LOGON
49 SenderCompID CLIENT01
56 TargetCompID paybitoserver
34 MsgSeqNum 1
52 SendingTime 20210323-05:54:19.456
98 EncryptedMethod Y 0 None other
108 HeartBtInt Y 30
141 ResetSeqNumFlag Y Yes reset sequence numbers
10 CheckSum 165

Response Message

Tag Field Name Req. Value Description
8 BeginString FIX.4.4
9 BodyLength 92
35 MsgType A LOGON
49 SenderCompID paybitoserver
56 TargetCompID CLIENT01
34 MsgSeqNum 1
52 SendingTime 20210323-05:54:19.457
98 EncryptedMethod Y 0 None other
108 HeartBtInt Y 30
141 ResetSeqNumFlag Y Yes reset sequence numbers
10 CheckSum 165
HEARTBEAT

In standard FIX, when either end of the FIX connection has not received a message in HeartBtInt (108) seconds, a heartbeat message will be transmitted (MsgType 0). As noted above, the default value for HeartBtInt is 30 seconds.

Message Format

Outgoing Message

Tag Field Name Req. Value Description
8 BeginString FIX.4.4
9 BodyLength 76
35 MsgType Y 0 HEARTBEAT
49 SenderCompID CLIENT01
56 TargetCompID paybitoserver
34 MsgSeqNum 2
52 SendingTime 20210323-05:54:51.057
10 CheckSum 180

Response Message

Tag Field Name Req. Value Description
8 BeginString FIX.4.4
9 BodyLength 76
35 MsgType Y 0 HEARTBEAT
49 SenderCompID paybitoserver
56 TargetCompID CLIENT01
34 MsgSeqNum 2
52 SendingTime 20210323-05:55:02.981
10 CheckSum 183
NEW ORDER

Orders should be submitted as New Order Single (MsgType D). PayBitoPro currently supports market orders (OrdType 1) and limit orders (OrdType 2). Price (44) must not be specified for market orders. In addition, market buy orders must include CashOrderQty (152), specifying the amount of fiat to convert to cryptocurrency. Market sell orders and all limit orders must specify OrderQty 38. Both HandlInst (21) and TimeInForce (59) must be set with a value of 1. Along with the currency pair populated in Symbol (55), the SecurityType (167) must be set to FOR.

Note that instead of currency pair, send different symbol code for different currency pair. You find all symbol code in

Message Format

Outgoing Message

Tag Field Name Req. Value Description
8 BeginString FIX.4.4
9 BodyLength 163
35 MsgType D ORDER SINGLE
49 SenderCompID CLIENT01
56 TargetCompID paybitoserver
34 MsgSeqNum 3
52 SendingTime 20210323-05:54:19.530
11 CIOrdID Y 1616478856896-1
1 Account Y 2035 Account Id ( unique id)
55 Symbol Y 299 SYMBOL CODE
54 Side Y 1 1 for Buy, 2 for Sell
60 TransactTime Y 20210323-05:54:16.896
38 OrderQty 1 Required for Limit and Market Sell orders. Only 1 of tag 38 or tag 152 should be sent
152 CashOrderQty Required for Market Buy orders; the fiat value of the order
40 OrdType Y 2 1 for Market, 2 for Limit
44 Price 1690.1713 Required for Limit orders.
59 TimeInForce Y 1 GOOD TIL CANCELLED
10 CheckSum 068
ORDER CANCEL REQUEST

Orders should referenced by their ClOrdID (11) and OrigClOrdID (41) Note that orders can be cancelled only after “New Order” confirmation

Message Format

Outgoing Message

Tag Field Name Req. Value Description
8 BeginString FIX.4.4
9 BodyLength 167
35 MsgType F ORDER CANCEL REQUEST
49 SenderCompID CLIENT01
56 TargetCompID paybitoserver
34 MsgSeqNum 4
52 SendingTime 20210323-05:54:16.957
41 OrigClOrdID Y 1616051395936-1
11 CIOrdID Y 1616478856887-0
37 orderID Y 641853
55 Symbol Y 284
167 SecurityType Y FOR Foreign Exchange Contract
54 Side Y 1 BUY
60 TransactTime Y 20210323-05:54:16.887
10 CheckSum 155
ORDER CANCEL REJECT

If an order can not be canceled, an Order Cancel Reject message will be sent to the client.

Message Format

Outgoing Message

Tag Field Name Req. Value Description
8 BeginString FIX.4.4
9 BodyLength 107
35 MsgType 9 ORDER CANCEL REJECT
49 SenderCompID paybitoserver
56 TargetCompID CLIENT01
34 MsgSeqNum 221
52 SendingTime 20210323-05:54:32.871
434 CxlRejResponseTo Y 1 ORDER CANCEL REJECT
60 TransactTime Y 20210323-05:54:32.871
10 CheckSum 112
EXECUTION REPORT - PENDING NEW

New Orders will return a Pending New Order Execution Report response (MsgType 8), (OrdStatus A)

Message Format

Outgoing Message

Tag Field Name Req. Value Description
8 BeginString FIX.4.4
9 BodyLength 222
35 MsgType 8 EXECUTION REPORT
49 SenderCompID paybitoserver
56 TargetCompID CLIENT01
34 MsgSeqNum 208
52 SendingTime 20210323-05:54:19.530
37 orderID Y 0
11 CIOrdID Y 1616478859418-1
41 OrigClOrdID Y 1616478859418-1
17 ExecID Y 1616478859528_4148980
150 ExecType Y A PENDING NEW
39 OrdStatus Y A PENDING NEW
1 Account Y 1647
55 Symbol Y 304
38 OrderQty 1 Echoed back for Limit and Market Sell orders
40 OrdType Y 2 LIMIT
44 Price Y 6000
151 LeavesQty Y 0
14 CumQty Y 0
6 AvgPx Y 0
12 Commission Y 0.0
59 TimeInForce 1 GOOD TILL CANCEL
10 CheckSum 034
EXECUTION REPORT - NEW

New Orders will return a New Order Execution Report response (MsgType D), (OrdStatus 0)

Message Format

Outgoing Message

Tag Field Name Req. Value Description
8 BeginString FIX.4.4
9 BodyLength 262
35 MsgType 8 EXECUTION REPORT
49 SenderCompID paybitoserver
56 TargetCompID CLIENT01
34 MsgSeqNum 317
52 SendingTime 20210323-05:54:32.981
37 orderID Y 794955
11 CIOrdID Y 1616478861038-1
41 OrigClOrdID Y 1616478861038-1
17 ExecID Y 1616478872981_4149210
150 ExecType Y 0 NEW
39 OrdStatus Y 0 NEW
1 Account Y 1647
55 Symbol Y 304
54 Side Y 2 SELL
38 OrderQty 25.67 Echoed back for Limit and Market Sell orders
40 OrdType Y 2 LIMIT
44 Price Y 6000
151 LeavesQty Y 0
14 CumQty Y 25.67
6 AvgPx Y 0
12 Commission Y 0.0
60 TransactTime Y 20210323-05:54:19.550
59 TimeInForce 1 GOOD TILL CANCEL
13 CommType 3 ABSOLUTE
10 CheckSum 198
EXECUTION REPORT - FILLED

Filled Order Execution Report responses are returned for entirely filled orders.

Note that Market Buy Order executions are captured in partial fill messages. The fill message is a summary execution confirming that the order is closed and filled.

Message Format

Outgoing Message

Tag Field Name Req. Value Description
8 BeginString FIX.4.4
9 BodyLength 278
35 MsgType 8 EXECUTION REPORT
49 SenderCompID paybitoserver
56 TargetCompID CLIENT01
34 MsgSeqNum 307
52 SendingTime 20210323-05:54:32.821
37 orderID Y 763621
11 CIOrdID Y 1616447851749-1
41 OrigClOrdID Y 1616447851749-1
17 ExecID Y 1616478872821_4149202
150 ExecType Y F TRADE
39 OrdStatus Y 2 FILLED
1 Account Y 1647
55 Symbol Y 300
54 Side Y 1 BUY
38 OrderQty 0.55514 Echoed back for Limit and Market Sell orders
40 OrdType Y 2 LIMIT
44 Price Y 54723.252569
14 CumQty Y 0.55514
6 AvgPx Y 54723.252569
60 TransactTime Y 20210323-05:54:32.821
59 TimeInForce 1 GOOD TILL CANCEL
100 ExDestination 109237
10 CheckSum 198
EXECUTION REPORT - PARTIAL FILL

Partial Fill Execution Report responses are returned for partially filled orders.

Message Format

Outgoing Message

Tag Field Name Req. Value Description
8 BeginString FIX.4.4
9 BodyLength 290
35 MsgType 8 EXECUTION REPORT
49 SenderCompID paybitoserver
56 TargetCompID CLIENT01
34 MsgSeqNum 309
52 SendingTime 20210323-05:54:32.820
37 orderID Y 592081
11 CIOrdID Y 1615995630859-1
41 OrigClOrdID Y 1615995630859-1
17 ExecID Y 1616478872819_4149200
150 ExecType Y F TRADE
39 OrdStatus Y 1 PARTIALLY FILLED
1 Account Y 2099
55 Symbol Y 300
54 Side Y 1 BUY
38 OrderQty 0.11486 Echoed back for Limit and Market Sell orders
40 OrdType Y 2 LIMIT
44 Price Y 54719.252569
151 LeavesQty Y 1.60614
14 CumQty Y 0.11486
6 AvgPx Y 54719.252569
60 TransactTime Y 20210323-05:54:32.820
59 TimeInForce 1 GOOD TILL CANCEL
100 ExDestination 109237
10 CheckSum 111
EXECUTION REPORT - PENDING CANCEL

A Pending Cancel Execution Report is an acknowledgement that a cancel request has been received by PayBitoPro. It is not an indication the order has been canceled.

Message Format

Outgoing Message

Tag Field Name Req. Value Description
8 BeginString FIX.4.4
9 BodyLength 186
35 MsgType 8 EXECUTION REPORT
49 SenderCompID paybitoserver
56 TargetCompID CLIENT01
34 MsgSeqNum 586
52 SendingTime 20210324-08:27:21.585
37 orderID Y 1714
11 CIOrdID Y 1616574441552-0
41 OrigClOrdID Y 1616574284587-1
150 ExecType Y 6 PENDING CANCEL
39 OrdStatus Y 6 PENDING CANCEL
55 Symbol Y 254
54 Side Y 1 BUY
151 LeavesQty Y 0
14 CumQty Y 0
6 AvgPx Y 0
60 TransactTime Y 20210324-08:27:21.585
10 CheckSum 065
EXECUTION REPORT - CANCELED

An Execution Report with OrdStatus 4 is sent when an order has been canceled.

Message Format

Outgoing Message

Tag Field Name Req. Value Description
8 BeginString FIX.4.4
9 BodyLength 186
35 MsgType 8 EXECUTION REPORT
49 SenderCompID paybitoserver
56 TargetCompID CLIENT01
34 MsgSeqNum 1011
52 SendingTime 20210324-08:27:21.313
37 orderID Y 1321
11 CIOrdID Y 1616574441281-0
41 OrigClOrdID Y 1616574044194-1
150 ExecType Y 4 CANCEL
39 OrdStatus Y 4 CANCEL
55 Symbol Y 249
54 Side Y 1 BUY
151 LeavesQty Y 0
14 CumQty Y 0
6 AvgPx Y 0
60 TransactTime Y 20210324-08:27:21.313
10 CheckSum 023
ORDER STATUS REQUEST

Sent by the client to obtain information about pending and done orders.

Message Format

Outgoing Message

Tag Field Name Req. Value Description
8 BeginString FIX.4.4
9 BodyLength 108
35 MsgType H ORDER STATUS REQUEST
49 SenderCompID paybitoserver
56 TargetCompID CLIENT01
34 MsgSeqNum 5
52 SendingTime 20210324-11:15:43.742
11 CIOrdID Y 1616574350644-1
55 Symbol 276
54 Side 1 BUY
10 CheckSum 227
ORDER STATUS RESPONSE

The response to an Order Status Request is an ExecutionReport with ExecType=I. The ExecutionReport will contain the ClOrdID if the value is supplied. If the order cannot be found, the ExecutionReport will have OrderID=0.

LOGOUT

A logout message ends the FIX session. An unsolicited logout may indicate a connection or account issue, SendingTime (52) will have a human readable message indicating if there is an issue. In some cases, a logout message may be associated with an account’s trading permissions being suspended; if you are unable to reconnect with ResetSeqNumFlag (141) set to Y please engage with PayBitoPro support.

Message Format

Outgoing Message

Tag Field Name Req. Value Description
8 BeginString FIX.4.4
9 BodyLength 0056
35 MsgType 0 Heartbeat
49 SenderCompID CLIENT01
56 TargetCompID paybitoserver
34 MsgSeqNum 2
52 SendingTime 20210324-09:28:21.313
10 CheckSum 107

Encoded Tags

Some FIX Tag short codes and their values are listed below. The description field in the message type tables above also contain this information.

1. ExecType
Value Description
0 New Order
1 Fill
3 Done
4 Canceled
7 Stopped
8 Rejected
D Order Changed
I Order Status

FIX API - Market Data

Introduction

OVERVIEW

The information in this document describes the adaptation of the standard FIX 4.4 for vendors and subscribers to communicate with the PayBitoPro FIX Market Data Gateway.

Hours of Operation

The FIX Market Data service is restarted daily at 23:59 UTC to allow sequence numbers to reset.

PayBitoPro recommends that FIX Market Data customers plan to disconnect daily at 23:59 UTC and reconnect at 00:01 UTC, expecting new inbound sequence numbers from PayBitoPro. Customers should expect to be disconnected from the service at 23:59 UTC while it restarts.

Connecting

Only one connection should be made to each account.

Markets

PayBitoPro currently supports trading different markets. You can find different symbols and symbol codes from this below url.

MESSAGE HEADER
Tag Field Name Req. Comments
8 BeginString Y "FIX.4.4"
9 BodyLength Y (Always unencrypted, must be second field in message)
35 MsgType Y (Always unencrypted, must be third field in message)
49 SenderCompID Y Must be specified in all FIX messages, will be echoed back in TargetCompID in all FIX messages to customers.
56 TargetCompID Y Provided by the customer, always echoed back in SenderCompID in all FIX messages to customers
34 MsgSeqNum Y (Can be embedded within the encrypted data section.)
52 SendingTime Y Required
Message Trailer
Tag Field Name Req. Comments
10 CheckSum Y (Always unencrypted, always last field in message)
HEARTBEAT (MSGTYPE = 0)

This message is intended to monitor the status of the communications link during periods of inactivity.

The FIX market data accepts and generates Heartbeat messages as per the FIX specification.

  • Inbound: Handled as specified
  • Outbound: In response to a test request or timeout.
  • Response: None

The heartbeat message should be sent if agreed upon Heartbeatinterval has elapsed since the last message sent.

Tag Field Name Req. Comments
Standard Header Y MsgType = 0
112 TestReqID N Required when the heartbeat is the result of a Test Request message.
Standard Trailer Y
LOGON (MSGTYPE = A)

The logon message identifies and authenticates the user and establishes a connection to the FIX Gateway. After a successful logon as described in the specification the FIX gateway will initiate a Logon using the SenderCompID in the message header and begin regular message communication.

PayBitoPro to customer sequence numbers are only reset when the market data session is restarted (see hours of operation above for timing). They cannot be reset by the customer.

Customer to PayBitoPro sequence numbers can be reset by the customer upon establishing a new connection. If you are going to re-set your sequence numbers, please log out and log back in with the lower sequence number. No tag 141 is required to re-set your sequence numbers to 1. As long as the outbound sequence number from the customer to PayBitoPro is lower (or equal to 1) than the previous session, PayBitoPro will not send a resend request.

Tag Field Name Req. Comments
Standard Header Y MsgType = A
108 HeartBtInt Y Heartbeat interval in seconds
Standard Trailer Y
Example FIX Message

8=FIX.4.4|9=69|35=A|49=USERID|56=USERID1|34=1|52=20210205-18:11:35|108=30|10=018|

Example FIX Message Response

8=FIX.4.4|9=69|35=A|49=USERID|56=USERID1|34=1|52=20210205-18:11:39.261|98=0|108=30|10=021|

TEST REQUEST (MSGTYPE = 1)

If a Heartbeatinterval + 1 second have elapsed since the last message received, a Test Request should be issued. If another Heartbeatinterval + 1 second go by without receiving a message, the TCP connection should be dropped.

Tag Field Name Req. Comments
Standard Header Y MsgType = 1
112 HeartBtInt Y
Standard Trailer Y
RESEND REQUEST (MSGTYPE = 2) - UNSUPPORTED

At this time market data is not stored on a per-connection basis and as such resend requests are not supported from customers to PayBitoPro. However, the PayBitoPro FIX Market Data Gateway will send consumers a Resend Request if it senses that sequence numbers are out of sync. Please log-out, reset your outbound sequence numbers and log-in again with a 141=Y and 36 = 1 to sync your sequence numbers with the Market Data Gateway.

REJECT (MSG TYPE = 3)

This message is used by the PayBitoPro FIX Gateway to reject messages that violate session level rules and are unable to be processed. The gateway checks inbound messages for the presence of its required tags. It also validates the message type tag session level rejects are used to indicate violations of the session protocol, or missing fields.

REJECT (MSG TYPE = 3)

This message is used by the PayBitoPro FIX Gateway to reject messages that violate session level rules and are unable to be processed. The gateway checks inbound messages for the presence of its required tags. It also validates the message type tag session level rejects are used to indicate violations of the session protocol, or missing fields.

Tag Field Name Comments
Standard Header MsgType = 3
45 RefSeqNum MsgSeqNum of rejected message
58 Text Where possible, message to explain reason for rejection
Standard Trailer
SEQUENCE RESET (MSGTYPE = 4)

PayBitoPro does not support requesting reset of outbound sequence numbers from PayBitoPro to customers. Outbound sequence numbers from PayBitoPro to customers are reset daily after the FIX engine restart at 23:57 UTC. Customers can reset their own outbond sequence numbers to PayBitoPro upon Logon by adding tags 141=Y and 36=1 in Msg Type = A.

LOGOUT (MSGTYPE = 5)

Upon receipt of a logout message from customers, the customer’s session will be terminated by the PayBitoPro FIX Market Data Gateway.

Application Messages – Customer to PayBitoPro

MARKET DATA REQUEST (MSGTYPE = V)
Tag Field Name Comments
Standard Header MsgType = V
55 Symbol Identifier for the symbol
262 MDReqID Value will be unique number
263 SubscriptionRequestType

Value will be unique number

0 = Snapshot

1 = Snapshot + Updates (Subscribe)

2 = Disable previous Snapshot + Update Request (Unsubscribe)

264 MarketDepth

Valid values:

0 = Full Book

1 = Top of Book

N>1 = Report best N price tiers of data

265 MDUpdateType

Valid values:

0 = Full Refresh

1 = Incremental Refresh

267 NoMDEntryType No of MD Entry type requested
269 MDEntryType

Valid values:

0 = Bid

1 = Offer

2 = Trade

269 NoRelatedSym Specifies the number of repeating symbols specified.
Standard Trailer

Application Messages – PayBitoPro to Customer

ORDER OF MESSAGES
  • 1. Top of the book changes send new ‘W’ messages
  • 2. Additional, Filled, Partially Filled or Cancelled orders will send updated ‘X’ messages
  • 3. Upon updates, there is no End Of Book ‘X’ message, because market data is streaming
TOP OF BOOK SNAPSHOT (MSGTYPE = W)

The “W” message provides the best bid and ask in each market as well as an update for each trade that occurs on the PayBitoPro trading platform.

Each time the best bid and ask change on the gateway a new “W” message will be sent from PayBitoPro to the customer.

Tag Field Name Comments
Standard Header MsgType = W
55 Symbol Identifier for the symbol
268 NoMDEntries Value will be “2” given that this is just the best bid and offer.
269 MDEntryType Type of market data entry. Valid values: 0 = Bid1 = Offer
270 MDEntryPx Price of the market data entry.
271 MDEntrySize Quantity
262 MDReqID Value will be unique number
Standard Trailer
Example FIX Message

8=FIX.4.49=36635=W49=paybitoserver56=marketclient34=50952=20210324-11:20:59.222262=18055=249268=9269=0270=0.0092808271=147.0163269=1270=0.0092971271=50.1269=1270=0.0092981271=166.677269=1270=0.0092991271=62.38269=1270=0.0093031271=51.7162269=1270=0.0093271271=59.5269=1270=0.0093351271=68.133269=1270=0.0093531271=94.07269=1270=0.0093541271=28.410=160 422

TRADE DATA (MSGTYPE = W)

Each time a trade occurs on the PayBitoPro trading platform, a “W” message is sent with the following format.

Tag Field Name Comments
Standard Header MsgType = W
55 Symbol Identifier for the symbol
268 NoMDEntries Value will be 1 given that only 1 trade at a time is sent via “W” message.
269 MDEntryType 2 = Trade
270 MDEntryPx Price of the market data entry.
271 MDEntrySize Quantity
262 MDReqID Value will be “0”
Standard Trailer
Example FIX Message

8=FIX.4.2|9=100|35=W|49=USERID|56=USERID1|34=11| 52=20190201-00:03:48.117|55=ETHUSD|268=1|269=2|270=106|271=1|262=0| 10=106|

MARKET DATA – ORDER BOOK (MSGTYPE = X)

“X” Messages provide all order data, inclusive of the full book upon login and the incremental refresh thereafter. An “X” End of Book message is used to denote separation between the two.

Order data messages have the following format.

Tag Field Name Comments
Standard Header MsgType = X
268 NoMDEntries Number of market data entries in this snapshot.
279 MDUpdateAction The Market Data update action type. It must be the first field in the repeating group. The only valid values are 0 = New1 = Change2 = Delete
269 MDEntryType Type of market data entry. Valid values: 0 = Bid 1 = Offer
278 MDEntryID Market data identifier
55 Symbol Identifier for the symbol
270 MDEntryPx Price of the market data entry
271 MDEntrySize Number of shares represented by the Market Data Entry
262 MDReqID The MDReqID of the MarketDataRequest message.
58 Text A unique ID from the OMS.
Standard Trailer
Example FIX Message

8=FIX.4.49=12835=X49=paybitoserver56=marketclient34=71252=20210324-13:00:45.925262=180268=1279=0269=055=249270=0.00924589271=70.3810=189 184

MARKET DATA – ORDER BOOK END OF BOOK (MSGTYPE = X)

End of Book messages have the following format

Tag Field Name Comments
Standard Header MsgType = X
262 MDReqID The MDReqID of the MarketDataRequest message.
268 NoMDEntries Number of market data entries in this snapshot. “1” for this message.
279 MDUpdateAction The Market Data update action type. Will be “1” Change for this message.
269 MDEntryType Type of market data entry. 2 = Trade for this message.
278 MDEntryID Market data identifier
55 Symbol “*” for this message type.
270 MDEntryPx “0” for this message.
271 MDEntrySize “0” for this message.
Standard Trailer
Example FIX Message

End of Book messages are denoted with a 55 = “*” as shown below.

Note: Although PayBitoPro Market Data Gateway is not currently configured to store FIX messages per user (and as such not supporting resend requests), it is possible when logging on and getting the full book to receive Market Data Entries where the MDUpdateAction = Change. This is to be ignored prior to the End of Book message as all market data entries prior to receiving the End of Book message should be treated as “New.”

8=FIX.4.2|9=125|35=X|49=USERID|56=USERID1|34=61| 52=20190131-23:48:52.336|262=0|268=1|279=1|269=2| 278=9223372036854775807| 55=* |270=0.0|271=0|10=176|

MARKET DATA REQUEST REJECT (MSGTYPE = Y)
Tag Field Name Comments
Standard Header MsgType = Y
262 MDReqID The MDReqID of the MarketDataRequest message.
58 Text Reason for the rejection.
Standard Trailer

PayBitoPro Liquidity API Documentation

PayBitoPro Liquidity API

Change Log
2022-06-21

SPOT API: Changes to POST /transaction/sendToOther totalFess parameter is removed.

2023-05-16

SPOT API: added uuid to all api
CustomerId parameter is removed

Introduction
API Key Setup:

Some endpoints will require an API Key. Please create an API key from your account.Never share your API key/secret key to ANYONE.

Note: If the API keys were accidentally shared, please delete them immediately and create a new key.

API Key Restrictions:

After creating the API key, the default restriction is Enable Reading.

To enable withdrawals via the API, the API key restriction needs to be modified through the PayBitoPro UI.

Enabling accounts:

Spot Account

A SPOT account is provided by default upon creation of a PayBitoPro Account.

Contact Us:
PayBitoPro customer support:

For cases such as missing funds, help with 2FA, etc.

General Info:
General API Information

The base endpoint is: https://accounts.paybito.com

All endpoints return either a JSON object or array.

Data is returned in ascending order. Oldest first, newest last.

HTTP Return Codes:

HTTP 4XX return codes are used for malformed requests; the issue is on the sender's side.

HTTP 403 return code is used when the WAF Limit (Web Application Firewall) has been violated.

HTTP 429 return code is used when breaking a request rate limit.

HTTP 418 return code is used when an IP has been auto-banned for continuing to send requests after receiving 429 codes.

HTTP 5XX return codes are used for internal errors; the issue is on PayBitoPro side. It is important to NOT treat this as a failure operation; the execution status is UNKNOWN and could have been a success.

General Information on Endpoints:

For GET endpoints, parameters must be sent as a query string.

For POST, PUT, and DELETE endpoints, the parameters may be sent as a json object or array or in the request body with content type application/json.

Parameters may be sent in any order.

If a parameter is sent in both the query string and request body, the query string parameter will be used.

Endpoint security type:

Each endpoint has a security type that determines how you will interact with it. This is stated next to the NAME of the endpoint.

If no security type is stated, assume the security type is NONE.

HTTP 429 return code is used when breaking a request rate limit.

API-keys are passed into the Rest API via the X-MBX-APIKEY respectively in the header.

API-keys and secret-keys are case sensitive.

API-keys can be configured to only access certain types of secure endpoints. For example, one API-key could be used for TRADE only, while another API-key can access everything except for TRADE routes.By default, API-keys can access all secure routes.

Security Type Description
NONE Endpoints can be accessed freely.
TRADE Endpoint requires sending a valid API-Key and signature.
Key Value
apiKey vmPUZE6mv9SD5VNHk4HlWFsOr6aKE2zvsw0MuIgwCIPy6utIco14y7Ju91duEh8A
secretKey NhqPtmdSJYdKjVHjA7PZj4Mge3R5YNiP1e3UZjInClVN65XAbvqqM6A7H5fATj0j
Public API definitions
Terminology

These terms will be used throughout the documentation, so it is recommended especially for new users to read to help their understanding of the API.

base asset refers to the asset that is the quantity of a symbol. For the symbol BTCUSDT, BTC would be the base asset.

quote asset refers to the asset that is the price of a symbol. For the symbol BTCUSDT, USDT would be the quote asset.

Account and Symbol Permissions (permissions):

SPOT

Order status (status):
Status Description
NEW The order has been accepted by the engine.
PARTIALLY_FILLED A part of the order has been filled.
FILLED The order has been completed.
CANCELLED The order has been cancelled by the user.
REJECTED The order was not accepted by the engine and not processed.
Order types (orderTypes, type):

LIMIT

MARKET

Order side (side):

BUY

SELL

Wallet Endpoints:
Market Data Endpoints:

Order book:

GET

Name Type Mandatory Description
symbol STRING YES BTCUSD etc.
limit INT NO Default All; max 5000. Valid limits:[5, 10, 20, 50, 100, 500, 1000, 5000]

Response:

{

"ask": [

{

"price": "59000.618333",

"amount": "0.55"

}

],

"bid": [

{

"price": "58998.406682",

"amount": "0.493"

}

]

}

Accounts

GET

List Accounts

Get a list of trading accounts assets and their holdings from the profile of the API key.

HTTP REQUEST : POST

/getUserBalance

API KEY PERMISSIONS

This endpoint requires the "READ" permission.

Name Description
currencyId Asset Id
currencyCode Asset Code
currencyName Asset Name
closingBalance Total holdings
holdingInUsd Total holdings in USD
currencyType Asset type (Fiat/Crypto)
isMargin Allow for margin?
isFund Allow for funding?

Response:

{

"userBalanceList": [

{

"currencyId": 1,

"currencyCode": "USD",

"currencyName": "US Dollar",

"closingBalance": 4.836,

"holdingInUsd": 4.84,

"currencyType": 1,

"isMargin": 1,

"isFund": 1

}

],

"checkBeforeBuy": false,

"error": {

"error_data": 0,

"error_msg": ""

}

}

Orders

GET

HTTP REQUEST : POST

/TradeCreateOffer

API KEY PERMISSIONS

This endpoint requires the "TRADE" permission.

Name Description
offer_id Unique id for new order
code Order status (1 - create, 2 - update, 3 - Matched, 4 - Partial matched, 5-Delete )
amount Order quantity
price Order price
selling_asset_code Asset will be sold
buying_asset_code Asset will be bought
offerType Market/Limit (M - Market, L - Limit)
txn_type Buy/Sell (1 - Buy, 2 -Sell)
action An order update type (to update amount - ‘amountupdate’)Buy/Sell (1 - Buy, 2 -Sell)

Request:

{"userId":"2037","selling_asset_code":"INR","buying_asset_code":"HBAR","amount":1,"price":20.60522919,"offerType":"L","txn_type":"1"}

Response:

{

"error": {

"error_data": 0,

"error_msg": "Offer created successfully."

},

"tradeResult": {

"userId": 2037,

"offer_id": "61190230",

"code": 1,

"amount": "1.0",

"price": "20.60522919",

}

}

New Order

You can place two types of orders: limit and market. Orders can only be placed if your account has sufficient funds. Once an order is placed, your account funds will be put on hold for the duration of the order. How much and which funds are put on hold depends on the order type and parameters specified.

Get Account History

List account activity of the API key's profile. Account activity either increases or decreases your account balance. Items are paginated and sorted latest first.

HTTP REQUEST : POST

/getUserAllTransaction

GET

API KEY PERMISSIONS

This endpoint requires the "READ" permission.

Name Description
transactionId Unique id for this transaction
description Transaction description
action Transaction type
status Transaction status (0 - Pending, 1 - Confirmed)
orderId Allow for margin?
currency Transaction currency
debitAmount Amount to be debit
creditAmount Amount to be credit
miningfees Network fees
currencyUrl Crypto Explorer url
totalCount Total no of rows

Request:

{"pageNo":1,"noOfItemsPerPage":20,"userId":"2037","timeSpan":"all","transactionType":"all"}

Response:

{

"userTransactionsResult": [

{

"transactionId": 228975484,

"userId": 2037,

"fullName": "Partha",

"email": "partha.hashcash@gmail.com",

"description": "Tether sent to address 0xf35d9E66c919A22eF55E36543c8Be23CA906d0C4",

"action": "Send",

"status": 0,

"transactionTimestamp": "2021-03-19 08:56:03.156409",

"orderId": "SD210228975485",

"currency": "USDT",

"debitAmount": "1",

"creditAmount": "0",

"miningfees": "20",

"tradeAssetAmount": "USDT 1 Dr. ",

"currencyUrl": "https://etherscan.io/tx/"

}

],

"totalCount": 83, "error": {"error_data": 0,"error_msg": ""}}

Crypto

Withdraws funds to a crypto address.

HTTP REQUEST : POST

/sendToOther

GET

API KEY PERMISSIONS

This endpoint requires the "WITHDRAW" permission.

PARAMETERS

Param Required Description
userId Yes User account id
currencyId Yes Id of the type of currency
currency Yes The type of currency
toAdd Yes A crypto address of the recipient
sendAmount Yes The amount to withdraw
totalFees Yes Total network fees

Request:

{"userId":"2037","currencyId":"16","currency":"USDT","toAdd":"0xf35d9E66c919AeF5536543c8Be23CA906","sendAmount":"1","totalFees":"20.00"}

Response:

{

"error": {

"error_data": 0,

"error_msg": ""

}

}

Check server time

GET

It follows the requirement of SERVER TIME API.

Get the current server time.

Response:

1656258555

Total Assets

List account activity of the API key's profile. Account activity either increases or decreases your account balance. Items are paginated and sorted latest first.

HTTP REQUEST : POST

/getUserAllTransaction

GET

It follows the requirement of total assets.

Response:

{ "currencyList":

[ "AAVE”, "ADA", "ALGO", "AVAX", "BAT", "BCH", "BSV", "BTC", "BTG", "BUSD", "CAR", "CHZ", "COMP", "DAI", "DOGE", "DOT", "EOS", "ETC", "ETH", "FTT", "GRT", "HBAR", "HCX", "LINK", "LTC", "MATIC", "MKR", "PAX", "SHIB", "SNX", "SOL","TRX", "UBU","UNI","USDC","USDT", "WBTC", "XLM","XRP", "YFI”, "ZEC"

],

"error": {

"error_data": 0,

"error_msg": ""

}

}

Total Asset Pair Lists for Trade

GET

It follows the requirement of total asset pair lists for trade.

Response:

{

"Header": [

"BTC",

"ETH",

"HCX",

"USDT",

"FIAT"

],

"Values": [

{

"baseCurrencyId": 2, "baseCurrency": "BTC", "currencyCode": "ETH", "currencyName": null,"currencyId": 3, "roc": 1.5628041392, "ltpValue": 0.05738532, "ltpConvValue": 1224.23, "volume": 214.4465,

"currencyType": 2, "action": "sell", "assetCode": "252", "amountPrecision": 5, "pricePrecision": 8, "assetPair": null, "assetPairName": null, "contractValue": null }

{ "baseCurrencyId": 2, "baseCurrency": "BTC", "currencyCode": "BCH", "currencyName": null, "currencyId": 4, "roc":1.2560393579, "ltpValue": 0.00544895, "ltpConvValue": 116.25, "volume": 4.2894, "currencyType": 2, "action": "buy", "assetCode": "249", "amountPrecision": 5, "pricePrecision": 8, "assetPair": null, "assetPairName": null, "contractValue": null

}

]

}

24 hours volume

GET

It follows the requirement of 24 hours volume.

Response:

{

"Header": [

"BTC",

"ETH",

"HCX",

"USDT",

"FIAT"

],

"Values": [

{

"baseCurrencyId": 2, "baseCurrency": "BTC", "currencyCode": "ETH", "currencyName": null, "currencyId": 3, "roc": 1.5628041392, "ltpValue": 0.05738532, "ltpConvValue": 1224.23, "volume": 214.4465, "currencyType": 2, "action": "sell", "assetCode": "252", "amountPrecision": 5, "pricePrecision": 8, "assetPair": null, "assetPairName": null, "contractValue": null }

{ "baseCurrencyId": 2, "baseCurrency": "BTC", "currencyCode": "BCH", "currencyName": null, "currencyId": 4, "roc":1.2560393579, "ltpValue": 0.00544895, "ltpConvValue": 116.25, "volume": 4.2894, "currencyType": 2, "action": "buy", "assetCode": "249", "amountPrecision": 5, "pricePrecision": 8, "assetPair": null, "assetPairName": null, "contractValue": null

}

]

}

Last Trade Price

GET

It follows the requirement of Last Trade Price.

Response:

{

"Header": [

"BTC",

"ETH",

"HCX",

"USDT",

"FIAT"

],

"Values": [

{

"baseCurrencyId": 2, "baseCurrency": "BTC", "currencyCode": "ETH", "currencyName": null, "currencyId": 3, "roc": 1.5628041392, "ltpValue": 0.05738532, "ltpConvValue": 1224.23, "volume": 214.4465, "currencyType": 2, "action": "sell", "assetCode": "252", "amountPrecision": 5, "pricePrecision": 8, "assetPair": null, "assetPairName": null, "contractValue": null }

{ "baseCurrencyId": 2, "baseCurrency": "BTC", "currencyCode": "BCH", "currencyName": null, "currencyId": 4, "roc":1.2560393579, "ltpValue": 0.00544895, "ltpConvValue": 116.25, "volume": 4.2894, "currencyType": 2, "action": "buy", "assetCode": "249", "amountPrecision": 5, "pricePrecision": 8, "assetPair": null, "assetPairName": null, "contractValue": null

}

]

}