Start

The submitted data must be UTF-8 encoding.
For successful API requests, all requests must contain several required headers:

- The X-API-KEY header must contain your received API Key (YOUR_API_KEY)
cURL -X GET \
-H "x-api-key: YOUR_API_KEY" \
"https://xgram.io/api/v1/METHOD"
            

All requests sent to API Xgram must include the parameter key (API key) available after signing up to our Partnership Program.

Address Validation

This request checks the validity of the address. :
https://xgram.io/api/v1/crypto-address-verification


Parameter

ParameterTypeExample
cryptoDigitalCoinstringBTC
cryptoDigitalAddressstringbc1q6aas41krwvvcc4hhio6u4euf1y3wkbtap8uhmrt

Sample request
                
curl -X GET "https://xgram.io/api/v1/crypto-address-verification?cryptoDigitalCoin=BTC&cryptoDigitalAddress=bc1q6aas41krwvvcc4hhio6u4euf1y3wkbtap8uhmrt" \
     -H "x-api-key: bc1qvi55hg9rlwc2etpoypkt98db37vcbto5fke0a6w" \
     -H "Content-Type: application/json; charset=UTF-8"
                

Sample response
                
{
    result: true
}                
            

Exchange rate for transaction amount

This request gets the current exchange rate. Transaction fee is not included. :
https://xgram.io/api/v1/retrieve-rate-value


Parameter

ParameterTypeExample
fromCcystringBTC
toCcystringETH
ccyAmountfloat1

Sample request
                
curl -X GET "https://xgram.io/api/v1/retrieve-rate-value?fromCcy=BTC&toCcy=ETH&ccyAmount=1" \
     -H "x-api-key: bc1qvi55hg9rlwc2etpoypkt98db37vcbto5fke0a6w" \
     -H "Content-Type: application/json; charset=UTF-8"
                

Sample response
                
{
    fix: false,
    minFrom: 0.0081,
    maxFrom: 138,
    from_network: "Bitcoin",
    to_network: "ERC20",
    rate: 25.084395813448847,
    withdrawalFee: "0.006 ETH",
    result: true
}                
            

* withdrawalFee - Approximate withdrawal fee. Floating parameter.


Get currency list

Get all enabled currencies :
https://xgram.io/api/v1/list-currency-options


Parameter

ParameterTypeExample

Sample request
                
curl -X GET "https://xgram.io/api/v1/list-currency-options" \
     -H "x-api-key: bc1qvi55hg9rlwc2etpoypkt98db37vcbto5fke0a6w" \
     -H "Content-Type: application/json; charset=UTF-8"
                

Sample response
                
{
XETA: {
  coinName: "XANA",
  minFrom: 19137.93103448276,
  maxFrom: 18773946,
  tagname: "",
  network: "AVAXC",
  available: true
},
FITFI: {
  coinName: "Step App",
  minFrom: 16989.79591836735,
  maxFrom: 14965986,
  tagname: "",
  network: "AVAXC",
  available: true
},
ARB: {
  coinName: "Arbitrum",
  minFrom: 90.68627450980394,
  maxFrom: 88085,
  tagname: "",
  network: "Arbitrum",
  available: true
},
KLAY: {
  coinName: "Klaytn",
  minFrom: 389.9297423887589,
  maxFrom: 69838833,
  tagname: "",
  network: "Klaytn",
  available: true
},
  ...
}                
            

If the tagname is not an empty value, the tag is a mandatory parameter for this currency.


Pairs List

This request gets all pairs available for exchange. :
https://xgram.io/api/v1/load-pairs-options


Parameter

ParameterTypeExample

Sample request
                
curl -X GET "https://xgram.io/api/v1/load-pairs-options" \
     -H "x-api-key: bc1qvi55hg9rlwc2etpoypkt98db37vcbto5fke0a6w" \
     -H "Content-Type: application/json; charset=UTF-8"
                

Sample response
                
[
  [
    "ETH",
    "LTC"    
  ],
  [
    "BTC",
    "BCH"    
  ],
  [
    "ZEC",
    "BAT"
  ],
  [
    "ETH",
    "USDT"
  ],
  [
    "BNB",
    "XRP"
  ],
  
]
                
            

Exchange Initiation

This request creates – initiates - the exchange. :
https://xgram.io/api/v1/launch-new-exchange


Parameter

ParameterTypeExample
toAddressstring0xaeeee8f61f3ccffe8c60e7aed0f4ca753e0ba43d
toAddressTagstringoptional
refundAddressstringbc1q8dj6psgvmqshkgy9vpl7shtn2ly77qz5dr6mq3
refundTagstringoptional
fromCcystringBTC
toCcystringZEC
ccyAmountfloat0.5
typestringfloat | fixed

Sample request
                
curl -X GET "https://xgram.io/api/v1/launch-new-exchange?toAddress=0x750c44dB01899176f2e64bD25A2fabAC1140d8e9&fromCcy=BTC&toCcy=ETH&ccyAmount=0.5" \
     -H "x-api-key: bc1qvi55hg9rlwc2etpoypkt98db37vcbto5fke0a6w" \
     -H "Content-Type: application/json; charset=UTF-8"
                

Sample response
                
{
    id                 : "qeqb36r5qa999th0",
    depositAddress     : "2Q4J7Kz90S6yI5fWb1T8LzR9U3eM4vXxC7H",
    depositTag         : "",
    result             : "true",
    ccyAmountToExpected : 14.7316,
}                
            

Payment Initiation

This request creates – initiates - the payment. :
https://xgram.io/api/v1/launch-new-payment-exchange


Parameter

ParameterTypeExample
toAddressstring0xaeeee8f61f3ccffe8c60e7aed0f4ca753e0ba43d
toAddressTagstringoptional
refundAddressstringbc1q8dj6psgvmqshkgy9vpl7shtn2ly77qz5dr6mq3
refundTagstringoptional
fromCcystringBTC
toCcystringZEC
ccyAmountfloat0.5

Sample request
                
curl -X GET "https://xgram.io/api/v1/launch-new-payment-exchange?toAddress=0x750c44dB01899176f2e64bD25A2fabAC1140d8e9&fromCcy=BTC&toCcy=ETH&ccyAmount=0.5" \
     -H "x-api-key: bc1qvi55hg9rlwc2etpoypkt98db37vcbto5fke0a6w" \
     -H "Content-Type: application/json; charset=UTF-8"
                

Sample response
                
{
    id             : "qeqb36r5qa999th0",
    depositAddress : "2Q4J7Kz90S6yI5fWb1T8LzR9U3eM4vXxC7H",
    depositTag     : "",
    result         : "true",
    ccyAmountFrom   : 0.0183883
}                
            

Getting exchange status

Getting information about the current exchange status :
https://xgram.io/api/v1/fetch-status-info


Parameter

ParameterTypeExample
idstringqeqb36r5qa999th0

Sample request
                
curl -X GET "https://xgram.io/api/v1/fetch-status-info?id=qeqb36r5qa999th0" \
     -H "x-api-key: bc1qvi55hg9rlwc2etpoypkt98db37vcbto5fke0a6w" \
     -H "Content-Type: application/json; charset=UTF-8"
                

Sample response
                
{
    x-status                : "deposit_received",
    x-fromCcy               : "BTC",
    x-toCcy                 : "ZEC",
    x-ccyDepositAddress     : "1Z9VcAgLPQwoAb7fiWuDKZbqwnt5LKrAv",
    x-ccyDepositTag         : "",
    x-ccyDepositHash        : "a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6q7r8s9t0u1v2w3x4y5z6a7b8c9d0e1f2g3h",
    x-ccyDestinationAddress : "2Q4J7Kz90S6yI5fWb1T8LzR9U3eM4vXxC7H",
    x-ccyDestinationTag     : "",
    x-ccyRefundAddress      : "2B2yQ2fQ6RHejg3ENQUgUM6TMn8e8WjGqOb",
    x-ccyRefundTag          : "",
    x-ccyExpectedAmountFrom : "0.5",
    x-ccyExpectedAmountTo   : "50.02",
    x-ccyAmountFrom         : "0.5",
    x-date                  : "21.01.2024 10:01:11",
    x-txId                  : null,
    x-ccyAmountTo           : null,
    x-result                : true
}                
            

List of used statuses:
x-new - new transaction (awaiting deposit)
x-awaiting_funds - deposit confirming
x-funds_received - deposit is received
x-processing_exchange - in the process of exchange
x-transferring - in the process of sending
x-completed - exchange completed successfully
x-timeout - the waiting time for funds has expired
x-error - the exchange ended with an error
x-transfer_error - sending attempt failed
x-returned - the funds were returned to the client