Einführung

Die FixedFloat-API ermöglicht es Ihnen, den Empfang von Informationen über die Wechselkurse von Währungen, erstellten Aufträgen, die im FixedFloat-Dienst präsentiert werden, zu automatisieren, Aufträge zu erstellen und sie damit zu verwalten.

Um die FixedFloat-API zu verwenden, müssen Sie einen API key und ein API secret abrufen.

Abrufen des API key

Gehen Sie folgendermaßen vor, um einen API Key und ein API Secret zu erhalten:

  1. Einloggen oder Anmelden im FixedFloat
  2. Gehen Sie zum Abschnitt API management
  3. Klicken Sie auf die Schaltfläche "Generieren" und folgen Sie den Anweisungen im erscheinenden Fenster
  4. Kopieren Sie den API Key und das API Secret und bewahren Sie diese an einem sicheren Ort auf. Verwenden Sie diese Parameter für Anforderungen an die FixedFloat-API

Anfrage und Beispiel

Die gesendeten Daten müssen im JSON-Format mit UTF-8-Kodierung vorliegen.

Für erfolgreiche API-Anfragen müssen alle Anfragen einige obligatorische Header enthalten:

  • Der Content-Type header muss application/json; charset=UTF-8
  • Der X-API-KEY Header sollte Ihren erhaltenen API Key (YOUR_API_KEY) enthalten
  • Der X-API-SIGN muss die Signatur GENERATED_SIGN enthalten. Um die Signatur zu erhalten, müssen Sie Ihr API Secret (YOUR_API_SECRET) als HMAC SHA256 Operationsschlüssel und die json Datenzeichenfolge als Wert verwenden.
X-API-SIGN generation
[linux]$ echo -n 'DATA_JSON' | openssl dgst -sha256 -hmac "YOUR_API_SECRET"
(stdin)= GENERATED_SIGN
cURL -X POST \
  -H "Accept: application/json" \
  -H "X-API-KEY: YOUR_API_KEY" \
  -H "X-API-SIGN: GENERATED_SIGN" \
  -H "Content-Type: application/json; charset=UTF-8" \
  -d 'DATA_JSON'
  "https://ff.io/api/v2/METHOD" -L
import hmac
import json
import hashlib
import requests
  
def sign(data):
  return hmac.new(
    key=YOUR_API_SECRET.encode(),
    msg=data.encode(),
    digestmod=hashlib.sha256
  ).hexdigest()
  
  
def request(method, params={}):
  url = 'https://ff.io/api/v2/' + method
  data = json.dumps(params)
  headers = {
    'X-API-KEY':  YOUR_API_KEY,
    'X-API-SIGN': sign(data)
  }
  r = requests.post(url, data=data, headers=headers)
  return r.json()
  
request(METHOD, DATA)
<?php
  function sign($data) {
    return hash_hmac('sha256', $data, YOUR_API_SECRET);
  }
  
  function request($method, $data) {
    $url = 'https://ff.io/api/v2/'.$method;
    
    $req = json_encode($data);
    
    $ch = curl_init();
    curl_setopt($ch, CURLOPT_URL, $url);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
    curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);
    curl_setopt($ch, CURLOPT_POST, true);
    curl_setopt($ch, CURLOPT_POSTFIELDS, $req);
    curl_setopt($ch, CURLOPT_HTTPHEADER, array(
      'Content-Type:application/json',
      'X-API-KEY: '  . YOUR_API_KEY,
      'X-API-SIGN: ' . sign($req)
    ));
    $response = curl_exec($ch);
    curl_close($ch);
    
    $result = json_decode($response, true);
    if ($result['code'] == 0) {
      return $result['data'];
    } else {
      throw new Exception($result['msg'], $result['code']);
    }
  }
  
  request(METHOD, DATA);
?>

Limits anfordern

Das Anforderungslimit pro Minute beträgt 250 Gewichtseinheiten.

Die Anfrage /api/v2/create kostet 50 Gewichtseinheiten, alle anderen Anfragen kosten 1 Gewichtseinheit.

Wenn das Limit überschritten wird, wird Ihr Token vorübergehend gesperrt. Mit jeder weiteren Limitüberschreitung nach dem Entsperren verlängert sich die Sperrzeit

Offizielle Bibliotheken

Sie können fertige Bibliotheken verwenden, um die FixedFloat-API zu verwenden:

XML-Datei der Kurse

GEThttps://ff.io/rates/fixed.xml
GEThttps://ff.io/rates/float.xml

Abrufen einer Exportdatei mit Wechselkursen im XML-Format, die Informationen über alle Währungspaare, Wechselkurse, Verfügbarkeit von Reserven sowie Mindest- und Höchstbeträge für den Austausch enthält.

Parameter

Für diese Anfrage müssen keine Parameter übermittelt werden. Es ist auch nicht erforderlich, Header mit einem Schlüssel und einer Signatur zu übermitteln.

Example request
cURL "https://ff.io/rates/float.xml" -L

Antwort

Eine erfolgreiche Antwort enthält ein Array von Währungsinformationsobjekten.

FieldTypeDescription
<rates>XML objectList of currency pair objects
<item>XML objectAn object containing information about the exchange rate, reserves, minimums and maximums for a pair of currencies.
<from>stringCurrency code of the currency that will be sent for exchange
<to>stringCurrency code of the currency that will be received as a result of the exchange
<in>numberAmount in the <from> currency that will be sent for exchange. Required for calculating the final exchange rate.
<out>numberAmount in the <to> currency that will be received as a result of the exchange. Required for calculating the final exchange rate.
<amount>numberIndicates the availability of reserves for the <to> currency. The parameter does not specify or allow for obtaining the maximum exchange amount.
<tofee>stringAdditional fees (network fees) in the <to> currency, which are not included in the exchange rate (in the amount specified in <out>).
<minamount>stringThe minimum amount of the <from> currency that the service can exchange
<maxamount>stringThe maximum amount of the <from> currency that the service can exchange
Example XML response
<rates>
  <item>
    <from>BTC</from>
    <to>ETH</to>
    <in>1</in>
    <out>17.720391807658</out>
    <amount>191.11148571181</amount>
    <tofee>0.0004967000 ETH</tofee>
    <minamount>0.0004896204 BTC</minamount>
    <maxamount>1.5160672800 BTC</maxamount>
  </item>
  <item>
    <from>BTC</from>
    <to>USDT</to>
    <in>1</in>
    <out>61595.076999999997</out>
    <amount>1170121.610442</amount>
    <tofee>2.2490000000 USDT</tofee>
    <minamount>0.0006675144 BTC</minamount>
    <maxamount>0.7269365000 BTC</maxamount>
  </item>
  <item>
    <from>ETH</from>
    <to>USDT</to>
    <in>1</in>
    <out>3396.173800000000</out>
    <amount>1170121.610442</amount>
    <tofee>2.0380000000 USDT</tofee>
    <minamount>0.0107817333 ETH</minamount>
    <maxamount>13.1841012000 ETH</maxamount>
  </item>
  ...,
</rates>

Verfügbare Währungen

POSThttps://ff.io/api/v2/ccies

Abrufen einer Liste der vom FixedFloat-Dienst unterstützten Währungen sowie Daten zu deren Anzeige und Informationen zur Verfügbarkeit zum Empfangen und Senden.

Parameter

Für diese Anfrage müssen keine Parameter übergeben werden.

X-API-SIGN wird generiert, indem die Funktion HMAC SHA256 aus einem leeren String aufgerufen wird, wenn keine Parameter übergeben werden, oder aus einem leeren JSON Objekt.

Example request
cURL -X POST \
  -H "Accept: application/json" \
  -H "X-API-KEY: YOUR_API_KEY" \
  -H "X-API-SIGN: GENERATED_SIGN" \
  -H "Content-Type: application/json; charset=UTF-8" \
  "https://ff.io/api/v2/ccies" -L
<?php
  require_once('fixedfloat.php');
  
  $ff = new FixedFloatApi(YOUR_API_KEY, YOUR_API_SECRET);
  
  return $ff->ccies();
?>

Antwort

Eine erfolgreiche Antwort enthält ein Array von Währungsinformationsobjekten.

FieldTypeDescription
codenumberResponse status code. If the request is successful, then the status code is "0", otherwise it is an error
msgstringStatus message
dataArrayList of currencies supported by FixedFloat
data[].codestringUnique currency code in FixedFloat
data[].coinstringCommon asset ticker
data[].networkstringBlockchain network in which this asset is represented
data[].namestringName of currency
data[].recvbooleanAvailability of currency for acceptance into the service from the client
data[].sendbooleanAvailability of currency to send to the client
data[].tagstringThe name of the additional field, if available; otherwise null
data[].logostringLink to currency image
data[].colorstringCurrency color specified in HEX format
data[].prioritynumberPriority in the list of currencies of the service
Example JSON response
{
  "code": 0,
  "msg": "",
  "data": [
    {
      "code": "BTC",
      "coin": "BTC",
      "network": "BTC",
      "name": "Bitcoin",
      "recv": true,
      "send": true,
      "tag": null,
      "logo": "https://fixedfloat.com/assets/images/coins/svg/btc.svg",
      "color": "#f7931a",
      "priority": "5",
    },
    ...,
  ],
}

Wechselkurs

POSThttps://ff.io/api/v2/price

Erhalten des Wechselkurses eines Währungspaares in der ausgewählten Richtung und Art des Kurses.

ACHTUNG! Um die Wechselkurse aller verfügbaren Währungen zu erhalten, sollten Sie die XML-Exportdatei der Kurse verwenden

Für diese Methode sowie für die Methode /api/v2/create ist es möglich, die verdienten Einnahmen im Rahmen des Partnerprogramms durch den Parameter afftax zu erhöhen.

Der endgültige Wechselkurs bei Übergabe der Parameter afftax und refcode hängt davon ab, ob Ihr Partnerprogrammcodes für die Erträge von API-generierten Bestellungen genehmigt wurde und dem Basisprozentsatz (AFFBASE), der für Ihren Code festgelegt ist, und wird nach folgender Formel berechnet:

total = FF - AFFB + afftax, if afftax < FF - AFFB
total = afftax x 2        , if FF - AFFB < afftax < FF
total = FF + afftax       , if afftax > FF

wo FF der Basisprozentsatz des Dienstes für die ausgewählte Art des Wechselkurses ist (1 % für einen festen Kurs und 0,5 % für einen variablen Kurs);
AFFB ist der Basisprozentsatz des Dienstgewinns, der für Ihren Partnerprogrammcodes festgelegt ist, für die ausgewählte Art des Wechselkurses (AFFBASE für einen festen Kurs und AFFBASE÷2 für einen variablen Kurs)

Zur Verdeutlichung empfehlen wir, dass Sie sich mit der nachstehenden Tabelle vertraut machen, wobei AFFBASE=0,4 ist, wo FFP = FF - AFFB:

FIXED RATE FLOAT RATE
Total FFP afftax Total FFP afftax
1.0 0.6 0.4 0.5 0.3 0.2
1.1 0.6 0.5 0.55 0.3 0.25
1.2 0.6 0.6 0.6 0.3 0.3
1.4 0.7 0.7 0.7 0.35 0.35
1.6 0.8 0.8 0.8 0.4 0.4
1.8 0.9 0.9 0.9 0.45 0.45
2.0 1.0 1.0 1.0 0.5 0.5
2.1 1.0 1.1 1.05 0.5 0.55
2.2 1.0 1.2 1.1 0.5 0.6

Wenn Ihr Partnerprogrammcode keinen Basisprozentsatz für API-Erträge hatte, wird der endgültige Wechselkurs wie folgt berechnet:

FF + afftax

wo FF der Basisprozentsatz des Dienstes für die ausgewählte Art des Wechselkurses ist (1 % für einen festen Kurs und 0,5 % für einen variablen Kurs).

Die Einnahmen werden Ihrem Konto gutgeschrieben, wenn der Partnerprogrammcode im Parameter refcode übergeben wurde und dieser Code zu Ihrem Konto gehört. Andernfalls werden die Parameter afftax und refcode ignoriert.

Parameter

NameRequiredTypeDescription
typetruestringOrder type
fromCcytruestringCode of the currency the client wants to send
toCcytruestringCode of the currency the client wants to receive
directiontruestring The direction of the exchange determines whether the client wants to send a certain amount or receive a certain amount. Can take one of the following values:
from — if the client wants to send the amount amount in the currency fromCcy
to — if the client wants to receive the amount amount in the currency toCcy
amounttruenumericIf direction="from", then this is the amount in currency fromCcy that the client wants to send.
If direction="to", then this is the amount in currency toCcy that the client wants to receive
cciesfalsebooleanAdding a list of currencies to the response with information about the availability for sending and receiving
usdfalsebooleanAmount in USD, by which fromAmount or toAmount will be changed in case the limits are exceeded
refcodefalsestringAffiliate program code for which earnings will be accrued under the affiliate program. If the afftax parameter is not set and this affiliate program code does not participate in earning via the API, passing this parameter will not affect anything. It is possible to transfer only affiliate program codes that were received in the same account in which the API key used for this request was received
afftaxfalsefloatDesired earnings under the affiliate program as a percentage of the exchange amount. Affects the final exchange rate and earnings under the affiliate program if the refcode parameter is also set.
Example request
cURL -X POST \
  -H "Accept: application/json" \
  -H "X-API-KEY: YOUR_API_KEY" \
  -H "X-API-SIGN: GENERATED_SIGN" \
  -H "Content-Type: application/json; charset=UTF-8" \
  -d '{"fromCcy":"BTC","toCcy":"USDTTRC","amount":0.5,direction":"from","type":"float"}'
  "https://ff.io/api/v2/price" -L
<?php
  require_once('fixedfloat.php');
  
  $ff = new FixedFloatApi(YOUR_API_KEY, YOUR_API_SECRET);
  
  $data = array(
    'fromCcy'    => 'BTC',
    'toCcy'      => 'USDTTRC',
    'amount'     => '0.5',
    'direction'  => 'from',
    'type'       => 'float',
  );
  
  return $ff->price($data);
?>

Antwort

Eine erfolgreiche Antwort enthält Informationen über die Währungen des ausgewählten Paares, den Wechselkurs und den gesendeten und empfangenen Betrag.

FieldTypeDescription
codenumberResponse status code. If the request is successful, then the status code is "0", otherwise it is an error
msgstringStatus message
dataObjectAn object with information about the currencies of the selected pair, the exchange rate, and the amount sent and received
data.fromObjectData about the asset that the client must send
data.from.codestringUnique currency code in FixedFloat
data.from.networkstringBlockchain network in which this asset is represented
data.from.coinstringCommon asset ticker
data.from.amountstringAmount that the client needs to send
data.from.ratestringFinal exchange rate
data.from.precisionintegerRounding accuracy
data.from.minstringMinimum amount
data.from.maxstringMaximum amount
data.from.usdstringEquivalent in USD
data.from.btcstringEquivalent in BTC
data.toObjectData about the asset that the client will receive
data.to.codestringUnique currency code in FixedFloat
data.to.networkstringBlockchain network in which this asset is represented
data.to.coinstringCommon asset ticker
data.to.amountstringAmount that the client must to receive
data.to.ratestringFinal exchange rate
data.to.precisionintegerRounding accuracy
data.to.minstringMinimum amount
data.to.maxstringMaximum amount
data.to.usdstringEquivalent in USD
data.errorsArrayAn array of a list of errors. If the array is empty, then creating an order with these parameters is possible.
The array may contain the following errors:
MAINTENANCE_FROM — Currency from data.from object under maintenance
MAINTENANCE_TO — Currency from object data.to under maintenance
OFFLINE_FROM — Currency from object data.from is not available
OFFLINE_TO — Currency from object data.to is not available
RESERVE_FROM — Not enough currency reserves from object data.from
RESERVE_TO — Not enough currency reserves from object data.to
LIMIT_MIN — Amount less than limit
LIMIT_MAX — The amount is greater than the limit
data.cciesArrayAdded if the ccies parameter is true. An array containing a list of objects with information about the availability for sending and receiving currencies
data.ccies[].codestringUnique currency code in FixedFloat
data.ccies[].recvbooleanAvailability of currency for acceptance into the service from the client
data.ccies[].sendbooleanAvailability of currency to send to the client
Example JSON response
{
  "code": 0,
  "msg": "",
  "data": {
    "from": {
      "code": "BSC",
      "network": "BSC",
      "coin": "BNB",
      "amount": "0.040297",
      "rate": "0.01452202",
      "precision": 8,
      "min": "0.005053",
      "max": "967.072057",
      "usd": "12.28",
      "btc": "0.00058813",
    },
    "to": {
      "code": "BTC",
      "network": "BTC",
      "coin": "BTC",
      "amount": "0.00055984",
      "rate": "68.164781",
      "precision": 8,
      "min": "0.0000479",
      "max": "14.04381911",
      "usd": "11.69",
    },
    "errors": [],
    "ccies": [
      {
        "code": "ADA",
        "recv": true,
        "send": true,
      },
      ...,
    ],
  },
}

Bestellung anlegen

POSThttps://ff.io/api/v2/create

Erstellen eines Auftrags zum Umtausch ausgewählter Währungen mit einem bestimmten Betrag und einer bestimmten Adresse.

Bei dieser Methode sowie bei der /api/v2/price Methode ist es möglich, die anfallenden Einnahmen im Rahmen des Partnerprogramms mit dem Parameter afftax zu erhöhen. Die Regeln für die Verwendung dieses Parameters sind in der Methode /api/v2/price beschrieben

Parameter

NameRequiredTypeDescription
typetruestringOrder type
fromCcytruestringCode of the currency the client wants to send
toCcytruestringCode of the currency the client wants to receive
directiontruestring The direction of the exchange determines whether the client wants to send a certain amount or receive a certain amount. Can take one of the following values:
from — if the client wants to send the amount amount in the currency fromCcy
to — if the client wants to receive the amount amount in the currency toCcy
amounttruenumericIf direction="from", then this is the amount in currency fromCcy that the client wants to send.
If direction="to", then this is the amount in currency toCcy that the client wants to receive
toAddresstruestringDestination address to which the funds will be dispatched upon the successful completion of the Order
tagfalsebooleanIf you need to specify a Memo or Destination Tag when sending, you should specify it here. This parameter can be omitted by specifying the MEMO or Destination Tag in toAddress separated by a colon.
refcodefalsestringAffiliate program code for which earnings will be accrued under the affiliate program. If the afftax parameter is not set and this affiliate program code does not participate in earning via the API, passing this parameter will not affect anything. It is possible to transfer only affiliate program codes that were received in the same account in which the API key used for this request was received
afftaxfalsefloatDesired earnings under the affiliate program as a percentage of the exchange amount. Affects the final exchange rate and earnings under the affiliate program if the refcode parameter is also set.
Example request
cURL -X POST \
  -H "Accept: application/json" \
  -H "X-API-KEY: YOUR_API_KEY" \
  -H "X-API-SIGN: GENERATED_SIGN" \
  -H "Content-Type: application/json; charset=UTF-8" \
  -d '{"fromCcy":"BTC","toCcy":"USDTTRC","amount":0.5,direction":"from","type":"float","toAddress":"TAzsQ9Gx8eqFNFSKbeXrbi45CuVPHzA8wr"}'
  "https://ff.io/api/v2/create" -L
<?php
  require_once('fixedfloat.php');
  
  $ff = new FixedFloatApi(YOUR_API_KEY, YOUR_API_SECRET);
  
  $data = array(
    'fromCcy'    => 'BTC',
    'toCcy'      => 'USDTTRC',
    'amount'     => '0.5',
    'direction'  => 'from',
    'type'       => 'float',
    'toAddress'  => 'TAzsQ9Gx8eqFNFSKbeXrbi45CuVPHzA8wr'
  );
  
  return $ff->create($data);
?>

Antwort

Eine erfolgreiche Antwort enthält ein Objekt mit Informationen über alle Daten der erstellten Bestellung, einschließlich des Parameters token, um später aktualisierte Informationen über die Bestellung mit der Methode /api/v2/ Bestellung und Bestellverwaltung zu erhalten.

FieldTypeDescription
codenumberResponse status code. If the request is successful, then the status code is "0", otherwise it is an error
msgstringStatus message
dataObjectObject with information about all the data of the created order
data.tokenstringOrder access token
data.idstringOrder ID. Consists of 6 characters
data.typestringOrder type. Can be one of the values:
fixed — fixed rate order
float — floating rate order
data.emailstringEmail address for the order to receive notifications about changes in the order
data.statusstringOrder status. Can be one of the values:
NEW — New order
PENDING — Transaction received, pending confirmation
EXCHANGE — Transaction confirmed, exchange in progress
WITHDRAW — Sending funds
DONE — Order completed
EXPIRED — Order expired
EMERGENCY — Emergency, customer choice required
data.timeObjectObject containing timestamp data
data.time.regnumberOrder creation timestamp
data.time.startnumberTransaction receive timestamp
data.time.finishnumberTimestamp when the order was completed
data.time.updatenumberTimestamp of last order update
data.time.expirationnumberTimestamp when order expires
data.time.leftnumberThe number of seconds before the end of the order
data.fromObjectAn object containing information about the currency sent by clients and transactions
data.from.codestringCurrency code
data.from.coinstringCommon asset ticker
data.from.networkstringBlockchain network in which this asset is represented
data.from.namestringName of currency
data.from.aliasstringAlias for creating qr code
data.from.amountstringAmount that the client needs to send
data.from.addressstringThe destination address to which the user is ought to deposit his funds in order for the trade to execute
data.from.tagstringMEMO or Destination Tag if required
data.from.addressMixstringAddress with a colon-connected tag
data.from.reqConfirmationsnumberRequired number of transaction confirmations
data.from.maxConfirmationsnumberThe maximum number of transaction confirmations that system updates
data.from.txObjectAn object containing data about the received transaction
data.from.tx.idstringTransaction hash
data.from.tx.amountstringTransaction amount
data.from.tx.feestringMiner fee
data.from.tx.ccyfeestringCurrency of Miner fee
data.from.tx.timeRegnumberTransaction registration timestamp
data.from.tx.timeBlocknumberTimestamp for adding a transaction to a block
data.from.tx.confirmationsnumberNumber of transaction confirmations
data.toObjectAn object containing information about the currency received by the client and the transaction
data.to.codestringCurrency code
data.to.coinstringCommon asset ticker
data.to.networkstringBlockchain network in which this asset is represented
data.to.namestringName of currency
data.to.aliasstringAlias for creating qr code
data.to.amountstringAmount that the client must to receive
data.to.addressstringThe destination address to which the funds will be dispatched upon the successful completion of the order
data.to.tagstringMEMO or Destination Tag if required
data.to.addressMixstringAddress with a colon-connected tag
data.to.txObjectAn object containing data about the sent transaction
data.to.tx.idstringTransaction hash
data.to.tx.amountstringTransaction amount
data.to.tx.feestringMiner fee
data.to.tx.ccyfeestringCurrency of Miner fee
data.to.tx.timeRegnumberTransaction registration timestamp
data.to.tx.timeBlocknumberTimestamp for adding a transaction to a block
data.to.tx.confirmationsnumberNumber of transaction confirmations
data.backObjectAn object containing information about the currency returned to the client and the transaction
data.back.codestringCurrency code
data.back.coinstringCommon asset ticker
data.back.networkstringBlockchain network in which this asset is represented
data.back.namestringName of currency
data.back.aliasstringAlias for creating qr code
data.back.amountstringThe amount that the client should receive upon return, excluding the miner fee
data.back.addressstringThe return address to which the funds will be sent when choosing a refund
data.back.tagstringMEMO or Destination Tag if required
data.back.addressMixstringAddress with a colon-connected tag
data.back.txObjectAn object containing data about the returned transaction
data.back.tx.idstringTransaction hash
data.back.tx.amountstringTransaction amount
data.back.tx.feestringMiner fee
data.back.tx.ccyfeestringCurrency of Miner fee
data.back.tx.timeRegnumberTransaction registration timestamp
data.back.tx.timeBlocknumberTimestamp for adding a transaction to a block
data.back.tx.confirmationsnumberNumber of transaction confirmations
data.emergencyObjectAn object containing data about the emergency in the order
data.emergency.statusArrayEmergency status. Can be multiple values from:
EXPIRED — the transaction was received after the expiration of the order
LESS — a transaction was sent with an amount less than in the order
MORE — a transaction was sent with an amount greater than in the order
LIMIT — a transaction was sent with an amount less or more than the limit; used with LESS or MORE
data.emergency.choicestringuser choice. Can be one of the values:
NONE — Choice not made
EXCHANGE — Continue order at the new market rate
REFUND — Make a refund minus the network commission
data.emergency.repeatbooleanif true, then a repeated transaction has been received for this order
Example JSON response
{
  "code": 0,
  "msg": "",
  "data": {
    "id": "TESTID",
    "type": "float",
    "email": "",
    "status": "NEW",
    "time": {
      "reg": 1676458603,
      "start": null,
      "finish": null,
      "update": 1676458603,
      "expiration": 1676460403,
      "left": 1800,
    },
    "from": {
      "code": "BTC",
      "coin": "BTC",
      "network": "BTC",
      "name": "Bitcoin",
      "alias": "bitcoin",
      "amount": "0.50000000",
      "address": "bc1qm8e58htm6qlhz5u7awhe4a5kxt3w86ffwtl9j0",
      "addressAlt": null,
      "tag": null,
      "tagName": null,
      "reqConfirmations": 1,
      "maxConfirmations": 6,
      "tx": {
        "id": null,
        "amount": null,
        "fee": null,
        "ccyfee": null,
        "timeReg": null,
        "timeBlock": null,
        "confirmations": null,
      },
    },
    "to": {
      "code": "USDTTRC",
      "coin": "USDT",
      "network": "TRX",
      "name": "Tether (TRC20)",
      "alias": "usdt",
      "amount": "11062.06500000",
      "address": "TVnbp1VCJ1TpWMom4k3URfFky9FGfPdZPd",
      "tag": null,
      "tagName": null,
      "tx": {
        "id": null,
        "amount": null,
        "fee": null,
        "ccyfee": null,
        "timeReg": null,
        "timeBlock": null,
        "confirmations": null,
      },
    },
    "back": {
      "code": null,
      "coin": null,
      "network": null,
      "name": null,
      "alias": null,
      "amount": null,
      "address": null,
      "tag": null,
      "tagName": null,
      "tx": {
        "id": null,
        "amount": null,
        "fee": null,
        "ccyfee": null,
        "timeReg": null,
        "timeBlock": null,
        "confirmations": null,
      },
    },
    "emergency": {
      "status": [],
      "choice": "NONE",
      "repeat": 0,
    },
    "token": "TESTTOKENvRB90NOtr397kHY3PJ1VRy2p29HHaN7",
  },
}

Bestelldetails erhalten

POSThttps://ff.io/api/v2/order

Das Verfahren erhält die aktualisierten Auftragsdaten.

Parameter

NameRequiredTypeDescription
idtruestringOrder ID
tokentruestringOrder security token received when creating an order in data.token
Example request
cURL -X POST \
  -H "Accept: application/json" \
  -H "X-API-KEY: YOUR_API_KEY" \
  -H "X-API-SIGN: GENERATED_SIGN" \
  -H "Content-Type: application/json; charset=UTF-8" \
  -d '{"id":"TESTID","token":"TESTTOKENvRB90NOtr397kHY3PJ1VRy2p29HHaN7"}'
  "https://ff.io/api/v2/order" -L
<?php
  require_once('fixedfloat.php');
  
  $ff = new FixedFloatApi(YOUR_API_KEY, YOUR_API_SECRET);
  
  $data = array(
    'id'    => 'TESTID',
    'token' => 'TESTTOKENvRB90NOtr397kHY3PJ1VRy2p29HHaN7',
  );
  
  return $ff->order($data);
?>

Antwort

Eine erfolgreiche Antwort enthält ein Objekt mit Informationen über alle Daten des erstellten Auftrags

FieldTypeDescription
codenumberResponse status code. If the request is successful, then the status code is "0", otherwise it is an error
msgstringStatus message
dataObjectObject with information about all the data of the created order
data.idstringOrder ID. Consists of 6 characters
data.typestringOrder type. Can be one of the values:
fixed — fixed rate order
float — floating rate order
data.emailstringEmail address for the order to receive notifications about changes in the order
data.statusstringOrder status. Can be one of the values:
NEW — New order
PENDING — Transaction received, pending confirmation
EXCHANGE — Transaction confirmed, exchange in progress
WITHDRAW — Sending funds
DONE — Order completed
EXPIRED — Order expired
EMERGENCY — Emergency, customer choice required
data.timeObjectObject containing timestamp data
data.time.regnumberOrder creation timestamp
data.time.startnumberTransaction receive timestamp
data.time.finishnumberTimestamp when the order was completed
data.time.updatenumberTimestamp of last order update
data.time.expirationnumberTimestamp when order expires
data.time.leftnumberThe number of seconds before the end of the order
data.fromObjectAn object containing information about the currency sent by clients and transactions
data.from.codestringCurrency code
data.from.coinstringCommon asset ticker
data.from.networkstringBlockchain network in which this asset is represented
data.from.namestringName of currency
data.from.aliasstringAlias for creating qr code
data.from.amountstringAmount that the client needs to send
data.from.addressstringThe destination address to which the user is ought to deposit his funds in order for the trade to execute
data.from.tagstringMEMO or Destination Tag if required
data.from.addressMixstringAddress with a colon-connected tag
data.from.reqConfirmationsnumberRequired number of transaction confirmations
data.from.maxConfirmationsnumberThe maximum number of transaction confirmations that system updates
data.from.txObjectAn object containing data about the received transaction
data.from.tx.idstringTransaction hash
data.from.tx.amountstringTransaction amount
data.from.tx.feestringMiner fee
data.from.tx.ccyfeestringCurrency of Miner fee
data.from.tx.timeRegnumberTransaction registration timestamp
data.from.tx.timeBlocknumberTimestamp for adding a transaction to a block
data.from.tx.confirmationsnumberNumber of transaction confirmations
data.toObjectAn object containing information about the currency received by the client and the transaction
data.to.codestringCurrency code
data.to.coinstringCommon asset ticker
data.to.networkstringBlockchain network in which this asset is represented
data.to.namestringName of currency
data.to.aliasstringAlias for creating qr code
data.to.amountstringAmount that the client must to receive
data.to.addressstringThe destination address to which the funds will be dispatched upon the successful completion of the order
data.to.tagstringMEMO or Destination Tag if required
data.to.addressMixstringAddress with a colon-connected tag
data.to.txObjectAn object containing data about the sent transaction
data.to.tx.idstringTransaction hash
data.to.tx.amountstringTransaction amount
data.to.tx.feestringMiner fee
data.to.tx.ccyfeestringCurrency of Miner fee
data.to.tx.timeRegnumberTransaction registration timestamp
data.to.tx.timeBlocknumberTimestamp for adding a transaction to a block
data.to.tx.confirmationsnumberNumber of transaction confirmations
data.backObjectAn object containing information about the currency returned to the client and the transaction
data.back.codestringCurrency code
data.back.coinstringCommon asset ticker
data.back.networkstringBlockchain network in which this asset is represented
data.back.namestringName of currency
data.back.aliasstringAlias for creating qr code
data.back.amountstringThe amount that the client should receive upon return, excluding the miner fee
data.back.addressstringThe return address to which the funds will be sent when choosing a refund
data.back.tagstringMEMO or Destination Tag if required
data.back.addressMixstringAddress with a colon-connected tag
data.back.txObjectAn object containing data about the returned transaction
data.back.tx.idstringTransaction hash
data.back.tx.amountstringTransaction amount
data.back.tx.feestringMiner fee
data.back.tx.ccyfeestringCurrency of Miner fee
data.back.tx.timeRegnumberTransaction registration timestamp
data.back.tx.timeBlocknumberTimestamp for adding a transaction to a block
data.back.tx.confirmationsnumberNumber of transaction confirmations
data.emergencyObjectAn object containing data about the emergency in the order
data.emergency.statusArrayEmergency status. Can be multiple values from:
EXPIRED — the transaction was received after the expiration of the order
LESS — a transaction was sent with an amount less than in the order
MORE — a transaction was sent with an amount greater than in the order
LIMIT — a transaction was sent with an amount less or more than the limit; used with LESS or MORE
data.emergency.choicestringuser choice. Can be one of the values:
NONE — Choice not made
EXCHANGE — Continue order at the new market rate
REFUND — Make a refund minus the network commission
data.emergency.repeatbooleanif true, then a repeated transaction has been received for this order
Example JSON response
{
  "code": 0,
  "msg": "",
  "data": {
    "id": "TESTID",
    "type": "float",
    "email": "",
    "status": "NEW",
    "time": {
      "reg": 1676458603,
      "start": null,
      "finish": null,
      "update": 1676458603,
      "expiration": 1676460403,
      "left": 1800,
    },
    "from": {
      "code": "BTC",
      "coin": "BTC",
      "network": "BTC",
      "name": "Bitcoin",
      "alias": "bitcoin",
      "amount": "0.50000000",
      "address": "bc1qm8e58htm6qlhz5u7awhe4a5kxt3w86ffwtl9j0",
      "addressAlt": null,
      "tag": null,
      "tagName": null,
      "reqConfirmations": 1,
      "maxConfirmations": 6,
      "tx": {
        "id": null,
        "amount": null,
        "fee": null,
        "ccyfee": null,
        "timeReg": null,
        "timeBlock": null,
        "confirmations": null,
      },
    },
    "to": {
      "code": "USDTTRC",
      "coin": "USDT",
      "network": "TRX",
      "name": "Tether (TRC20)",
      "alias": "usdt",
      "amount": "11062.06500000",
      "address": "TVnbp1VCJ1TpWMom4k3URfFky9FGfPdZPd",
      "tag": null,
      "tagName": null,
      "tx": {
        "id": null,
        "amount": null,
        "fee": null,
        "ccyfee": null,
        "timeReg": null,
        "timeBlock": null,
        "confirmations": null,
      },
    },
    "back": {
      "code": null,
      "coin": null,
      "network": null,
      "name": null,
      "alias": null,
      "amount": null,
      "address": null,
      "tag": null,
      "tagName": null,
      "tx": {
        "id": null,
        "amount": null,
        "fee": null,
        "ccyfee": null,
        "timeReg": null,
        "timeBlock": null,
        "confirmations": null,
      },
    },
    "emergency": {
      "status": [],
      "choice": "NONE",
      "repeat": 0,
    },
  },
}

Wahl der Notfallmaßnahmen

POSThttps://ff.io/api/v2/emergency

Auswahl einer Aktion (Fortführung des Umtauschs oder Rückgabe) für eine Bestellung im Status EMERGENCY.

Parameter

NameRequiredTypeDescription
idtruestringOrder ID
tokentruestringOrder security token received when creating an order in data.token
choice true string Choice of action in the EMERGENCY status. Can be one of the values:
EXCHANGE — Continue the exchange at the market rate at the time the selection was made or at the time the order was corrected
REFUND — Refund minus miner fee
addressfalse*stringThe address to which the refund is to be made. Required if choice="REFUND".
tagfalsestringMEMO or Destination Tag if required
Example request
cURL -X POST \
  -H "Accept: application/json" \
  -H "X-API-KEY: YOUR_API_KEY" \
  -H "X-API-SIGN: GENERATED_SIGN" \
  -H "Content-Type: application/json; charset=UTF-8" \
  -d '{"id":"TESTID","token":"TESTTOKENvRB90NOtr397kHY3PJ1VRy2p29HHaN7","choice":"EXCHANGE"}'
  "https://ff.io/api/v2/emergency" -L
<?php
  require_once('fixedfloat.php');
  
  $ff = new FixedFloatApi(YOUR_API_KEY, YOUR_API_SECRET);
  
  $data = array(
    'id'    => 'TESTID',
    'token' => 'TESTTOKENvRB90NOtr397kHY3PJ1VRy2p29HHaN7',
    'choice' => 'EXCHANGE',
  );
  
  return $ff->emergency($data);
?>

Antwort

Eine erfolgreiche Antwort enthält True wenn die Auswahl in der Bestellung festgelegt wurde.

FieldTypeDescription
codenumberResponse status code. If the request is successful, then the status code is "0", otherwise it is an error
msgstringStatus message
databooleanTrue if successful
Example JSON response
{
  "code": 0,
  "msg": "",
  "data": true,
}

Benachrichtigung abonnieren

POSThttps://ff.io/api/v2/setEmail

Melden Sie sich an, um Benachrichtigungen per E-Mail über eine Änderung des Status der ausgewählten Bestellung zu erhalten.

Parameter

NameRequiredTypeDescription
idtruestringOrder ID
tokentruestringOrder security token received when creating an order in data.token
emailfalse*stringEmail address to which email notifications about order status changes should be sent
Example request
cURL -X POST \
  -H "Accept: application/json" \
  -H "X-API-KEY: YOUR_API_KEY" \
  -H "X-API-SIGN: GENERATED_SIGN" \
  -H "Content-Type: application/json; charset=UTF-8" \
  -d '{"id":"TESTID","token":"TESTTOKENvRB90NOtr397kHY3PJ1VRy2p29HHaN7","email":"[email protected]"}'
  "https://ff.io/api/v2/setEmail" -L
<?php
  require_once('fixedfloat.php');
  
  $ff = new FixedFloatApi(YOUR_API_KEY, YOUR_API_SECRET);
  
  $data = array(
    'id'    => 'TESTID',
    'token' => 'TESTTOKENvRB90NOtr397kHY3PJ1VRy2p29HHaN7',
    'email' => '[email protected]',
  );
  
  return $ff->setEmail($data);
?>

Antwort

Eine erfolgreiche Antwort enthält True wenn die Benachrichtigung abonniert wurde.

FieldTypeDescription
codenumberResponse status code. If the request is successful, then the status code is "0", otherwise it is an error
msgstringStatus message
databooleanTrue if successful
Example JSON response
{
  "code": 0,
  "msg": "",
  "data": true,
}

Bilder von QR-Codes

POSThttps://ff.io/api/v2/qr

Abrufen einer Liste mit Bildern von QR-Codes für eine Bestellung

Parameter

NameRequiredTypeDescription
idtruestringOrder ID
tokentruestringOrder security token received when creating an order in data.token
Example request
cURL -X POST \
  -H "Accept: application/json" \
  -H "X-API-KEY: YOUR_API_KEY" \
  -H "X-API-SIGN: GENERATED_SIGN" \
  -H "Content-Type: application/json; charset=UTF-8" \
  -d '{"id":"TESTID","token":"TESTTOKENvRB90NOtr397kHY3PJ1VRy2p29HHaN7","choice":"EXCHANGE"}'
  "https://ff.io/api/v2/qr" -L
<?php
  require_once('fixedfloat.php');
  
  $ff = new FixedFloatApi(YOUR_API_KEY, YOUR_API_SECRET);
  
  $data = array(
    'id'    => 'TESTID',
    'token' => 'TESTTOKENvRB90NOtr397kHY3PJ1VRy2p29HHaN7',
  );
  
  return $ff->qr($data);
?>

Antwort

Eine erfolgreiche Antwort enthält ein Array von Objekten mit Informationen über den Namen des QR-Codes und sein Bild im Base64-Format.

FieldTypeDescription
codenumberResponse status code. If the request is successful, then the status code is "0", otherwise it is an error
msgstringStatus message
dataArrayArray of objects with information about the name of the QR code and its image in Base64 format
data[].titlestringQR code name
data[].srcstringBase64 encoded QR code image
data[].checkedbooleanIf True, then defined as the default QR code
Example JSON response
{
  "code": 0,
  "msg": "",
  "data": [
    {
      "title": "With amount",
      "src": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAQIAAAECAQMAAAAvgUsTAAAABlBMVEX///8AAABVwtN+AAAAAXRSTlMAQObYZgAAAAlwSFlzAAAOxAAADsQBlSsOGwAAAjlJREFUaIHdmeFtxSAMhC0xwBuJ1RmJAZBc7s5O+tQJrlGaNuH742LOZ4j4R9dIXPHJ3IE71/kkRyYGthWx8YLnJw8HLjFy5Z6hUSdi4oXDujv4ef8RjsQNLz7rxEUXAuZ3V4IpeDCFd+YWg3ckkHn3J7dScHVefuepBUF1wDz9ub/0w4F4lHlA4xbmj8vpHTMi7lcMZ+UclhPmT3p3rIiB8K4iBD/di39TIG7MXgQhqHaI4JwxfiwtL+L+Gvq0q6YCwpy1UvgQkLmr0XhhzD1njN+MUO3R/I1fc6b404pQ4QytH4V3n9lm1IrQi+oNUpB6R1sABTxhRezZAs2FBBFfmkVotxWhlcMegNZTr+gKZIDciKd80j0fVqMjHd9OBLSA3SaykO4ZPSdDHe3pXAh5Ai0hqp4C7qcV0dWUi4f5J4sD1aPjMSKUhWo+T7WdUzre2xw+BAVO2ZZU6iw/OqMvF0Lm5kjs2uVw2JIol8Mm55Vsdgi5nYgofwPJPhK+PUu4o4uQCVHNsyxavnW0ddyK2Ko6qqD0N4SSe2pSbRsi8zHQyVaTel3NW/lTH0ING+vNVLRKR+0SWhGLdm1pW1N9jpxo93NOhHob7TjL8aAxyHyjNSGeKiN/NmpfI8fbFdgQ2qVlqBpG25ltQ80I7mayN0j1OVHpGLXx4UTMzrZeTp98rNtwJKrh1NlM9PlTpiHxHPupc5ZA/PZ0JkRlYXQd1Yqqg0AvIsuZ6bz8sPbQSa9vpTMg/tH1A833/BcCRiH/AAAAAElFTkSuQmCC",
      "checked": true,
    },
    {
      "title": "Address",
      "src": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAOoAAADqAQMAAACWWksNAAAABlBMVEX///8AAABVwtN+AAAAAXRSTlMAQObYZgAAAAlwSFlzAAAOxAAADsQBlSsOGwAAAdtJREFUWIXVmOGtBCEIhEksYEuy9S3JAkw4mAHfu1wDo9nbuH7+4YABNbt2DM9hTz5j2Y6l5/U1c3Vp4/jZjKUA8c0nV4ik8Qwzhr/xON694lfgMCw+gm04ads1ON4bXsmJ2SU4Q4cuiVVE0k+saWIk8IBt/5+v/JbENR5sCtuetPBHOyVxJkC6JCaUzhRNT90UxxExDtExiCbUE5FE85RxCU05Y6dvch4TeZzO4NtbgOCPyQTWxekSh0RCdx5Hf1C9gjQOlyATTuinV5ZVi6ON2X5Vc5MMterpNFDFWHqtot+ZwNiRm6SxcTZZaLE0K6uXNsZfz9CBG3ITgqmrgSoGaNvoD5jXsaaMIZQstChaJ5h4ZJLFZpOHvdpUmRyfPrQx+/Wxqo/3Uk/DPnWcNclhSfY3qfW700MZUzTZyhii/wRTSY8sNsPR46X6UPQzn9mQCePR1wEDBw9kRSWzOLaqUmzFJn1TRxF5nM5ADEFAnVX2eEwWwyUlmnTMrvCq87cs5mChtb4pYHOwTRrXhWnfvwxcO/Jew8TxuR5FZdp/+2iYMq4LUzZkyIrZ1l6A2bKzM7BubvYduBqC6mbq7CSO7biBhz2WKIcGSWPGDeQet0jVGYzWVFl87fgAoKe53k6WtX8AAAAASUVORK5CYII=",
      "checked": false,
    },
  ],
}