-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAPI _ FixedFloat.html
More file actions
1485 lines (1460 loc) · 180 KB
/
Copy pathAPI _ FixedFloat.html
File metadata and controls
1485 lines (1460 loc) · 180 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>API | FixedFloat</title>
<meta name="description" content="Section for developers. API for cryptocurrency exchange: Get Currencies, Get Pair, Get Price, Get Order, Create Order.">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<meta property="og:image" content="https://ff.io/assets/images/public/ogimage.jpg">
<meta property="og:site_name" content="FixedFloat">
<meta name="title" content="API | FixedFloat">
<meta property="og:title" content="API | FixedFloat">
<meta property="og:description" content="Section for developers. API for cryptocurrency exchange: Get Currencies, Get Pair, Get Price, Get Order, Create Order.">
<link rel="shortcut icon" href="/assets/images/favicon.png">
<link rel="apple-touch-icon" sizes="57x57" href="/assets/images/icons/apple-touch-icon-57x57.png">
<link rel="apple-touch-icon" sizes="60x60" href="/assets/images/icons/apple-touch-icon-60x60.png">
<link rel="apple-touch-icon" sizes="72x72" href="/assets/images/icons/apple-touch-icon-72x72.png">
<link rel="apple-touch-icon" sizes="76x76" href="/assets/images/icons/apple-touch-icon-76x76.png">
<link rel="apple-touch-icon" sizes="117x117" href="/assets/images/icons/apple-touch-icon-117x117.png">
<link rel="apple-touch-icon" sizes="120x120" href="/assets/images/icons/apple-touch-icon-120x120.png">
<link rel="apple-touch-icon" sizes="144x144" href="/assets/images/icons/apple-touch-icon-144x144.png">
<link rel="apple-touch-icon" sizes="152x152" href="/assets/images/icons/apple-touch-icon-152x152.png">
<link rel="apple-touch-icon" sizes="180x180" href="/assets/images/icons/apple-touch-icon-180x180.png">
<link rel="canonical" href="https://ff.io/api">
<link rel="alternate" hreflang="en" href="https://ff.io/en/api">
<link rel="alternate" hreflang="es" href="https://ff.io/es/api">
<link rel="alternate" hreflang="de" href="https://ff.io/de/api">
<link rel="alternate" hreflang="fr" href="https://ff.io/fr/api">
<link rel="alternate" hreflang="pt" href="https://ff.io/pt/api">
<link rel="alternate" hreflang="ru" href="https://ff.io/ru/api">
<link rel="alternate" hreflang="pl" href="https://ff.io/pl/api">
<link rel="alternate" hreflang="nl" href="https://ff.io/nl/api">
<link rel="alternate" hreflang="ua" href="https://ff.io/ua/api">
<link rel="alternate" hreflang="tr" href="https://ff.io/tr/api">
<link rel="alternate" hreflang="it" href="https://ff.io/it/api">
<link rel="alternate" hreflang="cn" href="https://ff.io/cn/api">
<link rel="alternate" hreflang="ko" href="https://ff.io/ko/api">
<link rel="alternate" hreflang="ja" href="https://ff.io/ja/api">
<link rel="alternate" hreflang="x-default" href="https://ff.io/api">
<link rel="preload" href="/assets/fonts/montserrat/latin/montserrat-v25-latin-300.woff2" as="font" type="font/woff2" crossorigin>
<link rel="preload" href="/assets/fonts/montserrat/latin/montserrat-v25-latin-regular.woff2" as="font" type="font/woff2" crossorigin>
<link rel="preload" href="/assets/fonts/montserrat/latin/montserrat-v25-latin-500.woff2" as="font" type="font/woff2" crossorigin>
<link rel="preload" href="/assets/fonts/montserrat/latin/montserrat-v25-latin-600.woff2" as="font" type="font/woff2" crossorigin>
<link rel="preload" href="/assets/fonts/montserrat/latin/montserrat-v25-latin-700.woff2" as="font" type="font/woff2" crossorigin>
<link rel="preload" href="/assets/fonts/fficons/fficons.woff2?172355" as="font" type="font/woff2" crossorigin>
<style type="text/css">
@font-face {
font-family: 'Icons';
font-display: block;
src: url("/assets/fonts/fficons/fficons.woff2?172355") format("woff2"),
url("/assets/fonts/fficons/fficons.woff?172355") format("woff"),
url("/assets/fonts/fficons/fficons.ttf?172355") format("truetype");
}
</style>
<link rel="stylesheet" type="text/css" href="/assets/css/min.css?131929">
<script type="text/javascript" src="/assets/js/min.js?131929"></script>
<script type="text/javascript" src="/assets/js/libs/moment.min.js" defer></script>
<script type="text/javascript" src="/assets/js/libs/jsqr.js" defer></script>
<script type="text/javascript" src="/assets/js/libs/webln.min.js" defer></script>
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-125458753-1"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'UA-125458753-1');
</script>
</head>
<body class="index">
<script type="text/javascript">
let localTheme = localStorage.getItem('theme');
let currTheme = localTheme ? localTheme : "dark";
window.themeLight = currTheme == 'light' ? true : false;
document.body.className += (document.body.className ? ' ' : '') + currTheme+'bg';
</script>
<script type="text/javascript">
function initFreshChat() {
let restoreId = 'd8d05542-4fc7-4fbc-acf5-d0ef9cd6e15a';
window.fcWidget.init({
token: "15d5f180-cf0e-4bcc-8165-c25e4879bab4",
host: "https://wchat.freshchat.com",
locale: "en",
externalId: "user_100472",
restoreId: restoreId ? restoreId : null,
config: {
hideFAQ: true,
agent: {
hideName: true,
hidePic: true,
hideBio: false,
},
},
});
window.fcWidget.user.get(function(resp) {
window.fcWidget.user.setFirstName("Client #12859182");
let status = resp && resp.status,
data = resp && resp.data;
if (status !== 200) {
window.fcWidget.on('user:created', function(resp) {
let status = resp && resp.status,
data = resp && resp.data;
if (status === 200 || !restoreId) {
setRestoreId(data.restoreId)
}
});
} else if (data.restoreId && !restoreId) {
setRestoreId(data.restoreId)
}
});
function setRestoreId(restoreId) {
if (!restoreId) return;
APP.api('userSetChatRestoreId', {restoreId: restoreId})
.then(function(msg) {}).catch(function(msg) {})
}
document.dispatchEvent(new Event("freshchatStart"));
}
function initialize(i,t) {
var e;
i.getElementById(t) ? initFreshChat() : (
(e = i.createElement("script")).id = t,
e.async = !0,
e.src = "https://wchat.freshchat.com/js/widget.js",
e.onload = initFreshChat,
i.head.appendChild(e)
)
}
function initiateCall() {
initialize(document,"freshchat-js-sdk")
}
window.addEventListener ? window.addEventListener("load",initiateCall,!1) : window.attachEvent("load",initiateCall,!1);
</script>
<style id="highlighting_style"></style>
<header id="header" class="fixed">
<div class="wrapper">
<div class="left-menu-wrap" id="left_menu_wrap">
<div id="left_menu_btn">
<div><span></span><span></span><span></span></div>
</div>
<nav class="left-menu" id="left_menu">
<div class="theme-switch-wrap">
<label class="theme-switch">
<input type="checkbox" name="themelight" id="themelight_switch_mobile">
<span><i class="ico"></i></span>
</label>
</div>
<section>
<ul id="left_menu_content" class="menu linkhl">
<li class="menu-head"><span>Account</span></li>
<li><a href="/user/profile"><i class="ico profile"></i><span>Personal data</span></a></li>
<li><a href="/user/orders"><i class="ico history"></i><span>Orders history</span></a></li>
<li><a href="/user/addressbook"><i class="ico addressbook"></i><span>Address book</span></a></li>
<li><a href="/user/affiliate"><i class="ico affiliate"></i><span>Affiliate program</span></a></li>
<li><a href="/user/payouts"><i class="ico payout"></i><span>Payouts</span></a></li>
<li><a href="/user/apikey"><i class="ico apikey"></i><span>API management</span></a></li>
<li><a href="/user/signout" class="signout" data-confirm="Are you sure?"><i class="ico signout"></i><span>Sign out</span></a></li> <li class="menu-head"><span>FixedFloat</span></li>
<li><a href="/about">About</a></li>
<li><a href="/blog">Blog</a></li>
<li><a href="/faq">FAQ</a></li>
<li><a href="/api">API</a></li>
<li><a href="/support">Support</a></li>
<li><a href="/brand">Our brand</a></li>
<li class="menu-head"><span>Rules</span></li>
<li><a href="/terms-of-service">Terms of Service</a></li>
<li><a href="/privacy-policy">Privacy Policy</a></li>
</ul>
</section>
</nav>
</div>
<nav>
<a href="/" id="logo" class="logo">
<span class="logo-text-fixed" id="logo_text_from"></span><div class="ico"><span class="logo-arrow-from" id="logo_arrow_from"></span><span class="logo-arrow-to" id="logo_arrow_to"></span></div><span class="logo-text-float" id="logo_text_to"></span>
</a>
<div class="nav-right">
<ul class="nav menu hoverhl">
<li><a href="/about">About</a></li>
<li><a href="/blog">Blog</a></li>
<li><a href="/faq">FAQ</a></li>
<li><a href="/api">API</a></li>
<li><a href="/support">Support</a></li>
</ul>
<div class="loc hoverhl">
<a class="menu-focus-btn" tabindex="0"><div class="ui-select-value"><i class="loc-img loc-en"></i></div></a>
<div class="menu-focus-opened">
<ul class="hoverhl" id="loc_menu_wrap">
<li><a href="/en/api"><i class="loc-img loc-en"></i><span>English</span></a></li>
<li><a href="/es/api"><i class="loc-img loc-es"></i><span>Español</span></a></li>
<li><a href="/de/api"><i class="loc-img loc-de"></i><span>Deutsch</span></a></li>
<li><a href="/fr/api"><i class="loc-img loc-fr"></i><span>Français</span></a></li>
<li><a href="/pt/api"><i class="loc-img loc-pt"></i><span>Português</span></a></li>
<li><a href="/ru/api"><i class="loc-img loc-ru"></i><span>Русский</span></a></li>
<li><a href="/pl/api"><i class="loc-img loc-pl"></i><span>Polski</span></a></li>
<li><a href="/nl/api"><i class="loc-img loc-nl"></i><span>Nederlands</span></a></li>
<li><a href="/ua/api"><i class="loc-img loc-ua"></i><span>Украïнська</span></a></li>
<li><a href="/tr/api"><i class="loc-img loc-tr"></i><span>Türkçe</span></a></li>
<li><a href="/it/api"><i class="loc-img loc-it"></i><span>Italiano</span></a></li>
<li><a href="/cn/api"><i class="loc-img loc-cn"></i><span>中文</span></a></li>
<li><a href="/ko/api"><i class="loc-img loc-ko"></i><span>한국어</span></a></li>
<li><a href="/ja/api"><i class="loc-img loc-ja"></i><span>日本の</span></a></li>
</ul>
</div>
<div class="shadow-body" tabindex="0"></div>
</div>
<div class="theme-switch-wrap">
<label class="theme-switch">
<input type="checkbox" name="themelight" id="themelight_switch">
<span><i class="ico"></i></span>
</label>
<script type="text/javascript">
if (window.themeLight) {
document.getElementById('themelight_switch').checked = true;
document.getElementById('themelight_switch_mobile').checked = true;
}
</script>
</div>
<div class="nav userbar hoverhl">
<a class="menu-focus-btn" tabindex="0">Account</a>
<ul class="menu-focus-opened hoverhl">
<li><a href="/user/profile"><i class="ico profile"></i><span>Personal data</span></a></li>
<li><a href="/user/orders"><i class="ico history"></i><span>Orders history</span></a></li>
<li><a href="/user/addressbook"><i class="ico addressbook"></i><span>Address book</span></a></li>
<li><a href="/user/affiliate"><i class="ico affiliate"></i><span>Affiliate program</span></a></li>
<li><a href="/user/payouts"><i class="ico payout"></i><span>Payouts</span></a></li>
<li><a href="/user/apikey"><i class="ico apikey"></i><span>API management</span></a></li>
<li><a href="/user/signout" class="signout" data-confirm="Are you sure?"><i class="ico signout"></i><span>Sign out</span></a></li> </ul>
</div>
</div>
</nav>
<div class="shadow-body"></div>
</div>
</header>
<aside class="api-table-of-content leftfixed">
<div class="api-table-of-content-header"><h1>API FixedFloat</h1></div>
<div class="api-table-of-content-active"><span id="api_active_menuitem">Introduction</span></div>
<ul class="list-aside" id="api_table_of_content">
<li class="list-head active" data-id="api_intro"><a href="#api_intro">Introduction</a></li>
<li class="list-head" data-id="api_getkey"><a href="#api_getkey">Getting the API key</a></li>
<li class="list-head" data-id="api_example"><a href="#api_example">Request and example</a></li>
<li class="list-head" data-id="api_limits"><a href="#api_limits">Request limits</a></li>
<li class="list-head" data-id="api_libraries"><a href="#api_libraries">Official Libraries</a></li>
<li class="list-head" data-id="api_methods"><a href="#api_methods">Methods</a></li>
<ul class="deep">
<li class="list-head" data-id="method_xmlexport"><a href="#method_xmlexport">XML export file of rates</a></li>
<li class="list-head" data-id="method_ccies"><a href="#method_ccies">Available currencies</a></li>
<li class="list-head" data-id="method_price"><a href="#method_price">Exchange rate</a></li>
<li class="list-head" data-id="method_create"><a href="#method_create">Create order</a></li>
<li class="list-head" data-id="method_order"><a href="#method_order">Get order details</a></li>
<li class="list-head" data-id="method_emergency"><a href="#method_emergency">Emergency Action Choice</a></li>
<li class="list-head" data-id="method_setemail"><a href="#method_setemail">Subscribe to notification</a></li>
<li class="list-head" data-id="method_qr"><a href="#method_qr">Images of QR codes</a></li>
</ul>
</ul>
</aside>
<main>
<section class="content api-content">
<section class="api-section" id="api_intro">
<section class="api-description-section">
<div class="api-description">
<h2>Introduction</h2>
<p>The FixedFloat API allows you to automate the receipt of information about the exchange rates of currencies, created orders, presented on the FixedFloat service, create orders and manage them using it.</p>
<p>To use the FixedFloat API, you need to get an API key and an API secret.</p> </div>
</section>
</section>
<section class="api-section" id="api_getkey">
<section class="api-description-section">
<div class="api-description">
<h2>Getting the API key</h2>
<p>To get an API Key and API Secret, follow these steps:</p>
<ol><li><a href="/user/signin">Sign in</a> or <a href="/user/signup">Register</a> in the FixedFloat</li>
<li>Go to the <a href="/user/apikey">API management</a> section</li>
<li>Click the "<b>Generate</b>" button and follow the instructions in the window that appears</li>
<li>Copy the <b>API Key</b> and <b>API Secret</b> and keep them in a safe place. Use these parameters for requests to the FixedFloat API</li>
</ol> </div>
</section>
</section>
<!-- -->
<section class="api-section" id="api_example">
<section class="api-description-section">
<div class="api-description">
<h2>Request and example</h2>
<p>The sent data must be in JSON format with UTF-8 encoding.</p>
<p>For successful API requests, all requests must contain a few mandatory headers:</p>
<ul class="with-marker"><li>The <span class="api-p-header">Content-Type</span> header must be application/json; charset=UTF-8</li>
<li>The <span class="api-p-header">X-API-KEY</span> header should contain your received API Key (<span class="api-code-curl-const">YOUR_API_KEY</span>)</li>
<li>The <span class="api-p-header">X-API-SIGN</span> header must contain the signature <span class="api-code-curl-const">GENERATED_SIGN</span>. To get the signature you must use your API Secret (<span class="api-code-curl-const">YOUR_API_SECRET</span>) as the HMAC SHA256 operation key and the json data string as the value.</li>
</ul> </div>
<div class="api-example"><div class="api-example-title"><span>X-API-SIGN generation</span></div>
<div class="api-example-tabs">
<label class="active" data-lang="curl">Curl</label>
<label data-lang="python">Python</label>
<label data-lang="php">PHP</label>
</div>
<div class="api-example-code-wrapper">
<div class="api-example-code active" data-lang="curl">
<code>
<pre>[linux]$ echo -n '<span class="api-code-curl-const">DATA_JSON</span>' | openssl dgst -sha256 -hmac "<span class="api-code-curl-const">YOUR_API_SECRET</span>"</pre>
<pre>(stdin)= <span class="api-code-curl-const">GENERATED_SIGN</span></pre>
</code>
<code>
<pre><span class="api-code-curl-f">cURL</span> <span class="api-code-curl-h">-X</span> <span class="api-code-curl-x">POST</span> <span class="api-code-curl-n">\</span></pre>
<pre> <span class="api-code-curl-h">-H</span> <span class="api-code-curl-txt">"Accept: application/json"</span> <span class="api-code-curl-n">\</span></pre>
<pre> <span class="api-code-curl-h">-H</span> <span class="api-code-curl-txt">"X-API-KEY: <span class="api-code-curl-const">YOUR_API_KEY</span>"</span> <span class="api-code-curl-n">\</span></pre>
<pre> <span class="api-code-curl-h">-H</span> <span class="api-code-curl-txt">"X-API-SIGN: <span class="api-code-curl-const">GENERATED_SIGN</span>"</span> <span class="api-code-curl-n">\</span></pre>
<pre> <span class="api-code-curl-h">-H</span> <span class="api-code-curl-txt">"Content-Type: application/json; charset=UTF-8"</span> <span class="api-code-curl-n">\</span></pre>
<pre> <span class="api-code-curl-h">-d</span> <span class="api-code-curl-txt">'<span class="api-code-curl-const">DATA_JSON</span>'</span></pre>
<pre> <span class="api-code-curl-link">"https://ff.io/api/v2/<span class="api-code-curl-const">METHOD</span>"</span> <span class="api-code-curl-h">-L</span></pre>
</code>
</div>
<div class="api-example-code" data-lang="python">
<code>
<pre><span class="api-code-py-f">import</span> hmac</pre>
<pre><span class="api-code-py-f">import</span> json</pre>
<pre><span class="api-code-py-f">import</span> hashlib</pre>
<pre><span class="api-code-py-f">import</span> requests</pre>
<pre> </pre>
<pre><span class="api-code-py-u">def</span> <span class="api-code-py-fn">sign</span>(data):</pre>
<pre> <span class="api-code-py-u">return</span> hmac.<span class="api-code-py-f">new</span>(</pre>
<pre> key<span class="api-code-py-u">=</span><span class="api-code-curl-const">YOUR_API_SECRET</span>.<span class="api-code-py-f">encode</span>(),</pre>
<pre> msg<span class="api-code-py-u">=</span>data.<span class="api-code-py-f">encode</span>(),</pre>
<pre> digestmod<span class="api-code-py-u">=</span>hashlib.sha256</pre>
<pre> ).<span class="api-code-py-f">hexdigest</span>()</pre>
<pre> </pre>
<pre> </pre>
<pre><span class="api-code-py-u">def</span> <span class="api-code-py-fn">request</span>(method, params={}):</pre>
<pre> url <span class="api-code-py-u">=</span> 'https://ff.io/api/v2/' + method</pre>
<pre> data <span class="api-code-py-u">=</span> json.<span class="api-code-py-f">dumps</span>(params)</pre>
<pre> headers <span class="api-code-py-u">=</span> {</pre>
<pre> 'X-API-KEY': <span class="api-code-curl-const">YOUR_API_KEY</span>,</pre>
<pre> 'X-API-SIGN': <span class="api-code-py-f">sign</span>(data)</pre>
<pre> }</pre>
<pre> r <span class="api-code-py-u">=</span> requests.<span class="api-code-py-f">post</span>(url, data=data, headers=headers)</pre>
<pre> return r.<span class="api-code-py-f">json</span>()</pre>
<pre> </pre>
<pre><span class="api-code-py-f">request</span>(<span class="api-code-curl-const">METHOD</span>, <span class="api-code-curl-const">DATA</span>)</pre>
</code>
</div>
<div class="api-example-code" data-lang="php">
<code>
<pre><span class="api-code-php-p"><?php</span></pre>
<pre> <span class="api-code-php-f">function</span> <span class="api-code-php-f">sign</span>(<span class="api-code-php-svar">$</span>data) {</pre>
<pre> <span class="api-code-php-f">return</span> <span class="api-code-php-u">hash_hmac</span>(<span class="api-code-php-txt">'sha256'</span>, <span class="api-code-php-svar">$</span>data, <span class="api-code-php-const">YOUR_API_SECRET</span>);</pre>
<pre> }</pre>
<pre> </pre>
<pre> <span class="api-code-php-f">function</span> <span class="api-code-php-f">request</span>(<span class="api-code-php-svar">$</span>method, <span class="api-code-php-svar">$</span>data) {</pre>
<pre> <span class="api-code-php-svar">$</span>url = <span class="api-code-php-txt">'https://ff.io/api/v2/'</span>.<span class="api-code-php-svar">$</span>method;</pre>
<pre> </pre>
<pre> <span class="api-code-php-svar">$</span>req = <span class="api-code-php-u">json_encode</span>(<span class="api-code-php-svar">$</span>data);</pre>
<pre> </pre>
<pre> <span class="api-code-php-svar">$</span>ch = <span class="api-code-php-u">curl_init</span>();</pre>
<pre> <span class="api-code-php-u">curl_setopt</span>(<span class="api-code-php-svar">$</span>ch, <span class="api-code-php-iconst">CURLOPT_URL</span>, <span class="api-code-php-svar">$</span>url);</pre>
<pre> <span class="api-code-php-u">curl_setopt</span>(<span class="api-code-php-svar">$</span>ch, <span class="api-code-php-iconst">CURLOPT_RETURNTRANSFER</span>, <span class="api-code-boolean">true</span>);</pre>
<pre> <span class="api-code-php-u">curl_setopt</span>(<span class="api-code-php-svar">$</span>ch, <span class="api-code-php-iconst">CURLOPT_SSL_VERIFYHOST</span>, <span class="api-code-numeric">2</span>);</pre>
<pre> <span class="api-code-php-u">curl_setopt</span>(<span class="api-code-php-svar">$</span>ch, <span class="api-code-php-iconst">CURLOPT_POST</span>, <span class="api-code-boolean">true</span>);</pre>
<pre> <span class="api-code-php-u">curl_setopt</span>(<span class="api-code-php-svar">$</span>ch, <span class="api-code-php-iconst">CURLOPT_POSTFIELDS</span>, <span class="api-code-php-svar">$</span>req);</pre>
<pre> <span class="api-code-php-u">curl_setopt</span>(<span class="api-code-php-svar">$</span>ch, <span class="api-code-php-iconst">CURLOPT_HTTPHEADER</span>, <span class="api-code-php-array">array</span>(</pre>
<pre> <span class="api-code-php-txt">'Content-Type:application/json'</span>,</pre>
<pre> <span class="api-code-php-txt">'X-API-KEY: '</span> . <span class="api-code-php-const">YOUR_API_KEY</span>,</pre>
<pre> <span class="api-code-php-txt">'X-API-SIGN: '</span> . <span class="api-code-php-f">sign</span>(<span class="api-code-php-svar">$</span>req)</pre>
<pre> ));</pre>
<pre> <span class="api-code-php-svar">$</span>response = <span class="api-code-php-f">curl_exec</span>(<span class="api-code-php-svar">$</span>ch);</pre>
<pre> <span class="api-code-php-u">curl_close</span>(<span class="api-code-php-svar">$</span>ch);</pre>
<pre> </pre>
<pre> <span class="api-code-php-svar">$</span>result = <span class="api-code-php-f">json_decode</span>(<span class="api-code-php-svar">$</span>response, <span class="api-code-boolean">true</span>);</pre>
<pre> <span class="api-code-php-f">if</span> (<span class="api-code-php-svar">$</span>result[<span class="api-code-php-txt">'code'</span>] == 0) {</pre>
<pre> <span class="api-code-php-f">return</span> <span class="api-code-php-svar">$</span>result[<span class="api-code-php-txt">'data'</span>];</pre>
<pre> } <span class="api-code-php-f">else</span> {</pre>
<pre> <span class="api-code-php-f">throw</span> <span class="api-code-php-new">new</span> <span class="api-code-php-exc">Exception</span>(<span class="api-code-php-svar">$</span>result[<span class="api-code-php-txt">'msg'</span>], <span class="api-code-php-svar">$</span>result[<span class="api-code-php-txt">'code'</span>]);</pre>
<pre> }</pre>
<pre> }</pre>
<pre> </pre>
<pre> <span class="api-code-php-f">request</span>(<span class="api-code-curl-const">METHOD</span>, <span class="api-code-curl-const">DATA</span>);</pre>
<pre><span class="api-code-php-p">?></span></pre>
</code>
</div>
</div></div>
</section>
</section>
<!-- -->
<section class="api-section" id="api_limits">
<section class="api-description-section">
<div class="api-description">
<h2>Request limits</h2>
<p>The request limit per minute is <b>250 weight units</b>.</p>
<p>The <span class="api-p-req">/api/v2/create</span> request costs <b>50 weight units</b>, all other requests cost <b>1 weight unit</b>.</p>
<p>If the limit is exceeded, your token will be temporarily blocked. With each subsequent exceeding of the limit after unlocking, the blocking time will increase</p> </div>
</section>
</section>
<!-- -->
<section class="api-section" id="api_libraries">
<section class="api-description-section">
<div class="api-description">
<h2>Official Libraries</h2>
<p>You can use ready made libraries to use the FixedFloat API:</p>
<ul class="with-marker"><li>PHP (<a href="/media/libs/fixedfloat-api.zip">Download</a>)</li>
<li>Python (<a>Download</a>)</li>
</ul> </div>
</section>
</section>
<span id="api_methods"></span>
<section class="api-section" id="method_xmlexport" data-parent="api_methods"><section class="api-request-section">
<div class="api-description">
<h2>XML export file of rates</h2>
<div class="api-url sp"><span class="api-url-method get">GET</span><span class="api-url-line"><span class="api-url-protocol">https://</span><span class="api-url-host">ff.io</span><span class="api-url-link">/rates/fixed.xml</span></span></div>
<div class="api-url"><span class="api-url-method get">GET</span><span class="api-url-line"><span class="api-url-protocol">https://</span><span class="api-url-host">ff.io</span><span class="api-url-link">/rates/float.xml</span></span></div>
<p>Getting an export file of exchange rates in XML format, containing information about all currency pairs, exchange rates, reserve availability, as well as minimum and maximum amounts for creating an exchange.</p>
<h3>Parameters</h3>
<p>No parameters need to be passed for this request. It is also not required to include headers with a key and signature.</p>
</div>
<div class="api-example"><div class="api-example-title"><span>Example request</span></div>
<div class="api-example-tabs">
<label class="active" data-lang="curl">Curl</label>
<label data-lang="python">Python</label>
<label data-lang="php">PHP</label>
</div>
<div class="api-example-code-wrapper">
<div class="api-example-code active" data-lang="curl">
<code>
<pre><span class="api-code-curl-f">cURL</span> <span class="api-code-curl-link">"https://ff.io/rates/float.xml"</span> <span class="api-code-curl-h">-L</span></pre>
</code>
</div>
<div class="api-example-code" data-lang="python"></div>
<div class="api-example-code" data-lang="php"></div>
</div></div>
</section>
<section class="api-response-section">
<div class="api-description">
<h3>Response</h3>
<p>A successful response contains an array of currency information objects.</p>
<div class="api-table-wrap"><table class="api-response-table"><thead><tr><td>Field</td><td>Type</td><td>Description</td></tr></thead><tbody><tr data-name="<rates>"><td><i class="table-plus"></i><rates></td><td class="api-table-p-type">XML object</td><td>List of currency pair objects</td></tr><tr data-name="<item>" data-parent="<rates>"><td><i class="table-deep-i end"></i><i class="table-plus"></i><item></td><td class="api-table-p-type">XML object</td><td>An object containing information about the exchange rate, reserves, minimums and maximums for a pair of currencies.</td></tr><tr data-parent="<rates> <item>"><td><i class="table-deep-i no"></i><i class="table-deep-i"></i><i class="table-plus empty"></i><from></td><td class="api-table-p-type">string</td><td>Currency code of the currency that will be sent for exchange</td></tr><tr data-parent="<rates> <item>"><td><i class="table-deep-i no"></i><i class="table-deep-i"></i><i class="table-plus empty"></i><to></td><td class="api-table-p-type">string</td><td>Currency code of the currency that will be received as a result of the exchange</td></tr><tr data-parent="<rates> <item>"><td><i class="table-deep-i no"></i><i class="table-deep-i"></i><i class="table-plus empty"></i><in></td><td class="api-table-p-type">number</td><td>Amount in the <span class="api-param-ex"><from></span> currency that will be sent for exchange. Required for calculating the final exchange rate.</td></tr><tr data-parent="<rates> <item>"><td><i class="table-deep-i no"></i><i class="table-deep-i"></i><i class="table-plus empty"></i><out></td><td class="api-table-p-type">number</td><td>Amount in the <span class="api-param-ex"><to></span> currency that will be received as a result of the exchange. Required for calculating the final exchange rate.</td></tr><tr data-parent="<rates> <item>"><td><i class="table-deep-i no"></i><i class="table-deep-i"></i><i class="table-plus empty"></i><amount></td><td class="api-table-p-type">number</td><td>Indicates the availability of reserves for the <span class="api-param-ex"><to></span> currency. The parameter does not specify or allow for obtaining the maximum exchange amount.</td></tr><tr data-parent="<rates> <item>"><td><i class="table-deep-i no"></i><i class="table-deep-i"></i><i class="table-plus empty"></i><tofee></td><td class="api-table-p-type">string</td><td>Additional fees (network fees) in the <span class="api-param-ex"><to></span> currency, which are not included in the exchange rate (in the amount specified in <span class="api-param-ex"><out></span>).</td></tr><tr data-parent="<rates> <item>"><td><i class="table-deep-i no"></i><i class="table-deep-i"></i><i class="table-plus empty"></i><minamount></td><td class="api-table-p-type">string</td><td>The minimum amount of the <span class="api-param-ex"><from></span> currency that the service can exchange</td></tr><tr data-parent="<rates> <item>"><td><i class="table-deep-i no"></i><i class="table-deep-i end"></i><i class="table-plus empty"></i><maxamount></td><td class="api-table-p-type">string</td><td>The maximum amount of the <span class="api-param-ex"><from></span> currency that the service can exchange</td></tr></tbody></table></div>
</div>
<div class="api-example"><div class="api-example-title"><span>Example XML response</span></div>
<div class="api-example-code-wrapper">
<div class="api-example-code">
<code>
<pre><span class="api-code-xmltag"><rates></span></pre>
<pre> <span class="api-code-xmltag"><item></span></pre>
<pre> <span class="api-code-xmltag"><from></span><span class="api-code-param">BTC</span><span class="api-code-xmltag"></from></span></pre>
<pre> <span class="api-code-xmltag"><to></span><span class="api-code-param">ETH</span><span class="api-code-xmltag"></to></span></pre>
<pre> <span class="api-code-xmltag"><in></span><span class="api-code-param">1</span><span class="api-code-xmltag"></in></span></pre>
<pre> <span class="api-code-xmltag"><out></span><span class="api-code-param">17.720391807658</span><span class="api-code-xmltag"></out></span></pre>
<pre> <span class="api-code-xmltag"><amount></span><span class="api-code-param">191.11148571181</span><span class="api-code-xmltag"></amount></span></pre>
<pre> <span class="api-code-xmltag"><tofee></span><span class="api-code-param">0.0004967000 ETH</span><span class="api-code-xmltag"></tofee></span></pre>
<pre> <span class="api-code-xmltag"><minamount></span><span class="api-code-param">0.0004896204 BTC</span><span class="api-code-xmltag"></minamount></span></pre>
<pre> <span class="api-code-xmltag"><maxamount></span><span class="api-code-param">1.5160672800 BTC</span><span class="api-code-xmltag"></maxamount></span></pre>
<pre> <span class="api-code-xmltag"></item></span></pre>
<pre> <span class="api-code-xmltag"><item></span></pre>
<pre> <span class="api-code-xmltag"><from></span><span class="api-code-param">BTC</span><span class="api-code-xmltag"></from></span></pre>
<pre> <span class="api-code-xmltag"><to></span><span class="api-code-param">USDT</span><span class="api-code-xmltag"></to></span></pre>
<pre> <span class="api-code-xmltag"><in></span><span class="api-code-param">1</span><span class="api-code-xmltag"></in></span></pre>
<pre> <span class="api-code-xmltag"><out></span><span class="api-code-param">61595.076999999997</span><span class="api-code-xmltag"></out></span></pre>
<pre> <span class="api-code-xmltag"><amount></span><span class="api-code-param">1170121.610442</span><span class="api-code-xmltag"></amount></span></pre>
<pre> <span class="api-code-xmltag"><tofee></span><span class="api-code-param">2.2490000000 USDT</span><span class="api-code-xmltag"></tofee></span></pre>
<pre> <span class="api-code-xmltag"><minamount></span><span class="api-code-param">0.0006675144 BTC</span><span class="api-code-xmltag"></minamount></span></pre>
<pre> <span class="api-code-xmltag"><maxamount></span><span class="api-code-param">0.7269365000 BTC</span><span class="api-code-xmltag"></maxamount></span></pre>
<pre> <span class="api-code-xmltag"></item></span></pre>
<pre> <span class="api-code-xmltag"><item></span></pre>
<pre> <span class="api-code-xmltag"><from></span><span class="api-code-param">ETH</span><span class="api-code-xmltag"></from></span></pre>
<pre> <span class="api-code-xmltag"><to></span><span class="api-code-param">USDT</span><span class="api-code-xmltag"></to></span></pre>
<pre> <span class="api-code-xmltag"><in></span><span class="api-code-param">1</span><span class="api-code-xmltag"></in></span></pre>
<pre> <span class="api-code-xmltag"><out></span><span class="api-code-param">3396.173800000000</span><span class="api-code-xmltag"></out></span></pre>
<pre> <span class="api-code-xmltag"><amount></span><span class="api-code-param">1170121.610442</span><span class="api-code-xmltag"></amount></span></pre>
<pre> <span class="api-code-xmltag"><tofee></span><span class="api-code-param">2.0380000000 USDT</span><span class="api-code-xmltag"></tofee></span></pre>
<pre> <span class="api-code-xmltag"><minamount></span><span class="api-code-param">0.0107817333 ETH</span><span class="api-code-xmltag"></minamount></span></pre>
<pre> <span class="api-code-xmltag"><maxamount></span><span class="api-code-param">13.1841012000 ETH</span><span class="api-code-xmltag"></maxamount></span></pre>
<pre> <span class="api-code-xmltag"></item></span></pre>
<pre> <span class="api-code-more">...</span>,</pre>
<pre><span class="api-code-xmltag"></rates></span></pre>
</code>
</div>
</div>
</div>
</section></section>
<section class="api-section" id="method_ccies" data-parent="api_methods"><section class="api-request-section"><div class="api-description">
<h2>Available currencies</h2>
<div class="api-url"><span class="api-url-method post">POST</span><span class="api-url-line"><span class="api-url-protocol">https://</span><span class="api-url-host">ff.io</span><span class="api-url-link">/api/v2/ccies</span></span></div>
<p>Getting a list of currencies supported by the FixedFloat service, as well as data on their display and information about the availability for receiving and sending.</p>
<h3>Parameters</h3>
<p>There is no need to pass parameters for this request.</p>
<p><span class="api-p-header">X-API-SIGN</span> is generated by calling the <span class="api-p-func">HMAC SHA256</span> function from an empty string if no parameters are passed, or from an empty JSON object.</p>
</div>
<div class="api-example"><div class="api-example-title"><span>Example request</span></div>
<div class="api-example-tabs">
<label class="active" data-lang="curl">Curl</label>
<label data-lang="python">Python</label>
<label data-lang="php">PHP</label>
</div>
<div class="api-example-code-wrapper">
<div class="api-example-code active" data-lang="curl">
<code>
<pre><span class="api-code-curl-f">cURL</span> <span class="api-code-curl-h">-X</span> <span class="api-code-curl-x">POST</span> <span class="api-code-curl-n">\</span></pre>
<pre> <span class="api-code-curl-h">-H</span> <span class="api-code-curl-txt">"Accept: application/json"</span> <span class="api-code-curl-n">\</span></pre>
<pre> <span class="api-code-curl-h">-H</span> <span class="api-code-curl-txt">"X-API-KEY: <span class="api-code-curl-const">YOUR_API_KEY</span>"</span> <span class="api-code-curl-n">\</span></pre>
<pre> <span class="api-code-curl-h">-H</span> <span class="api-code-curl-txt">"X-API-SIGN: <span class="api-code-curl-const">GENERATED_SIGN</span>"</span> <span class="api-code-curl-n">\</span></pre>
<pre> <span class="api-code-curl-h">-H</span> <span class="api-code-curl-txt">"Content-Type: application/json; charset=UTF-8"</span> <span class="api-code-curl-n">\</span></pre>
<pre> <span class="api-code-curl-link">"https://ff.io/api/v2/ccies"</span> <span class="api-code-curl-h">-L</span></pre>
</code>
</div>
<div class="api-example-code" data-lang="python"></div>
<div class="api-example-code" data-lang="php">
<code>
<pre><span class="api-code-php-p"><?php</span></pre>
<pre> <span class="api-code-php-u">require_once</span>(<span class="api-code-php-txt">'fixedfloat.php'</span>);</pre>
<pre> </pre>
<pre> <span class="api-code-php-svar">$</span>ff = <span class="api-code-php-new">new</span> <span class="api-code-php-f">FixedFloatApi</span>(<span class="api-code-php-const">YOUR_API_KEY</span>, <span class="api-code-php-const">YOUR_API_SECRET</span>);</pre>
<pre> </pre>
<pre> <span class="api-code-php-f">return</span> <span class="api-code-php-svar">$</span>ff-><span class="api-code-php-u">ccies</span>();</pre>
<pre><span class="api-code-php-p">?></span></pre>
</code>
</div>
</div></div>
</section><section class="api-response-section"><div class="api-description">
<h3>Response</h3>
<p>A successful response contains an array of currency information objects.</p>
<div class="api-table-wrap"><table class="api-response-table"><thead><tr><td>Field</td><td>Type</td><td>Description</td></tr></thead><tbody><tr><td><i class="table-plus empty"></i>code</td><td class="api-table-p-type">number</td><td>Response status code. If the request is successful, then the status code is "0", otherwise it is an error</td></tr><tr><td><i class="table-plus empty"></i>msg</td><td class="api-table-p-type">string</td><td>Status message</td></tr><tr data-name="data"><td><i class="table-plus"></i>data</td><td class="api-table-p-type">Array</td><td>List of currencies supported by FixedFloat</td></tr><tr data-parent="data"><td><i class="table-deep-i"></i><i class="table-plus empty"></i>data[].code</td><td class="api-table-p-type">string</td><td>Unique currency code in FixedFloat</td></tr><tr data-parent="data"><td><i class="table-deep-i"></i><i class="table-plus empty"></i>data[].coin</td><td class="api-table-p-type">string</td><td>Common asset ticker</td></tr><tr data-parent="data"><td><i class="table-deep-i"></i><i class="table-plus empty"></i>data[].network</td><td class="api-table-p-type">string</td><td>Blockchain network in which this asset is represented</td></tr><tr data-parent="data"><td><i class="table-deep-i"></i><i class="table-plus empty"></i>data[].name</td><td class="api-table-p-type">string</td><td>Name of currency</td></tr><tr data-parent="data"><td><i class="table-deep-i"></i><i class="table-plus empty"></i>data[].recv</td><td class="api-table-p-type">boolean</td><td>Availability of currency for acceptance into the service from the client</td></tr><tr data-parent="data"><td><i class="table-deep-i"></i><i class="table-plus empty"></i>data[].send</td><td class="api-table-p-type">boolean</td><td>Availability of currency to send to the client</td></tr><tr data-parent="data"><td><i class="table-deep-i"></i><i class="table-plus empty"></i>data[].tag</td><td class="api-table-p-type">string</td><td>The name of the additional field, if available; otherwise null</td></tr><tr data-parent="data"><td><i class="table-deep-i"></i><i class="table-plus empty"></i>data[].logo</td><td class="api-table-p-type">string</td><td>Link to currency image</td></tr><tr data-parent="data"><td><i class="table-deep-i"></i><i class="table-plus empty"></i>data[].color</td><td class="api-table-p-type">string</td><td>Currency color specified in HEX format</td></tr><tr data-parent="data"><td><i class="table-deep-i end"></i><i class="table-plus empty"></i>data[].priority</td><td class="api-table-p-type">number</td><td>Priority in the list of currencies of the service</td></tr></tbody></table></div>
</div>
<div class="api-example"><div class="api-example-title"><span>Example JSON response</span></div>
<div class="api-example-code-wrapper">
<div class="api-example-code">
<code>
<pre><span class="api-code-punctuation">{</span></pre><pre> <span class="api-code-param">"code"</span><span class="api-code-punctuation">:</span> <span class="api-code-numeric">0</span>,</pre>
<pre> <span class="api-code-param">"msg"</span><span class="api-code-punctuation">:</span> <span class="api-code-string">""</span>,</pre>
<pre> <span class="api-code-param">"data"</span><span class="api-code-punctuation">:</span> <span class="api-code-punctuation">[</span></pre>
<pre> <span class="api-code-punctuation">{</span></pre>
<pre> <span class="api-code-param">"code"</span><span class="api-code-punctuation">:</span> <span class="api-code-string">"BTC"</span>,</pre>
<pre> <span class="api-code-param">"coin"</span><span class="api-code-punctuation">:</span> <span class="api-code-string">"BTC"</span>,</pre>
<pre> <span class="api-code-param">"network"</span><span class="api-code-punctuation">:</span> <span class="api-code-string">"BTC"</span>,</pre>
<pre> <span class="api-code-param">"name"</span><span class="api-code-punctuation">:</span> <span class="api-code-string">"Bitcoin"</span>,</pre>
<pre> <span class="api-code-param">"recv"</span><span class="api-code-punctuation">:</span> <span class="api-code-boolean">true</span>,</pre>
<pre> <span class="api-code-param">"send"</span><span class="api-code-punctuation">:</span> <span class="api-code-boolean">true</span>,</pre>
<pre> <span class="api-code-param">"tag"</span><span class="api-code-punctuation">:</span> <span class="api-code-null">null</span>,</pre>
<pre> <span class="api-code-param">"logo"</span><span class="api-code-punctuation">:</span> <span class="api-code-string">"https://fixedfloat.com/assets/images/coins/svg/btc.svg"</span>,</pre>
<pre> <span class="api-code-param">"color"</span><span class="api-code-punctuation">:</span> <span class="api-code-string">"#f7931a"</span>,</pre>
<pre> <span class="api-code-param">"priority"</span><span class="api-code-punctuation">:</span> <span class="api-code-string">"5"</span>,</pre>
<pre> <span class="api-code-punctuation">}</span><span class="api-code-punctuation">,</span></pre>
<pre> <span class="api-code-more">...</span>,</pre>
<pre> <span class="api-code-punctuation">]</span><span class="api-code-punctuation">,</span></pre>
<pre><span class="api-code-punctuation">}</span></pre> </code>
</div>
</div></div>
</section></section>
<section class="api-section" id="method_price" data-parent="api_methods"><section class="api-request-section">
<div class="api-description">
<h2>Exchange rate</h2>
<div class="api-url"><span class="api-url-method post">POST</span><span class="api-url-line"><span class="api-url-protocol">https://</span><span class="api-url-host">ff.io</span><span class="api-url-link">/api/v2/price</span></span></div>
<p>Getting the exchange rate of a pair of currencies in the selected direction and type of rate.</p>
<p><span class="api-p-alert">ATTENTION!</span> To get the exchange rates of all available currencies, you should use <a href="#method_xmlexport">the XML export file of rates</a></p>
<p>For this method, as well as for method <a class="api-p-req" href="#method_create">/api/v2/create</a>, it is possible to increase accrued earnings under the affiliate program using parameter <span class="api-p-param">afftax</span>.</p>
<p>The final exchange rate when passing parameters <span class="api-p-param">afftax</span> and <span class="api-p-param">refcode</span> depends on whether your affiliate program code has been approved for earning for orders generated by the API and the base percentage (<span class="api-p-var">AFFBASE</span>) set for your code, and will be calculated according to the formula:</p>
<code class="api-func">
<div class="api-func-line">total = <span class="api-mono"><span class="api-p-var">FF</span> - <span class="api-p-var">AFFB</span> + <span class="api-p-param">afftax</span></span><span class="api-where">, if afftax < FF - AFFB</span></div>
<div class="api-func-line">total = <span class="api-mono"><span class="api-p-param">afftax</span> x 2</span><span class="api-where"> , if FF - AFFB < afftax < FF</span></div>
<div class="api-func-line">total = <span class="api-mono"><span class="api-p-var">FF</span> + <span class="api-p-param">afftax</span></span><span class="api-where"> , if afftax > FF</span></div>
</code>
<p>where <span class="api-p-var">FF</span> is the base percentage of the service for the selected type of exchange rate (1% for a fixed rate and 0.5% for a floating rate);<br /><span class="api-p-var">AFFB</span> is the base percentage of the service profit set for your affiliate program code, for the selected type of exchange rate (<span class="api-p-var">AFFBASE</span> for a fixed rate and <span class="api-p-var">AFFBASE</span>÷2 for a floating rate)</p>
<p>For clarity, we suggest that you familiarize yourself with the table below with <span class="api-p-var">AFFBASE</span>=0.4, where <span class="api-p-var">FFP</span> = <span class="api-p-var">FF</span> - <span class="api-p-var">AFFB</span>:</p>
<table class="api-cnt-table">
<thead>
<tr>
<td colspan="3" class="center">FIXED RATE</td>
<td colspan="3" class="center border-l">FLOAT RATE</td>
</tr>
<tr>
<td>Total</td>
<td>FFP</td>
<td>afftax</td>
<td class="border-l">Total</td>
<td>FFP</td>
<td>afftax</td>
</tr>
</thead>
<tbody>
<tr class="api-cnt-table-d0">
<td>1.0</td>
<td>0.6</td>
<td>0.4</td>
<td class="border-l">0.5</td>
<td>0.3</td>
<td>0.2</td>
</tr>
<tr class="api-cnt-table-d0">
<td>1.1</td>
<td>0.6</td>
<td>0.5</td>
<td class="border-l">0.55</td>
<td>0.3</td>
<td>0.25</td>
</tr>
<tr class="api-cnt-table-d0">
<td>1.2</td>
<td>0.6</td>
<td>0.6</td>
<td class="border-l">0.6</td>
<td>0.3</td>
<td>0.3</td>
</tr>
<tr class="api-cnt-table-d1">
<td>1.4</td>
<td>0.7</td>
<td>0.7</td>
<td class="border-l">0.7</td>
<td>0.35</td>
<td>0.35</td>
</tr>
<tr class="api-cnt-table-d1">
<td>1.6</td>
<td>0.8</td>
<td>0.8</td>
<td class="border-l">0.8</td>
<td>0.4</td>
<td>0.4</td>
</tr>
<tr class="api-cnt-table-d1">
<td>1.8</td>
<td>0.9</td>
<td>0.9</td>
<td class="border-l">0.9</td>
<td>0.45</td>
<td>0.45</td>
</tr>
<tr class="api-cnt-table-d2">
<td>2.0</td>
<td>1.0</td>
<td>1.0</td>
<td class="border-l">1.0</td>
<td>0.5</td>
<td>0.5</td>
</tr>
<tr class="api-cnt-table-d2">
<td>2.1</td>
<td>1.0</td>
<td>1.1</td>
<td class="border-l">1.05</td>
<td>0.5</td>
<td>0.55</td>
</tr>
<tr class="api-cnt-table-d2">
<td>2.2</td>
<td>1.0</td>
<td>1.2</td>
<td class="border-l">1.1</td>
<td>0.5</td>
<td>0.6</td>
</tr>
</tbody>
</table>
<p>If your affiliate code did not have a base API earnings percentage set, then the final exchange rate will be calculated as:</p>
<code class="api-func">
<div class="api-func-line"><span class="api-mono"><span class="api-p-var">FF</span> + <span class="api-p-param">afftax</span></span></div>
</code>
<p>where <span class="api-p-var">FF</span> is the base percentage of the service for the selected type of exchange rate (1% for a fixed rate and 0.5% for a floating rate).</p>
<p>Earnings will be credited to your account if the affiliate program code was passed in the <span class="api-p-param">refcode</span> parameter and this code belongs to your account. Otherwise, the <span class="api-p-param">afftax</span> and <span class="api-p-param">refcode</span> parameters will be ignored.</p>
<h3>Parameters</h3>
<div class="api-table-wrap"><table class="api-request-table">
<thead>
<tr><td>Name</td><td>Required</td><td>Type</td><td>Description</td></tr>
</thead>
<tbody>
<tr><td>type</td><td><span class="api-table-p-req">true</span></td><td class="api-table-p-type">string</td><td>Order type</td></tr>
<tr><td>fromCcy</td><td><span class="api-table-p-req">true</span></td><td class="api-table-p-type">string</td><td>Code of the currency the client wants to send</td></tr>
<tr><td>toCcy</td><td><span class="api-table-p-req">true</span></td><td class="api-table-p-type">string</td><td>Code of the currency the client wants to receive</td></tr>
<tr><td>direction</td><td><span class="api-table-p-req">true</span></td><td class="api-table-p-type">string</td><td>
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:
<br>● <span class="api-param-ex">from</span> — if the client wants to send the amount <i>amount</i> in the currency <i>fromCcy</i>
<br>● <span class="api-param-ex">to</span> — if the client wants to receive the amount <i>amount</i> in the currency <i>toCcy</i>
</td></tr>
<tr><td>amount</td><td><span class="api-table-p-req">true</span></td><td class="api-table-p-type">numeric</td><td>If <i>direction</i>="from", then this is the amount in currency <i>fromCcy</i> that the client wants to send.<br>If <i>direction</i>="to", then this is the amount in currency <i>toCcy</i> that the client wants to receive</td></tr>
<tr><td>ccies</td><td><span class="api-table-p-req not">false</span></td><td class="api-table-p-type">boolean</td><td>Adding a list of currencies to the response with information about the availability for sending and receiving</td></tr>
<tr><td>usd</td><td><span class="api-table-p-req not">false</span></td><td class="api-table-p-type">boolean</td><td>Amount in USD, by which <i>fromAmount</i> or <i>toAmount</i> will be changed in case the limits are exceeded</td></tr>
<tr><td>refcode</td><td><span class="api-table-p-req not">false</span></td><td class="api-table-p-type">string</td><td>Affiliate program code for which earnings will be accrued under the affiliate program. If the <i>afftax</i> 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</td></tr>
<tr><td>afftax</td><td><span class="api-table-p-req not">false</span></td><td class="api-table-p-type">float</td><td>Desired 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 <i>refcode</i> parameter is also set.</td></tr>
</tbody>
</table></div>
</div>
<div class="api-example"><div class="api-example-title"><span>Example request</span></div>
<div class="api-example-tabs">
<label class="active" data-lang="curl">Curl</label>
<label data-lang="python">Python</label>
<label data-lang="php">PHP</label>
</div>
<div class="api-example-code-wrapper">
<div class="api-example-code active" data-lang="curl">
<code>
<pre><span class="api-code-curl-f">cURL</span> <span class="api-code-curl-h">-X</span> <span class="api-code-curl-x">POST</span> <span class="api-code-curl-n">\</span></pre>
<pre> <span class="api-code-curl-h">-H</span> <span class="api-code-curl-txt">"Accept: application/json"</span> <span class="api-code-curl-n">\</span></pre>
<pre> <span class="api-code-curl-h">-H</span> <span class="api-code-curl-txt">"X-API-KEY: <span class="api-code-curl-const">YOUR_API_KEY</span>"</span> <span class="api-code-curl-n">\</span></pre>
<pre> <span class="api-code-curl-h">-H</span> <span class="api-code-curl-txt">"X-API-SIGN: <span class="api-code-curl-const">GENERATED_SIGN</span>"</span> <span class="api-code-curl-n">\</span></pre>
<pre> <span class="api-code-curl-h">-H</span> <span class="api-code-curl-txt">"Content-Type: application/json; charset=UTF-8"</span> <span class="api-code-curl-n">\</span></pre>
<pre> <span class="api-code-curl-h">-d</span> <span class="api-code-curl-txt">'{"fromCcy":"BTC","toCcy":"USDTTRC","amount":0.5,direction":"from","type":"float"}'</span></pre>
<pre> <span class="api-code-curl-link">"https://ff.io/api/v2/price"</span> <span class="api-code-curl-h">-L</span></pre>
</code>
</div>
<div class="api-example-code" data-lang="python"></div>
<div class="api-example-code" data-lang="php">
<code>
<pre><span class="api-code-php-p"><?php</span></pre>
<pre> <span class="api-code-php-u">require_once</span>(<span class="api-code-php-txt">'fixedfloat.php'</span>);</pre>
<pre> </pre>
<pre> <span class="api-code-php-svar">$</span>ff = <span class="api-code-php-new">new</span> <span class="api-code-php-f">FixedFloatApi</span>(<span class="api-code-php-const">YOUR_API_KEY</span>, <span class="api-code-php-const">YOUR_API_SECRET</span>);</pre>
<pre> </pre>
<pre> <span class="api-code-php-svar">$</span>data = <span class="api-code-php-array">array</span>(</pre>
<pre> <span class="api-code-php-txt">'fromCcy'</span> => <span class="api-code-php-txt">'BTC'</span>,</pre>
<pre> <span class="api-code-php-txt">'toCcy'</span> => <span class="api-code-php-txt">'USDTTRC'</span>,</pre>
<pre> <span class="api-code-php-txt">'amount'</span> => <span class="api-code-php-txt">'0.5'</span>,</pre>
<pre> <span class="api-code-php-txt">'direction'</span> => <span class="api-code-php-txt">'from'</span>,</pre>
<pre> <span class="api-code-php-txt">'type'</span> => <span class="api-code-php-txt">'float'</span>,</pre>
<pre> );</pre>
<pre> </pre>
<pre> <span class="api-code-php-f">return</span> <span class="api-code-php-svar">$</span>ff-><span class="api-code-php-u">price</span>(<span class="api-code-php-svar">$</span>data);</pre>
<pre><span class="api-code-php-p">?></span></pre>
</code>
</div>
</div></div>
</section>
<section class="api-response-section">
<div class="api-description">
<h3>Response</h3>
<p>A successful response contains information about the currencies of the selected pair, the exchange rate, and the amount sent and received.</p>
<div class="api-table-wrap"><table class="api-response-table"><thead><tr><td>Field</td><td>Type</td><td>Description</td></tr></thead><tbody><tr><td><i class="table-plus empty"></i>code</td><td class="api-table-p-type">number</td><td>Response status code. If the request is successful, then the status code is "0", otherwise it is an error</td></tr><tr><td><i class="table-plus empty"></i>msg</td><td class="api-table-p-type">string</td><td>Status message</td></tr><tr data-name="data"><td><i class="table-plus"></i>data</td><td class="api-table-p-type">Object</td><td>An object with information about the currencies of the selected pair, the exchange rate, and the amount sent and received</td></tr><tr data-name="data.from" data-parent="data"><td><i class="table-deep-i"></i><i class="table-plus"></i>data.from</td><td class="api-table-p-type">Object</td><td>Data about the asset that the client must send</td></tr><tr data-parent="data data.from"><td><i class="table-deep-i nd"></i><i class="table-deep-i"></i><i class="table-plus empty"></i>data.from.code</td><td class="api-table-p-type">string</td><td>Unique currency code in FixedFloat</td></tr><tr data-parent="data data.from"><td><i class="table-deep-i nd"></i><i class="table-deep-i"></i><i class="table-plus empty"></i>data.from.network</td><td class="api-table-p-type">string</td><td>Blockchain network in which this asset is represented</td></tr><tr data-parent="data data.from"><td><i class="table-deep-i nd"></i><i class="table-deep-i"></i><i class="table-plus empty"></i>data.from.coin</td><td class="api-table-p-type">string</td><td>Common asset ticker</td></tr><tr data-parent="data data.from"><td><i class="table-deep-i nd"></i><i class="table-deep-i"></i><i class="table-plus empty"></i>data.from.amount</td><td class="api-table-p-type">string</td><td>Amount that the client needs to send</td></tr><tr data-parent="data data.from"><td><i class="table-deep-i nd"></i><i class="table-deep-i"></i><i class="table-plus empty"></i>data.from.rate</td><td class="api-table-p-type">string</td><td>Final exchange rate</td></tr><tr data-parent="data data.from"><td><i class="table-deep-i nd"></i><i class="table-deep-i"></i><i class="table-plus empty"></i>data.from.precision</td><td class="api-table-p-type">integer</td><td>Rounding accuracy</td></tr><tr data-parent="data data.from"><td><i class="table-deep-i nd"></i><i class="table-deep-i"></i><i class="table-plus empty"></i>data.from.min</td><td class="api-table-p-type">string</td><td>Minimum amount</td></tr><tr data-parent="data data.from"><td><i class="table-deep-i nd"></i><i class="table-deep-i"></i><i class="table-plus empty"></i>data.from.max</td><td class="api-table-p-type">string</td><td>Maximum amount</td></tr><tr data-parent="data data.from"><td><i class="table-deep-i nd"></i><i class="table-deep-i"></i><i class="table-plus empty"></i>data.from.usd</td><td class="api-table-p-type">string</td><td>Equivalent in USD</td></tr><tr data-parent="data data.from"><td><i class="table-deep-i nd"></i><i class="table-deep-i end"></i><i class="table-plus empty"></i>data.from.btc</td><td class="api-table-p-type">string</td><td>Equivalent in BTC</td></tr><tr data-name="data.to" data-parent="data"><td><i class="table-deep-i"></i><i class="table-plus"></i>data.to</td><td class="api-table-p-type">Object</td><td>Data about the asset that the client will receive</td></tr><tr data-parent="data data.to"><td><i class="table-deep-i nd"></i><i class="table-deep-i"></i><i class="table-plus empty"></i>data.to.code</td><td class="api-table-p-type">string</td><td>Unique currency code in FixedFloat</td></tr><tr data-parent="data data.to"><td><i class="table-deep-i nd"></i><i class="table-deep-i"></i><i class="table-plus empty"></i>data.to.network</td><td class="api-table-p-type">string</td><td>Blockchain network in which this asset is represented</td></tr><tr data-parent="data data.to"><td><i class="table-deep-i nd"></i><i class="table-deep-i"></i><i class="table-plus empty"></i>data.to.coin</td><td class="api-table-p-type">string</td><td>Common asset ticker</td></tr><tr data-parent="data data.to"><td><i class="table-deep-i nd"></i><i class="table-deep-i"></i><i class="table-plus empty"></i>data.to.amount</td><td class="api-table-p-type">string</td><td>Amount that the client must to receive</td></tr><tr data-parent="data data.to"><td><i class="table-deep-i nd"></i><i class="table-deep-i"></i><i class="table-plus empty"></i>data.to.rate</td><td class="api-table-p-type">string</td><td>Final exchange rate</td></tr><tr data-parent="data data.to"><td><i class="table-deep-i nd"></i><i class="table-deep-i"></i><i class="table-plus empty"></i>data.to.precision</td><td class="api-table-p-type">integer</td><td>Rounding accuracy</td></tr><tr data-parent="data data.to"><td><i class="table-deep-i nd"></i><i class="table-deep-i"></i><i class="table-plus empty"></i>data.to.min</td><td class="api-table-p-type">string</td><td>Minimum amount</td></tr><tr data-parent="data data.to"><td><i class="table-deep-i nd"></i><i class="table-deep-i"></i><i class="table-plus empty"></i>data.to.max</td><td class="api-table-p-type">string</td><td>Maximum amount</td></tr><tr data-parent="data data.to"><td><i class="table-deep-i nd"></i><i class="table-deep-i end"></i><i class="table-plus empty"></i>data.to.usd</td><td class="api-table-p-type">string</td><td>Equivalent in USD</td></tr><tr data-parent="data"><td><i class="table-deep-i"></i><i class="table-plus empty"></i>data.errors</td><td class="api-table-p-type">Array</td><td>An array of a list of errors. If the array is empty, then creating an order with these parameters is possible.
<br>The array may contain the following errors:
<br>● <span class="api-param-ex">MAINTENANCE_FROM</span> — Currency from <i>data.from</i> object under maintenance
<br>● <span class="api-param-ex">MAINTENANCE_TO</span> — Currency from object <i>data.to</i> under maintenance
<br>● <span class="api-param-ex">OFFLINE_FROM</span> — Currency from object <i>data.from</i> is not available
<br>● <span class="api-param-ex">OFFLINE_TO</span> — Currency from object <i>data.to</i> is not available
<br>● <span class="api-param-ex">RESERVE_FROM</span> — Not enough currency reserves from object <i>data.from</i>
<br>● <span class="api-param-ex">RESERVE_TO</span> — Not enough currency reserves from object <i>data.to</i>
<br>● <span class="api-param-ex">LIMIT_MIN</span> — Amount less than limit
<br>● <span class="api-param-ex">LIMIT_MAX</span> — The amount is greater than the limit</td></tr><tr data-name="data.ccies" data-parent="data"><td><i class="table-deep-i end"></i><i class="table-plus"></i>data.ccies</td><td class="api-table-p-type">Array</td><td>Added if the <i>ccies</i> parameter is <i>true</i>. An array containing a list of objects with information about the availability for sending and receiving currencies</td></tr><tr data-parent="data data.ccies"><td><i class="table-deep-i no"></i><i class="table-deep-i"></i><i class="table-plus empty"></i>data.ccies[].code</td><td class="api-table-p-type">string</td><td>Unique currency code in FixedFloat</td></tr><tr data-parent="data data.ccies"><td><i class="table-deep-i no"></i><i class="table-deep-i"></i><i class="table-plus empty"></i>data.ccies[].recv</td><td class="api-table-p-type">boolean</td><td>Availability of currency for acceptance into the service from the client</td></tr><tr data-parent="data data.ccies"><td><i class="table-deep-i no"></i><i class="table-deep-i end"></i><i class="table-plus empty"></i>data.ccies[].send</td><td class="api-table-p-type">boolean</td><td>Availability of currency to send to the client</td></tr></tbody></table></div>
</div>
<div class="api-example"><div class="api-example-title"><span>Example JSON response</span></div>
<div class="api-example-code-wrapper">
<div class="api-example-code">
<code>
<pre><span class="api-code-punctuation">{</span></pre><pre> <span class="api-code-param">"code"</span><span class="api-code-punctuation">:</span> <span class="api-code-numeric">0</span>,</pre>
<pre> <span class="api-code-param">"msg"</span><span class="api-code-punctuation">:</span> <span class="api-code-string">""</span>,</pre>
<pre> <span class="api-code-param">"data"</span><span class="api-code-punctuation">:</span> <span class="api-code-punctuation">{</span></pre>
<pre> <span class="api-code-param">"from"</span><span class="api-code-punctuation">:</span> <span class="api-code-punctuation">{</span></pre>
<pre> <span class="api-code-param">"code"</span><span class="api-code-punctuation">:</span> <span class="api-code-string">"BSC"</span>,</pre>
<pre> <span class="api-code-param">"network"</span><span class="api-code-punctuation">:</span> <span class="api-code-string">"BSC"</span>,</pre>
<pre> <span class="api-code-param">"coin"</span><span class="api-code-punctuation">:</span> <span class="api-code-string">"BNB"</span>,</pre>
<pre> <span class="api-code-param">"amount"</span><span class="api-code-punctuation">:</span> <span class="api-code-string">"0.040297"</span>,</pre>
<pre> <span class="api-code-param">"rate"</span><span class="api-code-punctuation">:</span> <span class="api-code-string">"0.01452202"</span>,</pre>
<pre> <span class="api-code-param">"precision"</span><span class="api-code-punctuation">:</span> <span class="api-code-numeric">8</span>,</pre>
<pre> <span class="api-code-param">"min"</span><span class="api-code-punctuation">:</span> <span class="api-code-string">"0.005053"</span>,</pre>
<pre> <span class="api-code-param">"max"</span><span class="api-code-punctuation">:</span> <span class="api-code-string">"967.072057"</span>,</pre>
<pre> <span class="api-code-param">"usd"</span><span class="api-code-punctuation">:</span> <span class="api-code-string">"12.28"</span>,</pre>
<pre> <span class="api-code-param">"btc"</span><span class="api-code-punctuation">:</span> <span class="api-code-string">"0.00058813"</span>,</pre>
<pre> <span class="api-code-punctuation">}</span><span class="api-code-punctuation">,</span></pre>
<pre> <span class="api-code-param">"to"</span><span class="api-code-punctuation">:</span> <span class="api-code-punctuation">{</span></pre>
<pre> <span class="api-code-param">"code"</span><span class="api-code-punctuation">:</span> <span class="api-code-string">"BTC"</span>,</pre>
<pre> <span class="api-code-param">"network"</span><span class="api-code-punctuation">:</span> <span class="api-code-string">"BTC"</span>,</pre>
<pre> <span class="api-code-param">"coin"</span><span class="api-code-punctuation">:</span> <span class="api-code-string">"BTC"</span>,</pre>
<pre> <span class="api-code-param">"amount"</span><span class="api-code-punctuation">:</span> <span class="api-code-string">"0.00055984"</span>,</pre>
<pre> <span class="api-code-param">"rate"</span><span class="api-code-punctuation">:</span> <span class="api-code-string">"68.164781"</span>,</pre>
<pre> <span class="api-code-param">"precision"</span><span class="api-code-punctuation">:</span> <span class="api-code-numeric">8</span>,</pre>
<pre> <span class="api-code-param">"min"</span><span class="api-code-punctuation">:</span> <span class="api-code-string">"0.0000479"</span>,</pre>
<pre> <span class="api-code-param">"max"</span><span class="api-code-punctuation">:</span> <span class="api-code-string">"14.04381911"</span>,</pre>
<pre> <span class="api-code-param">"usd"</span><span class="api-code-punctuation">:</span> <span class="api-code-string">"11.69"</span>,</pre>
<pre> <span class="api-code-punctuation">}</span><span class="api-code-punctuation">,</span></pre>
<pre> <span class="api-code-param">"errors"</span><span class="api-code-punctuation">:</span> <span class="api-code-punctuation">[</span><span class="api-code-punctuation">]</span><span class="api-code-punctuation">,</span></pre>
<pre> <span class="api-code-param">"ccies"</span><span class="api-code-punctuation">:</span> <span class="api-code-punctuation">[</span></pre>
<pre> <span class="api-code-punctuation">{</span></pre>
<pre> <span class="api-code-param">"code"</span><span class="api-code-punctuation">:</span> <span class="api-code-string">"ADA"</span>,</pre>
<pre> <span class="api-code-param">"recv"</span><span class="api-code-punctuation">:</span> <span class="api-code-boolean">true</span>,</pre>
<pre> <span class="api-code-param">"send"</span><span class="api-code-punctuation">:</span> <span class="api-code-boolean">true</span>,</pre>
<pre> <span class="api-code-punctuation">}</span><span class="api-code-punctuation">,</span></pre>
<pre> <span class="api-code-more">...</span>,</pre>
<pre> <span class="api-code-punctuation">]</span><span class="api-code-punctuation">,</span></pre>
<pre> <span class="api-code-punctuation">}</span><span class="api-code-punctuation">,</span></pre>
<pre><span class="api-code-punctuation">}</span></pre> </code>
</div>
</div></div>
</section></section>
<section class="api-section" id="method_create" data-parent="api_methods"><section class="api-request-section"><div class="api-description">
<h2>Create order</h2>
<div class="api-url"><span class="api-url-method post">POST</span><span class="api-url-line"><span class="api-url-protocol">https://</span><span class="api-url-host">ff.io</span><span class="api-url-link">/api/v2/create</span></span></div>
<p>Creating an order for the exchange of selected currencies with a specified amount and address.</p>
<p>For this method, as well as for the <a class="api-p-req" href="#method_price">/api/v2/price</a> method, it is possible to increase accrued earnings under the affiliate program using the parameter <span class="api-p-param">afftax</span>. The rules for using this parameter are described in method <a class="api-p-req" href="#method_price">/api/v2/price</a></p>
<h3>Parameters</h3>
<div class="api-table-wrap"><table class="api-request-table">
<thead>
<tr><td>Name</td><td>Required</td><td>Type</td><td>Description</td></tr>
</thead>
<tbody>
<tr><td>type</td><td><span class="api-table-p-req">true</span></td><td class="api-table-p-type">string</td><td>Order type</td></tr>
<tr><td>fromCcy</td><td><span class="api-table-p-req">true</span></td><td class="api-table-p-type">string</td><td>Code of the currency the client wants to send</td></tr>
<tr><td>toCcy</td><td><span class="api-table-p-req">true</span></td><td class="api-table-p-type">string</td><td>Code of the currency the client wants to receive</td></tr>
<tr><td>direction</td><td><span class="api-table-p-req">true</span></td><td class="api-table-p-type">string</td><td>
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:
<br>● <span class="api-param-ex">from</span> — if the client wants to send the amount <i>amount</i> in the currency <i>fromCcy</i>
<br>● <span class="api-param-ex">to</span> — if the client wants to receive the amount <i>amount</i> in the currency <i>toCcy</i>
</td></tr>
<tr><td>amount</td><td><span class="api-table-p-req">true</span></td><td class="api-table-p-type">numeric</td><td>If <i>direction</i>="from", then this is the amount in currency <i>fromCcy</i> that the client wants to send.<br>If <i>direction</i>="to", then this is the amount in currency <i>toCcy</i> that the client wants to receive</td></tr>
<tr><td>toAddress</td><td><span class="api-table-p-req">true</span></td><td class="api-table-p-type">string</td><td>Destination address to which the funds will be dispatched upon the successful completion of the Order</td></tr>
<tr><td>tag</td><td><span class="api-table-p-req not">false</span></td><td class="api-table-p-type">boolean</td><td>If 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.</td></tr>
<tr><td>refcode</td><td><span class="api-table-p-req not">false</span></td><td class="api-table-p-type">string</td><td>Affiliate program code for which earnings will be accrued under the affiliate program. If the <i>afftax</i> 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</td></tr>
<tr><td>afftax</td><td><span class="api-table-p-req not">false</span></td><td class="api-table-p-type">float</td><td>Desired 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 <i>refcode</i> parameter is also set.</td></tr>
</tbody>
</table></div>
</div>
<div class="api-example"><div class="api-example-title"><span>Example request</span></div>
<div class="api-example-tabs">
<label class="active" data-lang="curl">Curl</label>
<label data-lang="python">Python</label>
<label data-lang="php">PHP</label>
</div>
<div class="api-example-code-wrapper">
<div class="api-example-code active" data-lang="curl">
<code>
<pre><span class="api-code-curl-f">cURL</span> <span class="api-code-curl-h">-X</span> <span class="api-code-curl-x">POST</span> <span class="api-code-curl-n">\</span></pre>
<pre> <span class="api-code-curl-h">-H</span> <span class="api-code-curl-txt">"Accept: application/json"</span> <span class="api-code-curl-n">\</span></pre>
<pre> <span class="api-code-curl-h">-H</span> <span class="api-code-curl-txt">"X-API-KEY: <span class="api-code-curl-const">YOUR_API_KEY</span>"</span> <span class="api-code-curl-n">\</span></pre>
<pre> <span class="api-code-curl-h">-H</span> <span class="api-code-curl-txt">"X-API-SIGN: <span class="api-code-curl-const">GENERATED_SIGN</span>"</span> <span class="api-code-curl-n">\</span></pre>
<pre> <span class="api-code-curl-h">-H</span> <span class="api-code-curl-txt">"Content-Type: application/json; charset=UTF-8"</span> <span class="api-code-curl-n">\</span></pre>
<pre> <span class="api-code-curl-h">-d</span> <span class="api-code-curl-txt">'{"fromCcy":"BTC","toCcy":"USDTTRC","amount":0.5,direction":"from","type":"float","toAddress":"TAzsQ9Gx8eqFNFSKbeXrbi45CuVPHzA8wr"}'</span></pre>
<pre> <span class="api-code-curl-link">"https://ff.io/api/v2/create"</span> <span class="api-code-curl-h">-L</span></pre>
</code>
</div>
<div class="api-example-code" data-lang="python"></div>
<div class="api-example-code" data-lang="php">
<code>
<pre><span class="api-code-php-p"><?php</span></pre>
<pre> <span class="api-code-php-u">require_once</span>(<span class="api-code-php-txt">'fixedfloat.php'</span>);</pre>
<pre> </pre>
<pre> <span class="api-code-php-svar">$</span>ff = <span class="api-code-php-new">new</span> <span class="api-code-php-f">FixedFloatApi</span>(<span class="api-code-php-const">YOUR_API_KEY</span>, <span class="api-code-php-const">YOUR_API_SECRET</span>);</pre>
<pre> </pre>
<pre> <span class="api-code-php-svar">$</span>data = <span class="api-code-php-array">array</span>(</pre>
<pre> <span class="api-code-php-txt">'fromCcy'</span> => <span class="api-code-php-txt">'BTC'</span>,</pre>
<pre> <span class="api-code-php-txt">'toCcy'</span> => <span class="api-code-php-txt">'USDTTRC'</span>,</pre>
<pre> <span class="api-code-php-txt">'amount'</span> => <span class="api-code-php-txt">'0.5'</span>,</pre>
<pre> <span class="api-code-php-txt">'direction'</span> => <span class="api-code-php-txt">'from'</span>,</pre>
<pre> <span class="api-code-php-txt">'type'</span> => <span class="api-code-php-txt">'float'</span>,</pre>
<pre> <span class="api-code-php-txt">'toAddress'</span> => <span class="api-code-php-txt">'TAzsQ9Gx8eqFNFSKbeXrbi45CuVPHzA8wr'</span></pre>
<pre> );</pre>
<pre> </pre>
<pre> <span class="api-code-php-f">return</span> <span class="api-code-php-svar">$</span>ff-><span class="api-code-php-u">create</span>(<span class="api-code-php-svar">$</span>data);</pre>
<pre><span class="api-code-php-p">?></span></pre>
</code>
</div>
</div></div>
</section><section class="api-response-section"><div class="api-description">
<h3>Response</h3>
<p>A successful response contains an object with information about all the data of the created order, including the <span class="api-p-param">token</span> parameter, for later obtaining updated information about the order using the <a class="api-p-req" href="#method_price">/api/v2/</a> method order, and order management.</p>
<div class="api-table-wrap"><table class="api-response-table"><thead><tr><td>Field</td><td>Type</td><td>Description</td></tr></thead><tbody><tr><td><i class="table-plus empty"></i>code</td><td class="api-table-p-type">number</td><td>Response status code. If the request is successful, then the status code is "0", otherwise it is an error</td></tr><tr><td><i class="table-plus empty"></i>msg</td><td class="api-table-p-type">string</td><td>Status message</td></tr><tr data-name="data"><td><i class="table-plus"></i>data</td><td class="api-table-p-type">Object</td><td>Object with information about all the data of the created order</td></tr><tr data-parent="data"><td><i class="table-deep-i"></i><i class="table-plus empty"></i>data.token</td><td class="api-table-p-type">string</td><td>Order access token</td></tr><tr data-parent="data"><td><i class="table-deep-i"></i><i class="table-plus empty"></i>data.id</td><td class="api-table-p-type">string</td><td>Order ID. Consists of 6 characters</td></tr><tr data-parent="data"><td><i class="table-deep-i"></i><i class="table-plus empty"></i>data.type</td><td class="api-table-p-type">string</td><td>Order type. Can be one of the values:
<br>● <span class="api-param-ex">fixed</span> — fixed rate order
<br>● <span class="api-param-ex">float</span> — floating rate order</td></tr><tr data-parent="data"><td><i class="table-deep-i"></i><i class="table-plus empty"></i>data.email</td><td class="api-table-p-type">string</td><td>Email address for the order to receive notifications about changes in the order</td></tr><tr data-parent="data"><td><i class="table-deep-i"></i><i class="table-plus empty"></i>data.status</td><td class="api-table-p-type">string</td><td>Order status. Can be one of the values:
<br>● <span class="api-param-ex">NEW</span> — New order
<br>● <span class="api-param-ex">PENDING</span> — Transaction received, pending confirmation
<br>● <span class="api-param-ex">EXCHANGE</span> — Transaction confirmed, exchange in progress
<br>● <span class="api-param-ex">WITHDRAW</span> — Sending funds
<br>● <span class="api-param-ex">DONE</span> — Order completed
<br>● <span class="api-param-ex">EXPIRED</span> — Order expired
<br>● <span class="api-param-ex">EMERGENCY</span> — Emergency, customer choice required</td></tr><tr data-name="data.time" data-parent="data"><td><i class="table-deep-i"></i><i class="table-plus"></i>data.time</td><td class="api-table-p-type">Object</td><td>Object containing timestamp data</td></tr><tr data-parent="data data.time"><td><i class="table-deep-i nd"></i><i class="table-deep-i"></i><i class="table-plus empty"></i>data.time.reg</td><td class="api-table-p-type">number</td><td>Order creation timestamp</td></tr><tr data-parent="data data.time"><td><i class="table-deep-i nd"></i><i class="table-deep-i"></i><i class="table-plus empty"></i>data.time.start</td><td class="api-table-p-type">number</td><td>Transaction receive timestamp</td></tr><tr data-parent="data data.time"><td><i class="table-deep-i nd"></i><i class="table-deep-i"></i><i class="table-plus empty"></i>data.time.finish</td><td class="api-table-p-type">number</td><td>Timestamp when the order was completed</td></tr><tr data-parent="data data.time"><td><i class="table-deep-i nd"></i><i class="table-deep-i"></i><i class="table-plus empty"></i>data.time.update</td><td class="api-table-p-type">number</td><td>Timestamp of last order update</td></tr><tr data-parent="data data.time"><td><i class="table-deep-i nd"></i><i class="table-deep-i"></i><i class="table-plus empty"></i>data.time.expiration</td><td class="api-table-p-type">number</td><td>Timestamp when order expires</td></tr><tr data-parent="data data.time"><td><i class="table-deep-i nd"></i><i class="table-deep-i end"></i><i class="table-plus empty"></i>data.time.left</td><td class="api-table-p-type">number</td><td>The number of seconds before the end of the order</td></tr><tr data-name="data.from" data-parent="data"><td><i class="table-deep-i"></i><i class="table-plus"></i>data.from</td><td class="api-table-p-type">Object</td><td>An object containing information about the currency sent by clients and transactions</td></tr><tr data-parent="data data.from"><td><i class="table-deep-i nd"></i><i class="table-deep-i"></i><i class="table-plus empty"></i>data.from.code</td><td class="api-table-p-type">string</td><td>Currency code</td></tr><tr data-parent="data data.from"><td><i class="table-deep-i nd"></i><i class="table-deep-i"></i><i class="table-plus empty"></i>data.from.coin</td><td class="api-table-p-type">string</td><td>Common asset ticker</td></tr><tr data-parent="data data.from"><td><i class="table-deep-i nd"></i><i class="table-deep-i"></i><i class="table-plus empty"></i>data.from.network</td><td class="api-table-p-type">string</td><td>Blockchain network in which this asset is represented</td></tr><tr data-parent="data data.from"><td><i class="table-deep-i nd"></i><i class="table-deep-i"></i><i class="table-plus empty"></i>data.from.name</td><td class="api-table-p-type">string</td><td>Name of currency</td></tr><tr data-parent="data data.from"><td><i class="table-deep-i nd"></i><i class="table-deep-i"></i><i class="table-plus empty"></i>data.from.alias</td><td class="api-table-p-type">string</td><td>Alias for creating qr code</td></tr><tr data-parent="data data.from"><td><i class="table-deep-i nd"></i><i class="table-deep-i"></i><i class="table-plus empty"></i>data.from.amount</td><td class="api-table-p-type">string</td><td>Amount that the client needs to send</td></tr><tr data-parent="data data.from"><td><i class="table-deep-i nd"></i><i class="table-deep-i"></i><i class="table-plus empty"></i>data.from.address</td><td class="api-table-p-type">string</td><td>The destination address to which the user is ought to deposit his funds in order for the trade to execute</td></tr><tr data-parent="data data.from"><td><i class="table-deep-i nd"></i><i class="table-deep-i"></i><i class="table-plus empty"></i>data.from.tag</td><td class="api-table-p-type">string</td><td>MEMO or Destination Tag if required</td></tr><tr data-parent="data data.from"><td><i class="table-deep-i nd"></i><i class="table-deep-i"></i><i class="table-plus empty"></i>data.from.addressMix</td><td class="api-table-p-type">string</td><td>Address with a colon-connected tag</td></tr><tr data-parent="data data.from"><td><i class="table-deep-i nd"></i><i class="table-deep-i"></i><i class="table-plus empty"></i>data.from.reqConfirmations</td><td class="api-table-p-type">number</td><td>Required number of transaction confirmations</td></tr><tr data-parent="data data.from"><td><i class="table-deep-i nd"></i><i class="table-deep-i"></i><i class="table-plus empty"></i>data.from.maxConfirmations</td><td class="api-table-p-type">number</td><td>The maximum number of transaction confirmations that system updates</td></tr><tr data-name="data.from.tx" data-parent="data data.from"><td><i class="table-deep-i nd"></i><i class="table-deep-i end"></i><i class="table-plus"></i>data.from.tx</td><td class="api-table-p-type">Object</td><td>An object containing data about the received transaction</td></tr><tr data-parent="data data.from data.from.tx"><td><i class="table-deep-i nd"></i><i class="table-deep-i no"></i><i class="table-deep-i"></i><i class="table-plus empty"></i>data.from.tx.id</td><td class="api-table-p-type">string</td><td>Transaction hash</td></tr><tr data-parent="data data.from data.from.tx"><td><i class="table-deep-i nd"></i><i class="table-deep-i no"></i><i class="table-deep-i"></i><i class="table-plus empty"></i>data.from.tx.amount</td><td class="api-table-p-type">string</td><td>Transaction amount</td></tr><tr data-parent="data data.from data.from.tx"><td><i class="table-deep-i nd"></i><i class="table-deep-i no"></i><i class="table-deep-i"></i><i class="table-plus empty"></i>data.from.tx.fee</td><td class="api-table-p-type">string</td><td>Miner fee</td></tr><tr data-parent="data data.from data.from.tx"><td><i class="table-deep-i nd"></i><i class="table-deep-i no"></i><i class="table-deep-i"></i><i class="table-plus empty"></i>data.from.tx.ccyfee</td><td class="api-table-p-type">string</td><td>Currency of Miner fee</td></tr><tr data-parent="data data.from data.from.tx"><td><i class="table-deep-i nd"></i><i class="table-deep-i no"></i><i class="table-deep-i"></i><i class="table-plus empty"></i>data.from.tx.timeReg</td><td class="api-table-p-type">number</td><td>Transaction registration timestamp</td></tr><tr data-parent="data data.from data.from.tx"><td><i class="table-deep-i nd"></i><i class="table-deep-i no"></i><i class="table-deep-i"></i><i class="table-plus empty"></i>data.from.tx.timeBlock</td><td class="api-table-p-type">number</td><td>Timestamp for adding a transaction to a block</td></tr><tr data-parent="data data.from data.from.tx"><td><i class="table-deep-i nd"></i><i class="table-deep-i no"></i><i class="table-deep-i end"></i><i class="table-plus empty"></i>data.from.tx.confirmations</td><td class="api-table-p-type">number</td><td>Number of transaction confirmations</td></tr><tr data-name="data.to" data-parent="data"><td><i class="table-deep-i"></i><i class="table-plus"></i>data.to</td><td class="api-table-p-type">Object</td><td>An object containing information about the currency received by the client and the transaction</td></tr><tr data-parent="data data.to"><td><i class="table-deep-i nd"></i><i class="table-deep-i"></i><i class="table-plus empty"></i>data.to.code</td><td class="api-table-p-type">string</td><td>Currency code</td></tr><tr data-parent="data data.to"><td><i class="table-deep-i nd"></i><i class="table-deep-i"></i><i class="table-plus empty"></i>data.to.coin</td><td class="api-table-p-type">string</td><td>Common asset ticker</td></tr><tr data-parent="data data.to"><td><i class="table-deep-i nd"></i><i class="table-deep-i"></i><i class="table-plus empty"></i>data.to.network</td><td class="api-table-p-type">string</td><td>Blockchain network in which this asset is represented</td></tr><tr data-parent="data data.to"><td><i class="table-deep-i nd"></i><i class="table-deep-i"></i><i class="table-plus empty"></i>data.to.name</td><td class="api-table-p-type">string</td><td>Name of currency</td></tr><tr data-parent="data data.to"><td><i class="table-deep-i nd"></i><i class="table-deep-i"></i><i class="table-plus empty"></i>data.to.alias</td><td class="api-table-p-type">string</td><td>Alias for creating qr code</td></tr><tr data-parent="data data.to"><td><i class="table-deep-i nd"></i><i class="table-deep-i"></i><i class="table-plus empty"></i>data.to.amount</td><td class="api-table-p-type">string</td><td>Amount that the client must to receive</td></tr><tr data-parent="data data.to"><td><i class="table-deep-i nd"></i><i class="table-deep-i"></i><i class="table-plus empty"></i>data.to.address</td><td class="api-table-p-type">string</td><td>The destination address to which the funds will be dispatched upon the successful completion of the order</td></tr><tr data-parent="data data.to"><td><i class="table-deep-i nd"></i><i class="table-deep-i"></i><i class="table-plus empty"></i>data.to.tag</td><td class="api-table-p-type">string</td><td>MEMO or Destination Tag if required</td></tr><tr data-parent="data data.to"><td><i class="table-deep-i nd"></i><i class="table-deep-i"></i><i class="table-plus empty"></i>data.to.addressMix</td><td class="api-table-p-type">string</td><td>Address with a colon-connected tag</td></tr><tr data-name="data.to.tx" data-parent="data data.to"><td><i class="table-deep-i nd"></i><i class="table-deep-i end"></i><i class="table-plus"></i>data.to.tx</td><td class="api-table-p-type">Object</td><td>An object containing data about the sent transaction</td></tr><tr data-parent="data data.to data.to.tx"><td><i class="table-deep-i nd"></i><i class="table-deep-i no"></i><i class="table-deep-i"></i><i class="table-plus empty"></i>data.to.tx.id</td><td class="api-table-p-type">string</td><td>Transaction hash</td></tr><tr data-parent="data data.to data.to.tx"><td><i class="table-deep-i nd"></i><i class="table-deep-i no"></i><i class="table-deep-i"></i><i class="table-plus empty"></i>data.to.tx.amount</td><td class="api-table-p-type">string</td><td>Transaction amount</td></tr><tr data-parent="data data.to data.to.tx"><td><i class="table-deep-i nd"></i><i class="table-deep-i no"></i><i class="table-deep-i"></i><i class="table-plus empty"></i>data.to.tx.fee</td><td class="api-table-p-type">string</td><td>Miner fee</td></tr><tr data-parent="data data.to data.to.tx"><td><i class="table-deep-i nd"></i><i class="table-deep-i no"></i><i class="table-deep-i"></i><i class="table-plus empty"></i>data.to.tx.ccyfee</td><td class="api-table-p-type">string</td><td>Currency of Miner fee</td></tr><tr data-parent="data data.to data.to.tx"><td><i class="table-deep-i nd"></i><i class="table-deep-i no"></i><i class="table-deep-i"></i><i class="table-plus empty"></i>data.to.tx.timeReg</td><td class="api-table-p-type">number</td><td>Transaction registration timestamp</td></tr><tr data-parent="data data.to data.to.tx"><td><i class="table-deep-i nd"></i><i class="table-deep-i no"></i><i class="table-deep-i"></i><i class="table-plus empty"></i>data.to.tx.timeBlock</td><td class="api-table-p-type">number</td><td>Timestamp for adding a transaction to a block</td></tr><tr data-parent="data data.to data.to.tx"><td><i class="table-deep-i nd"></i><i class="table-deep-i no"></i><i class="table-deep-i end"></i><i class="table-plus empty"></i>data.to.tx.confirmations</td><td class="api-table-p-type">number</td><td>Number of transaction confirmations</td></tr><tr data-name="data.back" data-parent="data"><td><i class="table-deep-i"></i><i class="table-plus"></i>data.back</td><td class="api-table-p-type">Object</td><td>An object containing information about the currency returned to the client and the transaction</td></tr><tr data-parent="data data.back"><td><i class="table-deep-i nd"></i><i class="table-deep-i"></i><i class="table-plus empty"></i>data.back.code</td><td class="api-table-p-type">string</td><td>Currency code</td></tr><tr data-parent="data data.back"><td><i class="table-deep-i nd"></i><i class="table-deep-i"></i><i class="table-plus empty"></i>data.back.coin</td><td class="api-table-p-type">string</td><td>Common asset ticker</td></tr><tr data-parent="data data.back"><td><i class="table-deep-i nd"></i><i class="table-deep-i"></i><i class="table-plus empty"></i>data.back.network</td><td class="api-table-p-type">string</td><td>Blockchain network in which this asset is represented</td></tr><tr data-parent="data data.back"><td><i class="table-deep-i nd"></i><i class="table-deep-i"></i><i class="table-plus empty"></i>data.back.name</td><td class="api-table-p-type">string</td><td>Name of currency</td></tr><tr data-parent="data data.back"><td><i class="table-deep-i nd"></i><i class="table-deep-i"></i><i class="table-plus empty"></i>data.back.alias</td><td class="api-table-p-type">string</td><td>Alias for creating qr code</td></tr><tr data-parent="data data.back"><td><i class="table-deep-i nd"></i><i class="table-deep-i"></i><i class="table-plus empty"></i>data.back.amount</td><td class="api-table-p-type">string</td><td>The amount that the client should receive upon return, excluding the miner fee</td></tr><tr data-parent="data data.back"><td><i class="table-deep-i nd"></i><i class="table-deep-i"></i><i class="table-plus empty"></i>data.back.address</td><td class="api-table-p-type">string</td><td>The return address to which the funds will be sent when choosing a refund</td></tr><tr data-parent="data data.back"><td><i class="table-deep-i nd"></i><i class="table-deep-i"></i><i class="table-plus empty"></i>data.back.tag</td><td class="api-table-p-type">string</td><td>MEMO or Destination Tag if required</td></tr><tr data-parent="data data.back"><td><i class="table-deep-i nd"></i><i class="table-deep-i"></i><i class="table-plus empty"></i>data.back.addressMix</td><td class="api-table-p-type">string</td><td>Address with a colon-connected tag</td></tr><tr data-name="data.back.tx" data-parent="data data.back"><td><i class="table-deep-i nd"></i><i class="table-deep-i end"></i><i class="table-plus"></i>data.back.tx</td><td class="api-table-p-type">Object</td><td>An object containing data about the returned transaction</td></tr><tr data-parent="data data.back data.back.tx"><td><i class="table-deep-i nd"></i><i class="table-deep-i no"></i><i class="table-deep-i"></i><i class="table-plus empty"></i>data.back.tx.id</td><td class="api-table-p-type">string</td><td>Transaction hash</td></tr><tr data-parent="data data.back data.back.tx"><td><i class="table-deep-i nd"></i><i class="table-deep-i no"></i><i class="table-deep-i"></i><i class="table-plus empty"></i>data.back.tx.amount</td><td class="api-table-p-type">string</td><td>Transaction amount</td></tr><tr data-parent="data data.back data.back.tx"><td><i class="table-deep-i nd"></i><i class="table-deep-i no"></i><i class="table-deep-i"></i><i class="table-plus empty"></i>data.back.tx.fee</td><td class="api-table-p-type">string</td><td>Miner fee</td></tr><tr data-parent="data data.back data.back.tx"><td><i class="table-deep-i nd"></i><i class="table-deep-i no"></i><i class="table-deep-i"></i><i class="table-plus empty"></i>data.back.tx.ccyfee</td><td class="api-table-p-type">string</td><td>Currency of Miner fee</td></tr><tr data-parent="data data.back data.back.tx"><td><i class="table-deep-i nd"></i><i class="table-deep-i no"></i><i class="table-deep-i"></i><i class="table-plus empty"></i>data.back.tx.timeReg</td><td class="api-table-p-type">number</td><td>Transaction registration timestamp</td></tr><tr data-parent="data data.back data.back.tx"><td><i class="table-deep-i nd"></i><i class="table-deep-i no"></i><i class="table-deep-i"></i><i class="table-plus empty"></i>data.back.tx.timeBlock</td><td class="api-table-p-type">number</td><td>Timestamp for adding a transaction to a block</td></tr><tr data-parent="data data.back data.back.tx"><td><i class="table-deep-i nd"></i><i class="table-deep-i no"></i><i class="table-deep-i end"></i><i class="table-plus empty"></i>data.back.tx.confirmations</td><td class="api-table-p-type">number</td><td>Number of transaction confirmations</td></tr><tr data-name="data.emergency" data-parent="data"><td><i class="table-deep-i end"></i><i class="table-plus"></i>data.emergency</td><td class="api-table-p-type">Object</td><td>An object containing data about the emergency in the order</td></tr><tr data-parent="data data.emergency"><td><i class="table-deep-i no"></i><i class="table-deep-i"></i><i class="table-plus empty"></i>data.emergency.status</td><td class="api-table-p-type">Array</td><td>Emergency status. Can be multiple values from:
<br>● <span class="api-param-ex">EXPIRED</span> — the transaction was received after the expiration of the order
<br>● <span class="api-param-ex">LESS</span> — a transaction was sent with an amount less than in the order
<br>● <span class="api-param-ex">MORE</span> — a transaction was sent with an amount greater than in the order
<br>● <span class="api-param-ex">LIMIT</span> — a transaction was sent with an amount less or more than the limit; used with <i>LESS</i> or <i>MORE</i></td></tr><tr data-parent="data data.emergency"><td><i class="table-deep-i no"></i><i class="table-deep-i"></i><i class="table-plus empty"></i>data.emergency.choice</td><td class="api-table-p-type">string</td><td>user choice. Can be one of the values:
<br>● <span class="api-param-ex">NONE</span> — Choice not made
<br>● <span class="api-param-ex">EXCHANGE</span> — Continue order at the new market rate
<br>● <span class="api-param-ex">REFUND</span> — Make a refund minus the network commission</td></tr><tr data-parent="data data.emergency"><td><i class="table-deep-i no"></i><i class="table-deep-i end"></i><i class="table-plus empty"></i>data.emergency.repeat</td><td class="api-table-p-type">boolean</td><td>if <i>true</i>, then a repeated transaction has been received for this order</td></tr></tbody></table></div>
</div>
<div class="api-example"><div class="api-example-title"><span>Example JSON response</span></div>
<div class="api-example-code-wrapper">
<div class="api-example-code">
<code>
<pre><span class="api-code-punctuation">{</span></pre><pre> <span class="api-code-param">"code"</span><span class="api-code-punctuation">:</span> <span class="api-code-numeric">0</span>,</pre>
<pre> <span class="api-code-param">"msg"</span><span class="api-code-punctuation">:</span> <span class="api-code-string">""</span>,</pre>
<pre> <span class="api-code-param">"data"</span><span class="api-code-punctuation">:</span> <span class="api-code-punctuation">{</span></pre>
<pre> <span class="api-code-param">"id"</span><span class="api-code-punctuation">:</span> <span class="api-code-string">"TESTID"</span>,</pre>
<pre> <span class="api-code-param">"type"</span><span class="api-code-punctuation">:</span> <span class="api-code-string">"float"</span>,</pre>
<pre> <span class="api-code-param">"email"</span><span class="api-code-punctuation">:</span> <span class="api-code-string">""</span>,</pre>
<pre> <span class="api-code-param">"status"</span><span class="api-code-punctuation">:</span> <span class="api-code-string">"NEW"</span>,</pre>
<pre> <span class="api-code-param">"time"</span><span class="api-code-punctuation">:</span> <span class="api-code-punctuation">{</span></pre>
<pre> <span class="api-code-param">"reg"</span><span class="api-code-punctuation">:</span> <span class="api-code-numeric">1676458603</span>,</pre>
<pre> <span class="api-code-param">"start"</span><span class="api-code-punctuation">:</span> <span class="api-code-null">null</span>,</pre>
<pre> <span class="api-code-param">"finish"</span><span class="api-code-punctuation">:</span> <span class="api-code-null">null</span>,</pre>
<pre> <span class="api-code-param">"update"</span><span class="api-code-punctuation">:</span> <span class="api-code-numeric">1676458603</span>,</pre>
<pre> <span class="api-code-param">"expiration"</span><span class="api-code-punctuation">:</span> <span class="api-code-numeric">1676460403</span>,</pre>
<pre> <span class="api-code-param">"left"</span><span class="api-code-punctuation">:</span> <span class="api-code-numeric">1800</span>,</pre>
<pre> <span class="api-code-punctuation">}</span><span class="api-code-punctuation">,</span></pre>
<pre> <span class="api-code-param">"from"</span><span class="api-code-punctuation">:</span> <span class="api-code-punctuation">{</span></pre>
<pre> <span class="api-code-param">"code"</span><span class="api-code-punctuation">:</span> <span class="api-code-string">"BTC"</span>,</pre>
<pre> <span class="api-code-param">"coin"</span><span class="api-code-punctuation">:</span> <span class="api-code-string">"BTC"</span>,</pre>
<pre> <span class="api-code-param">"network"</span><span class="api-code-punctuation">:</span> <span class="api-code-string">"BTC"</span>,</pre>
<pre> <span class="api-code-param">"name"</span><span class="api-code-punctuation">:</span> <span class="api-code-string">"Bitcoin"</span>,</pre>
<pre> <span class="api-code-param">"alias"</span><span class="api-code-punctuation">:</span> <span class="api-code-string">"bitcoin"</span>,</pre>
<pre> <span class="api-code-param">"amount"</span><span class="api-code-punctuation">:</span> <span class="api-code-string">"0.50000000"</span>,</pre>
<pre> <span class="api-code-param">"address"</span><span class="api-code-punctuation">:</span> <span class="api-code-string">"bc1qm8e58htm6qlhz5u7awhe4a5kxt3w86ffwtl9j0"</span>,</pre>
<pre> <span class="api-code-param">"addressAlt"</span><span class="api-code-punctuation">:</span> <span class="api-code-null">null</span>,</pre>
<pre> <span class="api-code-param">"tag"</span><span class="api-code-punctuation">:</span> <span class="api-code-null">null</span>,</pre>
<pre> <span class="api-code-param">"tagName"</span><span class="api-code-punctuation">:</span> <span class="api-code-null">null</span>,</pre>
<pre> <span class="api-code-param">"reqConfirmations"</span><span class="api-code-punctuation">:</span> <span class="api-code-numeric">1</span>,</pre>
<pre> <span class="api-code-param">"maxConfirmations"</span><span class="api-code-punctuation">:</span> <span class="api-code-numeric">6</span>,</pre>
<pre> <span class="api-code-param">"tx"</span><span class="api-code-punctuation">:</span> <span class="api-code-punctuation">{</span></pre>
<pre> <span class="api-code-param">"id"</span><span class="api-code-punctuation">:</span> <span class="api-code-null">null</span>,</pre>
<pre> <span class="api-code-param">"amount"</span><span class="api-code-punctuation">:</span> <span class="api-code-null">null</span>,</pre>
<pre> <span class="api-code-param">"fee"</span><span class="api-code-punctuation">:</span> <span class="api-code-null">null</span>,</pre>
<pre> <span class="api-code-param">"ccyfee"</span><span class="api-code-punctuation">:</span> <span class="api-code-null">null</span>,</pre>
<pre> <span class="api-code-param">"timeReg"</span><span class="api-code-punctuation">:</span> <span class="api-code-null">null</span>,</pre>
<pre> <span class="api-code-param">"timeBlock"</span><span class="api-code-punctuation">:</span> <span class="api-code-null">null</span>,</pre>
<pre> <span class="api-code-param">"confirmations"</span><span class="api-code-punctuation">:</span> <span class="api-code-null">null</span>,</pre>
<pre> <span class="api-code-punctuation">}</span><span class="api-code-punctuation">,</span></pre>
<pre> <span class="api-code-punctuation">}</span><span class="api-code-punctuation">,</span></pre>
<pre> <span class="api-code-param">"to"</span><span class="api-code-punctuation">:</span> <span class="api-code-punctuation">{</span></pre>
<pre> <span class="api-code-param">"code"</span><span class="api-code-punctuation">:</span> <span class="api-code-string">"USDTTRC"</span>,</pre>
<pre> <span class="api-code-param">"coin"</span><span class="api-code-punctuation">:</span> <span class="api-code-string">"USDT"</span>,</pre>
<pre> <span class="api-code-param">"network"</span><span class="api-code-punctuation">:</span> <span class="api-code-string">"TRX"</span>,</pre>
<pre> <span class="api-code-param">"name"</span><span class="api-code-punctuation">:</span> <span class="api-code-string">"Tether (TRC20)"</span>,</pre>
<pre> <span class="api-code-param">"alias"</span><span class="api-code-punctuation">:</span> <span class="api-code-string">"usdt"</span>,</pre>
<pre> <span class="api-code-param">"amount"</span><span class="api-code-punctuation">:</span> <span class="api-code-string">"11062.06500000"</span>,</pre>
<pre> <span class="api-code-param">"address"</span><span class="api-code-punctuation">:</span> <span class="api-code-string">"TVnbp1VCJ1TpWMom4k3URfFky9FGfPdZPd"</span>,</pre>
<pre> <span class="api-code-param">"tag"</span><span class="api-code-punctuation">:</span> <span class="api-code-null">null</span>,</pre>
<pre> <span class="api-code-param">"tagName"</span><span class="api-code-punctuation">:</span> <span class="api-code-null">null</span>,</pre>
<pre> <span class="api-code-param">"tx"</span><span class="api-code-punctuation">:</span> <span class="api-code-punctuation">{</span></pre>
<pre> <span class="api-code-param">"id"</span><span class="api-code-punctuation">:</span> <span class="api-code-null">null</span>,</pre>
<pre> <span class="api-code-param">"amount"</span><span class="api-code-punctuation">:</span> <span class="api-code-null">null</span>,</pre>
<pre> <span class="api-code-param">"fee"</span><span class="api-code-punctuation">:</span> <span class="api-code-null">null</span>,</pre>
<pre> <span class="api-code-param">"ccyfee"</span><span class="api-code-punctuation">:</span> <span class="api-code-null">null</span>,</pre>
<pre> <span class="api-code-param">"timeReg"</span><span class="api-code-punctuation">:</span> <span class="api-code-null">null</span>,</pre>
<pre> <span class="api-code-param">"timeBlock"</span><span class="api-code-punctuation">:</span> <span class="api-code-null">null</span>,</pre>
<pre> <span class="api-code-param">"confirmations"</span><span class="api-code-punctuation">:</span> <span class="api-code-null">null</span>,</pre>
<pre> <span class="api-code-punctuation">}</span><span class="api-code-punctuation">,</span></pre>
<pre> <span class="api-code-punctuation">}</span><span class="api-code-punctuation">,</span></pre>
<pre> <span class="api-code-param">"back"</span><span class="api-code-punctuation">:</span> <span class="api-code-punctuation">{</span></pre>
<pre> <span class="api-code-param">"code"</span><span class="api-code-punctuation">:</span> <span class="api-code-null">null</span>,</pre>
<pre> <span class="api-code-param">"coin"</span><span class="api-code-punctuation">:</span> <span class="api-code-null">null</span>,</pre>
<pre> <span class="api-code-param">"network"</span><span class="api-code-punctuation">:</span> <span class="api-code-null">null</span>,</pre>
<pre> <span class="api-code-param">"name"</span><span class="api-code-punctuation">:</span> <span class="api-code-null">null</span>,</pre>
<pre> <span class="api-code-param">"alias"</span><span class="api-code-punctuation">:</span> <span class="api-code-null">null</span>,</pre>
<pre> <span class="api-code-param">"amount"</span><span class="api-code-punctuation">:</span> <span class="api-code-null">null</span>,</pre>
<pre> <span class="api-code-param">"address"</span><span class="api-code-punctuation">:</span> <span class="api-code-null">null</span>,</pre>
<pre> <span class="api-code-param">"tag"</span><span class="api-code-punctuation">:</span> <span class="api-code-null">null</span>,</pre>
<pre> <span class="api-code-param">"tagName"</span><span class="api-code-punctuation">:</span> <span class="api-code-null">null</span>,</pre>
<pre> <span class="api-code-param">"tx"</span><span class="api-code-punctuation">:</span> <span class="api-code-punctuation">{</span></pre>
<pre> <span class="api-code-param">"id"</span><span class="api-code-punctuation">:</span> <span class="api-code-null">null</span>,</pre>
<pre> <span class="api-code-param">"amount"</span><span class="api-code-punctuation">:</span> <span class="api-code-null">null</span>,</pre>
<pre> <span class="api-code-param">"fee"</span><span class="api-code-punctuation">:</span> <span class="api-code-null">null</span>,</pre>
<pre> <span class="api-code-param">"ccyfee"</span><span class="api-code-punctuation">:</span> <span class="api-code-null">null</span>,</pre>
<pre> <span class="api-code-param">"timeReg"</span><span class="api-code-punctuation">:</span> <span class="api-code-null">null</span>,</pre>
<pre> <span class="api-code-param">"timeBlock"</span><span class="api-code-punctuation">:</span> <span class="api-code-null">null</span>,</pre>
<pre> <span class="api-code-param">"confirmations"</span><span class="api-code-punctuation">:</span> <span class="api-code-null">null</span>,</pre>
<pre> <span class="api-code-punctuation">}</span><span class="api-code-punctuation">,</span></pre>
<pre> <span class="api-code-punctuation">}</span><span class="api-code-punctuation">,</span></pre>
<pre> <span class="api-code-param">"emergency"</span><span class="api-code-punctuation">:</span> <span class="api-code-punctuation">{</span></pre>
<pre> <span class="api-code-param">"status"</span><span class="api-code-punctuation">:</span> <span class="api-code-punctuation">[</span><span class="api-code-punctuation">]</span><span class="api-code-punctuation">,</span></pre>
<pre> <span class="api-code-param">"choice"</span><span class="api-code-punctuation">:</span> <span class="api-code-string">"NONE"</span>,</pre>
<pre> <span class="api-code-param">"repeat"</span><span class="api-code-punctuation">:</span> <span class="api-code-numeric">0</span>,</pre>
<pre> <span class="api-code-punctuation">}</span><span class="api-code-punctuation">,</span></pre>
<pre> <span class="api-code-param">"token"</span><span class="api-code-punctuation">:</span> <span class="api-code-string">"TESTTOKENvRB90NOtr397kHY3PJ1VRy2p29HHaN7"</span>,</pre>
<pre> <span class="api-code-punctuation">}</span><span class="api-code-punctuation">,</span></pre>
<pre><span class="api-code-punctuation">}</span></pre> </code>
</div>
</div></div>
</section></section>
<section class="api-section" id="method_order" data-parent="api_methods"><section class="api-request-section"><div class="api-description">
<h2>Get order details</h2>
<div class="api-url"><span class="api-url-method post">POST</span><span class="api-url-line"><span class="api-url-protocol">https://</span><span class="api-url-host">ff.io</span><span class="api-url-link">/api/v2/order</span></span></div>
<p>The method receives the updated order data.</p>
<h3>Parameters</h3>
<div class="api-table-wrap"><table class="api-request-table">
<thead>
<tr><td>Name</td><td>Required</td><td>Type</td><td>Description</td></tr>
</thead>
<tbody>
<tr><td>id</td><td><span class="api-table-p-req">true</span></td><td class="api-table-p-type">string</td><td>Order ID</td></tr>
<tr><td>token</td><td><span class="api-table-p-req">true</span></td><td class="api-table-p-type">string</td><td>Order security token received when creating an order in data.token</td></tr>
</tbody>
</table></div>
</div>
<div class="api-example"><div class="api-example-title"><span>Example request</span></div>
<div class="api-example-tabs">
<label class="active" data-lang="curl">Curl</label>
<label data-lang="python">Python</label>
<label data-lang="php">PHP</label>
</div>
<div class="api-example-code-wrapper">
<div class="api-example-code active" data-lang="curl">
<code>
<pre><span class="api-code-curl-f">cURL</span> <span class="api-code-curl-h">-X</span> <span class="api-code-curl-x">POST</span> <span class="api-code-curl-n">\</span></pre>
<pre> <span class="api-code-curl-h">-H</span> <span class="api-code-curl-txt">"Accept: application/json"</span> <span class="api-code-curl-n">\</span></pre>
<pre> <span class="api-code-curl-h">-H</span> <span class="api-code-curl-txt">"X-API-KEY: <span class="api-code-curl-const">YOUR_API_KEY</span>"</span> <span class="api-code-curl-n">\</span></pre>
<pre> <span class="api-code-curl-h">-H</span> <span class="api-code-curl-txt">"X-API-SIGN: <span class="api-code-curl-const">GENERATED_SIGN</span>"</span> <span class="api-code-curl-n">\</span></pre>
<pre> <span class="api-code-curl-h">-H</span> <span class="api-code-curl-txt">"Content-Type: application/json; charset=UTF-8"</span> <span class="api-code-curl-n">\</span></pre>
<pre> <span class="api-code-curl-h">-d</span> <span class="api-code-curl-txt">'{"id":"TESTID","token":"TESTTOKENvRB90NOtr397kHY3PJ1VRy2p29HHaN7"}'</span></pre>
<pre> <span class="api-code-curl-link">"https://ff.io/api/v2/order"</span> <span class="api-code-curl-h">-L</span></pre>
</code>
</div>
<div class="api-example-code" data-lang="python"></div>
<div class="api-example-code" data-lang="php">
<code>