-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
executable file
·1688 lines (1645 loc) · 87.3 KB
/
index.html
File metadata and controls
executable file
·1688 lines (1645 loc) · 87.3 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">
<meta http-equiv="x-ua-compatible" content="ie=edge">
<!--[if IE]> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <![endif]-->
<!-- Mobile Specific -->
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Blockfreight API Docs</title>
<link rel="icon" href="images/favicon.png" type="image/x-icon" />
<meta name="description" content="Blockfreight API Docs">
<meta name="author" content="Blockfreight">
<meta name="copyright" content="Blockfreight">
<!-- Google Fonts -->
<link rel="stylesheet" type="text/css" href="https://fonts.googleapis.com/css?family=Montserrat:100,200,300,400,500,600,700,800,900">
<link rel="stylesheet" type="text/css" href="https://fonts.googleapis.com/css?family=Raleway:100,200,300,400,500,600,700,800,900">
<!-- CSS Style -->
<link rel="stylesheet" type="text/css" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">
<link rel="stylesheet" type="text/css" href="css/jquery.mobile-menu.css">
<link rel="stylesheet" type="text/css" href="css/style.css" media="all">
<link rel="stylesheet" type="text/css" href="css/responsive.css">
</head>
<body id="pixxett-api">
<div id="page">
<!-- Header -->
<header class="header" id="header">
<div class="container-fluid">
<div class="row">
<div class="col-lg-1 col-sm-2">
<div class="mm-toggle-wrap">
<div class="mm-toggle">
<i class="fa fa-align-justify"></i>
<span class="mm-label">Menu</span>
</div>
</div>
<!-- Header Logo -->
<a class="header__block header__brand" href="#">
<h1>
<img src="images/logo.png" alt="API UI logo">
</h1>
</a>
<!-- End Header Logo -->
</div>
<div class="col-lg-11 col-sm-10 hidden-xs">
<div class="header__nav">
<div class="header__nav--left">
<ul class="dx-nav-0 dx-nav-0-docs">
<li class="dx-nav-0-item ">
<a class="dx-nav-0-link" href="javascript:void(0);">Docs</a>
</li>
<li class="dx-nav-0-item dx-nav-active">
<a class="dx-nav-0-link" href="javascript:void(0);">API Reference</a>
</li>
<li class="dx-nav-0-item ">
<a class="dx-nav-0-link" href="javascript:void(0);">Support</a>
</li>
</ul>
<form class="header__search dx-form-search" id="siteSearch" name="search" method="get">
<label class="sr-only" for="siteQ">Enter search term</label>
<input class="dx-search-input" id="siteQ" name="q" type="search" value="" placeholder="Search">
<span class="button-search fa fa-search"></span>
</form>
</div>
<div class="header__nav--right">
<ul class="dx-nav-0 dx-nav-0-tools">
<li class="dx-nav-0-item ">
<a class="dx-nav-0-link" href="https://blockfreight.com">Dashboard</a>
</li>
<li class="dx-nav-0-item ">
<a class="dx-nav-0-link" href="https://blockfreight.com/demo">Demo</a>
</li>
<li class="dx-nav-0-item ">
<a class="dx-nav-0-link" href="https://blockfreight.com/pricing">Pricing</a>
</li>
<li class="dx-nav-0-item ">
<a class="dx-nav-0-link" href="https://blockfreight.com/contact">Contact Us</a>
</li>
</ul>
<div class="dx-auth-block">
<div class="dx-auth-logged-out">
<a class="dx-auth-login dx-btn dx-btn-primary" data-js="auth-btn" href="https://blockfreight.com/user" data-dxa="login,nav-click,nav-login">Log In</a>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</header>
<!-- end header -->
<!-- header service -->
<div class="header-section-wrapper">
<div class="header-section header-section-example">
<div id="language">
<ul class="language-toggle">
<li>
<input type="radio" class="language-toggle-source" name="language-toggle" id="toggle-lang-curl" data-language="curl" checked="checked">
<label for="toggle-lang-curl" class="language-toggle-button language-toggle-button--curl">curl</label>
</li>
<li>
<input type="radio" class="language-toggle-source" name="language-toggle" id="toggle-lang-ruby" data-language="ruby">
<label for="toggle-lang-ruby" class="language-toggle-button language-toggle-button--ruby">Ruby</label>
</li>
<li>
<input type="radio" class="language-toggle-source" name="language-toggle" id="toggle-lang-python" data-language="python">
<label for="toggle-lang-python" class="language-toggle-button language-toggle-button--python">Python</label>
</li>
<li>
<input type="radio" class="language-toggle-source" name="language-toggle" id="toggle-lang-php" data-language="php">
<label for="toggle-lang-php" class="language-toggle-button language-toggle-button--php">PHP</label>
</li>
<li>
<input type="radio" class="language-toggle-source" name="language-toggle" id="toggle-lang-java" data-language="java">
<label for="toggle-lang-java" class="language-toggle-button language-toggle-button--java">Java</label>
</li>
<li>
<input type="radio" class="language-toggle-source" name="language-toggle" id="toggle-lang-node" data-language="node">
<label for="toggle-lang-node" class="language-toggle-button language-toggle-button--node">Node</label>
</li>
<li>
<input type="radio" class="language-toggle-source" name="language-toggle" id="toggle-lang-go" data-language="go">
<label for="toggle-lang-go" class="language-toggle-button language-toggle-button--go">Go</label>
</li>
</ul>
</div>
</div>
</div>
<!-- End header service -->
<!-- Sidebar -->
<div id="documenter_sidebar">
<div id="scrollholder" class="scrollholder">
<div id="scroll" class="scroll">
<ol id="documenter_nav">
<li>
<a class="current" href="#documenter-1">
<i class="fa fa-file-text-o"></i>
API Reference</a>
</li>
<li>
<a href="#documenter-3">
<i class="fa fa-warning"></i>
Errors
</a>
<ol>
<li>
<a href="#documenter-3-1">Handling errors</a>
</li>
</ol>
</li>
<li>
<a href="#documenter-6">
<i class="fa fa-warning"></i>
Core Resources
</a>
<ol>
<li>
<a href="#documenter-6-1">Create Transaction</a>
</li>
<li>
<a href="#documenter-6-2">Sign Transaction</a>
</li>
<li>
<a href="#documenter-6-3">Broadcast Transaction</a>
</li>
<li>
<a href="#documenter-6-4">Query Transaction</a>
</li>
</ol>
</li>
</ol>
</div>
</div>
</div>
<!-- end sidebar -->
<!-- Section Background -->
<div id="background">
<div class="background-actual"></div>
</div>
<!-- End Section Background -->
<!-- main Content -->
<div id="documenter_content" class="method-area-wrapper">
<section id="documenter-1" class="method">
<div class="method-area">
<div class="method-copy">
<div class="method-copy-padding">
<h3>API Reference</h3>
<p>
The Blockfreight API is organized around GraphQL. GraphQL is a query language for your API, and a server-side runtime for
executing queries by using a type system you define for your data. We support cross-origin
resource sharing, allowing you to interact securely with our API from a client-side web application
(though you should never expose your secret API key in any public website's client-side code).
JSON is returned by all API responses, including errors, which are indicated by HTTP response
codes.
</p>
<p>
Once the
<a href="https://github.com/blockfreight/go-bftx#installation" target="_blank">Blockfreight node is running</a>
the api will be running on
<code class=" language-undefined">http://localhost:8080/bftx-api</code>. As a GraphQL API, it does not have a route for each
action, request body is where the action (or mutation) must be declared.
</p>
<p>
<img src="images/place-holder.png" alt="Image">
</p>
</div>
</div>
<div class="method-example">
<div class="method-example-part">
<h5>API Reference</h5>
<p>
Curabitur lacinia convallis nibh,
<a href="#">non cursus augue</a>. Quisque id sem id lorem porttitor efficitur in quis libero. Nullam
turpis ante auctor
<a href="#">purus sed</a>.
</p>
</div>
<div class="method-example-part">
<div class="method-example-endpoint">
<pre class="language-none"><code class="language-none">https://examples.com</code></pre>
</div>
</div>
</div>
</div>
</section>
<section id="documenter-3" class="method">
<div class="method-area">
<div class="method-copy">
<div class="method-copy-padding">
<h3 id="handling-errors">Errors</h3>
<p>
Blockfreight uses conventional HTTP response codes to indicate the success or failure of an API request. In general: Codes
in the 2xx range indicate success. Codes in the 4xx range indicate an error that failed given
the information provided (e.g., a required parameter was omitted, a charge failed, etc.).
Codes in the 5xx range indicate an error with Blockfreight's servers.
</p>
</div>
</div>
<div class="method-example">
<div class="method-example-part">
<h5>HTTP status code summary</h5>
<div class="table">
<table class="table-container">
<colgroup>
<col class="col-xs-3">
<col class="col-xs-9">
</colgroup>
<tbody>
<tr>
<th class="table-row-property">200 - ok</th>
<td class="table-row-definition">Everything worked as expected.</td>
</tr>
<tr>
<th class="table-row-property">400 - bad request</th>
<td class="table-row-definition">The request was unacceptable, often due to missing a required parameter. Check
whether the request body is correct.</td>
</tr>
<tr>
<th class="table-row-property">406 - not acceptable</th>
<td class="table-row-definition">The transaction has not been signed before trying to Broadcast or the transaction
has been broadcasted and it is not possible to sign it again.</td>
</tr>
<tr>
<th class="table-row-property">404 - not found</th>
<td class="table-row-definition">Transaction not found.</td>
</tr>
<tr>
<tr>
<th class="table-row-property">500 - server errors</th>
<td class="table-row-definition">Something went wrong on Blockfreight's end.</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
</section>
<section id="documenter-3-1" class="method">
<div class="method-area">
<div class="method-copy">
<div class="method-copy-padding">
<h3>handling errors</h3>
<p>in laoreet dapibus ante vitae placerat. pellentesque mollis sapien nec sapien
<code>.table</code>
elementum
<code><table></code>. eu tincidunt elit placerat. phasellus laoreet vitae mi at hendrerit.
cras in massa ac mi sodales vestibulum. etiam convallis lectus vitae ligula fermentum, et
rutrum odio tincidunt.</p>
<div class="table-responsive">
<table class="table table-hover">
<thead>
<tr>
<td class="text-center">
<i class="fa fa-trash"></i>
</td>
<td>id</td>
<td>pretium</td>
<td>bytes</td>
<td>duis</td>
<td>urna neque</td>
<td>phasellus</td>
</tr>
</thead>
<tbody>
<tr>
<td class="text-center">
<div class="checkbox margin-t-0">
<input id="checkbox1" type="checkbox">
<label for="checkbox1"></label>
</div>
</td>
<td>#
<b>9652</b>
</td>
<td>lorem ipsum dolor sit</td>
<td>john doe</td>
<td>12/10/2015</td>
<td>praesent risus velit, egestas et nulla vitae, venenatis elementum nulla. aliquam
ligula quam, blandit sed neque vel, aliquet viverra eros.</td>
<td>credit card</td>
</tr>
<tr>
<td class="text-center">
<div class="checkbox margin-t-0">
<input id="checkbox2" type="checkbox">
<label for="checkbox2"></label>
</div>
</td>
<td>#
<b>9652</b>
</td>
<td>lorem ipsum dolor sit</td>
<td>john doe</td>
<td>12/10/2015</td>
<td>praesent risus velit, egestas et nulla vitae, venenatis elementum nulla. aliquam
ligula quam, blandit sed neque vel, aliquet viverra eros.</td>
<td>credit card</td>
</tr>
<tr>
<td class="text-center">
<div class="checkbox margin-t-0">
<input id="checkbox3" type="checkbox">
<label for="checkbox3"></label>
</div>
</td>
<td>#
<b>9652</b>
</td>
<td>lorem ipsum dolor sit</td>
<td>john doe</td>
<td>12/10/2015</td>
<td>praesent risus velit, egestas et nulla vitae, venenatis elementum nulla. aliquam
ligula quam, blandit sed neque vel, aliquet viverra eros.</td>
<td>credit card</td>
</tr>
<tr>
<td class="text-center">
<div class="checkbox margin-t-0">
<input id="checkbox4" type="checkbox">
<label for="checkbox4"></label>
</div>
</td>
<td>#
<b>9652</b>
</td>
<td>lorem ipsum dolor sit</td>
<td>john doe</td>
<td>12/10/2015</td>
<td>praesent risus velit, egestas et nulla vitae, venenatis elementum nulla. aliquam
ligula quam, blandit sed neque vel, aliquet viverra eros.</td>
<td>credit card</td>
</tr>
<tr>
<td class="text-center">
<div class="checkbox margin-t-0">
<input id="checkbox5" type="checkbox">
<label for="checkbox5"></label>
</div>
</td>
<td>#
<b>9652</b>
</td>
<td>lorem ipsum dolor sit</td>
<td>john doe</td>
<td>12/10/2015</td>
<td>praesent risus velit, egestas et nulla vitae, venenatis elementum nulla. aliquam
ligula quam, blandit sed neque vel, aliquet viverra eros.</td>
<td>credit card</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div class="method-example">
<div class="method-example-part">
<h5>HTTP status code summary</h5>
<div class="table">
<table class="table-container">
<colgroup>
<col class="col-xs-3">
<col class="col-xs-9">
</colgroup>
<tbody>
<tr>
<th class="table-row-property">200 - ok</th>
<td class="table-row-definition">vivamus rhoncus dui vitae eros tristique cursus.</td>
</tr>
<tr>
<th class="table-row-property">400 - bad request</th>
<td class="table-row-definition">vivamus rhoncus dui vitae eros tristique cursus, vivamus rhoncus dui vitae eros.</td>
</tr>
<tr>
<th class="table-row-property">401 - unauthorized</th>
<td class="table-row-definition">vivamus rhoncus dui vitae eros tristique cursus.</td>
</tr>
<tr>
<th class="table-row-property">402 - request failed</th>
<td class="table-row-definition">vivamus rhoncus dui vitae eros tristique cursus.</td>
</tr>
<tr>
<th class="table-row-property">404 - not found</th>
<td class="table-row-definition">vivamus rhoncus dui vitae eros tristique cursus.</td>
</tr>
<tr>
<th class="table-row-property">409 - conflict</th>
<td class="table-row-definition">vivamus rhoncus dui vitae eros tristique cursus (dui vitae eros tristique cursus).</td>
</tr>
<tr>
<th class="table-row-property">429 - too many requests</th>
<td class="table-row-definition">vivamus rhoncus dui vitae eros tristique cursus vivamus rhoncus dui vitae eros
tristique.
</td>
</tr>
<tr>
<th class="table-row-property">500, 502, 503, 504 - server errors</th>
<td class="table-row-definition">vivamus rhoncus dui vitae eros tristique cursus (vivamus rhoncus)</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
</section>
<section id="documenter-6" class="method">
<div class="method-area">
<div class="method-copy">
<div class="method-copy-padding">
<h3 id="handling-errors">Core resources</h3>
<p>
See below the core Blockfreight resources, you will use them to create, sign, broadcast and/or query a transaction.
</p>
<p>
Remember that the base url is:
<code class=" language-undefined">http://localhost:8080/bftx-api</code>. You will use it for all the resources.
</p>
</div>
</div>
</div>
</section>
<section id="documenter-6-1" class="method">
<div class="method-area">
<div class="method-copy">
<div class="method-copy-padding">
<h3>Create a transaction.</h3>
<h5>Route:
<code class=" language-undefined">http://localhost:8080/bftx-api</code>
</h5>
<h5>Method:
<code class=" language-undefined">POST</code>
</h5>
<h5>Request Structure:</h5>
<code class=" language-undefined">
{
<br/> "query": "mutation{constructBFTX(#BLOCKFREIGHT_TRANSACTION_ATTRIBUTES){ #BLOCKFREIGHT_TRANSACTION_ATTRIBUTES_THAT_MUST_BE_RETURNED
}}"
<br/> }
<br/>
</code>
<h5>Description:</h5>
<p>
This resource is responsible for creating a local transaction with the info sent inside the
<code
class=" language-undefined">
constructBFTX()
</code>
and the return depends on the structure that is passed in the request.
</p>
<h5>Attributes:</h5>
<p>
See below the Blockfreight Transaction Attributes:
</p>
<div class="table-responsive">
<table class="table table-bordered table-exampled">
<thead>
<tr>
<td>Name</td>
<td>Data Type</td>
<td>Description</td>
</tr>
</thead>
<tbody>
<tr>
<td>Shipper</td>
<td>String</td>
<td>Shipper</td>
</tr>
<tr>
<td>BolNum</td>
<td>String</td>
<td>BolNum</td>
</tr>
<tr>
<td>RefNum</td>
<td>String</td>
<td>RefNum</td>
</tr>
<tr>
<td>Consignee</td>
<td>String</td>
<td>Consignee</td>
</tr>
<tr>
<td>HouseBill</td>
<td>String</td>
<td>HouseBill</td>
</tr>
<tr>
<td>Vessel</td>
<td>String</td>
<td>Vessel</td>
</tr>
<tr>
<td>Packages</td>
<td>String</td>
<td>Packages</td>
</tr>
<tr>
<td>PackType</td>
<td>String</td>
<td>PackType</td>
</tr>
<tr>
<td>INCOTerms</td>
<td>String</td>
<td>INCOTerms</td>
</tr>
<tr>
<td>PortOfLoading</td>
<td>String</td>
<td>PortOfLoading</td>
</tr>
<tr>
<td>PortOfDischarge</td>
<td>String</td>
<td>PortOfDischarge</td>
</tr>
<tr>
<td>Destination</td>
<td>String</td>
<td>Destination</td>
</tr>
<tr>
<td>MarksAndNumbers</td>
<td>String</td>
<td>MarksAndNumbers</td>
</tr>
<tr>
<td>UnitOfWeight</td>
<td>String</td>
<td>UnitOfWeight</td>
</tr>
<tr>
<td>DeliverAgent</td>
<td>String</td>
<td>DeliverAgent</td>
</tr>
<tr>
<td>ReceiveAgent</td>
<td>String</td>
<td>ReceiveAgent</td>
</tr>
<tr>
<td>Container</td>
<td>String</td>
<td>Container</td>
</tr>
<tr>
<td>ContainerSeal</td>
<td>String</td>
<td>ContainerSeal</td>
</tr>
<tr>
<td>ContainerMode</td>
<td>String</td>
<td>ContainerMode</td>
</tr>
<tr>
<td>ContainerType</td>
<td>String</td>
<td>ContainerType</td>
</tr>
<tr>
<td>Volume</td>
<td>String</td>
<td>Volume</td>
</tr>
<tr>
<td>UnitOfVolume</td>
<td>String</td>
<td>UnitOfVolume</td>
</tr>
<tr>
<td>NotifyAddress</td>
<td>String</td>
<td>NotifyAddress</td>
</tr>
<tr>
<td>DescOfGoods</td>
<td>String</td>
<td>DescOfGoods</td>
</tr>
<tr>
<td>GrossWeight</td>
<td>String</td>
<td>GrossWeight</td>
</tr>
<tr>
<td>FreightPayableAmt</td>
<td>String</td>
<td>FreightPayableAmt</td>
</tr>
<tr>
<td>FreightAdvAmt</td>
<td>String</td>
<td>FreightAdvAmt</td>
</tr>
<tr>
<td>GeneralInstructions</td>
<td>String</td>
<td>GeneralInstructions</td>
</tr>
<tr>
<td>DateShipped</td>
<td>String</td>
<td>DateShipped</td>
</tr>
<tr>
<td>DateShipped</td>
<td>String</td>
<td>DateShipped</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div class="method-example">
<div class="code-curl code-div active-code">
<div class="method-example-part">
<pre class=" language-ruby">curl -d '{ "query": "mutation{constructBFTX(Properties:{ DescOfGoods:\"This is a test description.\" }){ Id }}" }' -X POST -H "Content-Type: application/json" http://localhost:8080/bftx-api</pre>
</div>
</div>
<div class="code-node code-div">
<div class="method-example-part">
<div class=" language-undefined">
<pre class=" language-javascript">
<code class=" language-javascript">
const axios = require('axios')
function createBlockfreightTransaction() {
axios.post("http://localhost:8080/bftx-api", { "query": "mutation{constructBFTX(Properties:{ DescOfGoods:\"This is a test description.\" Shipper:\"shipper\" }){ Id }}" })
.then(function (response) {
console.log(response.data);
})
.catch(function (error) {
console.log(error);
});
}
module.exports = createBlockfreightTransaction()
/* Response:
{ data:
{ constructBFTX:
{ Id: '#BLOCKFREIGHT_TRANSACTION_ID' }
}
}*/
</code>
</pre>
</div>
</div>
</div>
<div class="code-go code-div">
<div class="method-example-part">
<div class=" language-undefined">
<pre class=" language-go">
<code class=" language-go">
package main
import (
"fmt"
"io/ioutil"
"log"
"net/http"
"net/url"
)
func main() {
res, err := http.PostForm("http://localhost:8080/bftx-api",
url.Values{"query": {"mutation{constructBFTX(Properties:{ DescOfGoods:\"This is a test description.\" Shipper:\"shipper\" }){ Id }}"}})
if err != nil {
log.Fatal(err)
}
bftxResult, err := ioutil.ReadAll(res.Body)
res.Body.Close()
if err != nil {
log.Fatal(err)
}
fmt.Printf("%s", bftxResult)
}
/* Response:
{ data:
{ constructBFTX:
{ Id: '#BLOCKFREIGHT_TRANSACTION_ID' }
}
}*/
</code>
</pre>
</div>
</div>
</div>
</div>
</div>
</section>
<section id="documenter-6-2" class="method">
<div class="method-area">
<div class="method-copy">
<div class="method-copy-padding">
<h3>Sign a transaction.</h3>
<h5>Route:
<code class=" language-undefined">http://localhost:8080/bftx-api</code>
</h5>
<h5>Method:
<code class=" language-undefined">POST</code>
</h5>
<h5>Request Structure:</h5>
<code class=" language-undefined">
{
<br/> "query": "mutation{tx: signBFTX(Id:#BLOCKFREIGHT_TRANSACTION_ID){ #BLOCKFREIGHT_TRANSACTION_ATTRIBUTES_THAT_MUST_BE_RETURNED }}"
<br/> }
<br/>
</code>
<h5>Description:</h5>
<p>
This resource is responsible for signing a local transaction based on the given <code class=" language-undefined">Blockfreight Transaction ID</code> sent inside the
<code
class=" language-undefined">
signBFTX()
</code>
and the return depends on the structure that is passed in the request.
</p>
<h5>Attributes:</h5>
<p>
See below the Blockfreight Transaction Attributes:
</p>
<div class="table-responsive">
<table class="table table-bordered table-exampled">
<thead>
<tr>
<td>Name</td>
<td>Data Type</td>
<td>Description</td>
</tr>
</thead>
<tbody>
<tr>
<td>Shipper</td>
<td>String</td>
<td>Shipper</td>
</tr>
<tr>
<td>BolNum</td>
<td>String</td>
<td>BolNum</td>
</tr>
<tr>
<td>RefNum</td>
<td>String</td>
<td>RefNum</td>
</tr>
<tr>
<td>Consignee</td>
<td>String</td>
<td>Consignee</td>
</tr>
<tr>
<td>HouseBill</td>
<td>String</td>
<td>HouseBill</td>
</tr>
<tr>
<td>Vessel</td>
<td>String</td>
<td>Vessel</td>
</tr>
<tr>
<td>Packages</td>
<td>String</td>
<td>Packages</td>
</tr>
<tr>
<td>PackType</td>
<td>String</td>
<td>PackType</td>
</tr>
<tr>
<td>INCOTerms</td>
<td>String</td>
<td>INCOTerms</td>
</tr>
<tr>
<td>PortOfLoading</td>
<td>String</td>
<td>PortOfLoading</td>
</tr>
<tr>
<td>PortOfDischarge</td>
<td>String</td>
<td>PortOfDischarge</td>
</tr>
<tr>
<td>Destination</td>
<td>String</td>
<td>Destination</td>
</tr>
<tr>
<td>MarksAndNumbers</td>
<td>String</td>
<td>MarksAndNumbers</td>
</tr>
<tr>
<td>UnitOfWeight</td>
<td>String</td>
<td>UnitOfWeight</td>
</tr>
<tr>
<td>DeliverAgent</td>
<td>String</td>
<td>DeliverAgent</td>
</tr>
<tr>
<td>ReceiveAgent</td>
<td>String</td>
<td>ReceiveAgent</td>
</tr>
<tr>
<td>Container</td>
<td>String</td>
<td>Container</td>
</tr>
<tr>
<td>ContainerSeal</td>
<td>String</td>
<td>ContainerSeal</td>
</tr>
<tr>
<td>ContainerMode</td>
<td>String</td>
<td>ContainerMode</td>
</tr>
<tr>
<td>ContainerType</td>
<td>String</td>
<td>ContainerType</td>
</tr>
<tr>
<td>Volume</td>
<td>String</td>
<td>Volume</td>
</tr>
<tr>
<td>UnitOfVolume</td>
<td>String</td>
<td>UnitOfVolume</td>
</tr>
<tr>
<td>NotifyAddress</td>
<td>String</td>
<td>NotifyAddress</td>
</tr>
<tr>
<td>DescOfGoods</td>
<td>String</td>
<td>DescOfGoods</td>
</tr>
<tr>
<td>GrossWeight</td>
<td>String</td>
<td>GrossWeight</td>
</tr>
<tr>
<td>FreightPayableAmt</td>
<td>String</td>
<td>FreightPayableAmt</td>
</tr>
<tr>
<td>FreightAdvAmt</td>
<td>String</td>
<td>FreightAdvAmt</td>
</tr>
<tr>
<td>GeneralInstructions</td>
<td>String</td>
<td>GeneralInstructions</td>
</tr>
<tr>
<td>DateShipped</td>
<td>String</td>
<td>DateShipped</td>
</tr>
<tr>
<td>DateShipped</td>
<td>String</td>
<td>DateShipped</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div class="method-example">
<div class="code-curl code-div active-code">
<div class="method-example-part">
<pre class=" language-ruby">curl -d '{ "query": "mutation{tx:signBFTX(Id:\"#BLOCKFREIGHT_TRANSACTION_ID\"){ Id }}" }' -X POST -H "Content-Type: application/json" http://localhost:8080/bftx-api</pre>
</div>
</div>
<div class="code-node code-div">
<div class="method-example-part">
<div class=" language-undefined">
<pre class=" language-javascript">
<code class=" language-javascript">
const axios = require('axios')
function signBlockfreightTransaction() {
axios.post("http://localhost:8080/bftx-api", { "query": "mutation{signBFTX(Id:\"#BLOCKFREIGHT_TRANSACTION_ID\"){ Id }}" })
.then(function (response) {
console.log(response.data);
})
.catch(function (error) {
console.log(error);
});
}
module.exports = signBlockfreightTransaction()
/* Response:
{ data:
{ signBFTX:
{ Id: '#BLOCKFREIGHT_TRANSACTION_ID' }
}
}*/
</code>
</pre>
</div>
</div>
</div>
<div class="code-go code-div">
<div class="method-example-part">
<div class=" language-undefined">
<pre class=" language-go">
<code class=" language-go">
package main
import (
"fmt"
"io/ioutil"
"log"
"net/http"
"net/url"
)
func main() {
res, err := http.PostForm("http://localhost:8080/bftx-api",
url.Values{"query": {"mutation{signBFTX(Id: \"#BLOCKFREIGHT_TRANSACTION_ID\"){ Id }}"}})
if err != nil {
log.Fatal(err)
}