API

Inicio

Los datos enviados deben estar codificados en UTF-8.
Para solicitudes API exitosas, todas las solicitudes deben contener varios encabezados requeridos:
- El encabezado X-API-KEY debe contener tu clave API recibida (YOUR_API_KEY)
Solicitud de ejemplo
bash
curl -X GET \
-H "x-api-key: YOUR_API_KEY" \
"https://xgram.io/api/v1/METHOD"
Todas las solicitudes enviadas a la API de Xgram deben incluir el parámetro key (clave API), disponible después de registrarte en nuestro Programa de Afiliados.

Validación de dirección

Esta solicitud verifica la validez de la dirección:
https://xgram.io/api/v1/crypto-address-verification

Parámetro

Parámetro
Tipo
Ejemplo
cryptoDigitalCoin
string
BTC
cryptoDigitalAddress
string
bc1q6aas41krwvvcc4hhio6u4euf1y3wkbtap8uhmrt
Solicitud de ejemplo
bash
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"
Respuesta de ejemplo
json
{
"result": true
}

Tipo de cambio para el importe de la transacción

Esta solicitud obtiene el tipo de cambio actual. La comisión de la transacción no está incluida:
https://xgram.io/api/v1/retrieve-rate-value

Parámetro

Parámetro
Tipo
Ejemplo
fromCcy
string
BTC
toCcy
string
ETH
ccyAmount
float
1
Solicitud de ejemplo
bash
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"
Respuesta de ejemplo
json
{
"fix": false,
"minFrom": "0.0081",
"maxFrom": "138",
"from_network": "Bitcoin",
"to_network": "ERC20",
"rate": 25.084395813448847,
"withdrawalFee": "0.006 ETH",
"result": true
}
* withdrawalFee - Comisión de retiro aproximada. Parámetro variable.

Obtener lista de monedas

Obtener todas las monedas habilitadas:
https://xgram.io/api/v1/list-currency-options
Solicitud de ejemplo
bash
curl -X GET "https://xgram.io/api/v1/list-currency-options" \
-H "x-api-key: bc1qvi55hg9rlwc2etpoypkt98db37vcbto5fke0a6w" \
-H "Content-Type: application/json; charset=UTF-8"
Respuesta de ejemplo
json
{
"XETA": {
"coinName": "XANA",
"contract": "0x111111111117dc0aa78b770fa6a738034120c302",
"minFrom": 19137.93103448276,
"maxFrom": 18773946,
"tagname": "",
"network": "AVAXC",
"available": true
},
"FITFI": {
"coinName": "Step App",
"contract": "",
"minFrom": 16989.79591836735,
"maxFrom": 14965986,
"tagname": "",
"network": "AVAXC",
"available": true
},
"ARB": {
"coinName": "Arbitrum",
"contract": "",
"minFrom": 90.68627450980394,
"maxFrom": 88085,
"tagname": "",
"network": "Arbitrum",
"available": true
},
"KLAY": {
"coinName": "Klaytn",
"contract": "",
"minFrom": 389.9297423887589,
"maxFrom": 69838833,
"tagname": "",
"network": "Klaytn",
"available": true
},
...
}
Si el tagname no es un valor vacío, la etiqueta es un parámetro obligatorio para esta moneda.

Lista de pares

Esta solicitud obtiene todos los pares disponibles para el intercambio:
https://xgram.io/api/v1/load-pairs-options
Solicitud de ejemplo
bash
curl -X GET "https://xgram.io/api/v1/load-pairs-options" \
-H "x-api-key: bc1qvi55hg9rlwc2etpoypkt98db37vcbto5fke0a6w" \
-H "Content-Type: application/json; charset=UTF-8"
Respuesta de ejemplo
json
[
  [
    "ETH",
    "LTC"   
  ], 
  [
     "BTC",
     "BCH"
  ],
  [
    "ZEC",
    "BAT"
  ],
  [
    "ETH",
    "USDT"
  ],
  [
    "BNB",
    "XRP"
  ],
]

Inicio del intercambio

Esta solicitud crea e inicia el intercambio:
https://xgram.io/api/v1/launch-new-exchange

Parámetro

Parámetro
Tipo
Ejemplo
toAddress
string
0xaeeee8f61f3ccffe8c60e7aed0f4ca753e0ba43d
toAddressTag
opcional
string
refundAddress
opcional
string
bc1q8dj6psgvmqshkgy9vpl7shtn2ly77qz5dr6mq3
refundTag
opcional
string
fromCcy
string
BTC
toCcy
string
ZEC
ccyAmount
float
0.5
type
opcional
string
float
Valores válidos: float y fixed
Solicitud de ejemplo
bash
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"
Respuesta de ejemplo
json
{
"id": "qeqb36r5qa999th0",
"depositAddress": "2Q4J7Kz90S6yI5fWb1T8LzR9U3eM4vXxC7H",
"depositTag": "",
"result": true,
"ccyAmountToExpected": 14.7316,
}

Inicio del pago

Esta solicitud crea e inicia el pago:
https://xgram.io/api/v1/launch-new-payment-exchange

Parámetro

Parámetro
Tipo
Ejemplo
toAddress
string
0xaeeee8f61f3ccffe8c60e7aed0f4ca753e0ba43d
toAddressTag
opcional
string
refundAddress
opcional
string
bc1q8dj6psgvmqshkgy9vpl7shtn2ly77qz5dr6mq3
refundTag
opcional
string
fromCcy
string
BTC
toCcy
string
ZEC
ccyAmount
float
0.5
type
opcional
string
float
Valid values: float and fixed
Solicitud de ejemplo
bash
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"
Respuesta de ejemplo
json
{
"id": "qeqb36r5qa999th0",
"depositAddress": "2Q4J7Kz90S6yI5fWb1T8LzR9U3eM4vXxC7H",
"depositTag": "",
"result": true,
"ccyAmountFrom": 0.0183883
}

Obtener estado del intercambio

Obtener información sobre el estado actual del intercambio:
https://xgram.io/api/v1/fetch-status-info

Parámetro

Parámetro
Tipo
Ejemplo
id
string
qeq6r5qa999th0
Solicitud de ejemplo
bash
curl -X GET "https://xgram.io/api/v1/fetch-status-info?id=qeq6r5qa999th0" \
-H "x-api-key: bc1qvi55hg9rlwc2etpoypkt98db37vcbto5fke0a6w" \
-H "Content-Type: application/json; charset=UTF-8"
Respuesta de ejemplo
json
{
"x-status": "deposit_received",
"id": "qeq6r5qa999th0",
"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",
"date": "21.01.2024 10:01:11",
"txId": null,
"x-ccyAmountTo": null,
"result": true
}
Lista de estados utilizados:
x-new - nueva transacción (en espera de depósito)
x-awaiting_funds - confirmando depósito
x-funds_received - depósito recibido
x-processing_exchange - en proceso de intercambio
x-transferring - en proceso de envío
x-completed - intercambio completado con éxito
x-timeout - el tiempo de espera para los fondos ha expirado
x-error - el intercambio finalizó con un error
x-transfer_error - el intento de envío falló
x-returned - los fondos fueron devueltos al cliente
Envías
1
~
Recibes
Todas las comisiones incluidas
Este par no está disponible en este momento. Por favor, inténtalo de nuevo más tarde.
Seleccionar una moneda