-
Notifications
You must be signed in to change notification settings - Fork 19
/
Copy pathapiary.apib
1634 lines (1354 loc) · 59.6 KB
/
apiary.apib
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
FORMAT: 1A
HOST: https://api-dev.mycred.io
# CRED API
CredX comprehensive suite of APIs are designed for everyone looking to build powerful crypto-based financial applications. CredX APIs are grouped into multiple logical areas and provide for all-inclusive set of required capabilities. Altogether exposed service modules account for entire user journey from onboarding to service origination, funds disbursement to repayment, service propositioning to reporting. In addition, CredX APIs support all relevant wallet management functions, including collateral custody governance.
First fully developed array of modules available for application development is CredX innovative proposition of Crypto equity Line of Credit or C-LOC™. Crypto equity Line of Credit is a REVOLVING loan offering in which the funder agrees to lend a maximum amount within an agreed period of time, where the collateral is the borrower's equity in his/her crypto assets.
As we continue to evolve, we will be sharing other innovative services to enable our partners to build full spectrum of crypto based financial services software packages including investing, insurance, payment processing and other banking services.
## Users [/users]
In order to create a user on CredX platform and provision financial services applications, like C-LOC™, Cred needs to collect and verify user identity information. This ensures compliance with KYC/AML regulations. CredX platform operates as a gateway to global and local KYC bureaus to allow for widest possible geographical coverage in documents and identity verification.
### User signup [POST/api/v1/users]
User Signup API is the first step to user onboarding. This API returns a unique identifier for each user. Thus shared user id should be kept on the partner's system for future referencing or inquiries relating to user/account profile and activity.
+ Request (application/json)
+ Attributes
+ `user_name` (string) - email address of the member and needs to be unique per member
+ `country_code` (number) - the country code for the member’s mobile number
+ `mobile_number` (number) - mobile phone number of the member
+ `tc_Enabled` (boolean) - To indicate whether the member has agreed to Terms and Conditions as listed on the partner’s site/mobile app. If tc_enabled = false, the user will not be created
+ Body
{
"user_name": "[email protected]"
"country_code": "+1",
"mobile_number": "4156089756",
"tc_enabled": "true"
}
+ Headers
Authorization: Basic YWxhZGRpbjpvcGVuc2VzYW1l
+ Response 200 (application/json)
+ Attributes
+ `uid` (string) - user ID returned from CRED as unique user identifier
+ `user_name` (string) - email address of the member and needs to be unique per member
+ `country_code` (string) - the country code for the member’s mobile number
+ `mobile_number` (number) - mobile phone number of the member
+ `tc_Enabled` (boolean) - To indicate whether the member has agreed to Terms and Conditions as listed on the partner’s site/mobile app. If tc_enabled = false, the user will not be created
+ Body
{
"uid": "d4a44579-c996-4e30-a7c1-06245f1eb1fb",
"user_name": "[email protected]",
"country_code":"+1",
"mobile_number": "4153579089",
"tc_enabled": "true",
"partner_details": {
"partner_name":"PARTNER_X",
"partner_id":"d4a44579-c996-4e30-a7c1-06245f1eb1fb"
}
}
+ Response 401 (application/json)
{
"error": "Un-Authorized",
"code" : "001"
}
+ Response 400 (application/json)
{
"error": "Bad request",
"code" : "400"
}
### User KYC [POST/api/v1/users/{uid}/kyc]
User KYC API triggers adjudication process of user’s personal identification information (PII) as part of fulfilling KYC obligations. No financial services proposition can be offered to a user that did not pass CredX KYC adjudication. A partner should strictly allow only KYC-ed users to progress with CredX enabled financial services applications, like C-LOC™.
+ Parameters
+ `uid` (string) - User uid issued by CRED
+ Request (application/json)
+ Attributes
+ `first_name` (string)
+ `last_name` (string)
+ `address` (object)
+ `line1` (string)
+ `line2` (string)
+ `state` (string)
+ `zip` (string)
+ `country` (string)
+ `dob` (string) - date of birth in format mm/dd/yy
+ `resident` (string)
+ Body
{
"first_name": "John",
"last_name": "Doe",
"address": {
"line1": "487 Cumber Lane",
"line2": "Block 5",
"state": "CA",
"zip": "94105",
"country": "USA"
},
"dob":"12/31/91",
"document_id":"3456",
"resident": "US"
}
+ Headers
Authorization: Basic YWxhZGRpbjpvcGVuc2VzYW1l
+ Response 200 (application/json)
{
"uid": "d4a44579-c996-4e30-a7c1-06245f1eb1fb",
"first_name": "John",
"last_name": "Doe",
"status": "enabled",
"kyc": {
"status": "PENDING"
},
"address": {
"line1": "487 Cumber Lane",
"line2": "Block 5",
"state": "CA",
"zip": "94105",
"country": "USA"
},
"partner_details": {
"partner_name":"partner_example",
"partner_id":"d4a44579-c996-4e30-a7c1-06245f1eb1fb"
},
"mobile": "4150689089",
"country_code":"+1",
"tc_enabled": "true",
"dob":"12/31/91",
"user_name": "[email protected]",
"resident": "US"
}
+ Response 401 (application/json)
{
"error": "Un-Authorized",
"code" : "001"
}
+ Response 400 (application/json)
{
"error": "Bad request",
"code" : "400"
}
### Document verification [POST/api/v1/users/{uid}/kyc/verify/documents]
Document verification API is part of user comprehensive KYC adjudication. Submitted government issued ID will be fully authenticated through CredX to allow for completion of KYC process.
+ Parameters
+ `uid` (string) - User id issued by CRED
+ Request (application/json)
+ Attributes
+ `country_code` (string) - country code of the ID document issuing country
+ `document` (object)
+ `document_type` (string) - type of document for upload (DriverLicense, Passport, NatoinalID)
+ `document_front_image` (string) - image to be saved as base64imagestring
+ `document_back_image` (string) - image to be saved as base64imagestring
+ Body
{
{
"country_code": "US",
"document": {
"document_type": "DriverLicense",
"document_front_image": "base64imagestring",
"document_back_image": "base64imagestring",
}
}
}
+ Headers
Authorization: Basic YWxhZGRpbjpvcGVuc2VzYW1l
+ Response 200 (application/json)
{
"id": "H4a44579-c996-4e30-a7c1-879r",
}
+ Response 401 (application/json)
{
"error": "Un-Authorized",
"code" : "001"
}
+ Response 400 (application/json)
{
"error": "Bad request",
"code" : "400"ro
}
### Get user [GET/api/v1/users/{uid}]
The user's account status is updated throughout the lifecycle of the account. This API is used to get the most up-to-date status of the user account.
+ Parameters
+ `uid` (string) - user uid issued by CRED
+ Request (application/json)
+ Headers
Authorization: Basic YWxhZGRpbjpvcGVuc2VzYW1l
+ Response 200 (application/json)
+ Attributes
+ `first_name` (string)
+ `last_name` (string)
+ `status` (string) - Status of the user account. This can be enabled, suspended or disabled
+ `kyc` (object) - personal information submitted to Cred is used to run kyc via third party vendor. this provides details on the verification process
+ `status` (string) - APPROVED, PENDING or DECLINED
+ `address` (object)
+ `line1` (string)
+ `line2` (string)
+ `state` (string)
+ `zip` (string)
+ `country` (string)
+ `partner` (object) - partner parameters returned to partner by Cred
+ `partner_name`
+ `partner_id`
+ `mobile` (number)
+ `country_code` (number)
+ `tc_enabled` (boolean)
+ `dob` (string)
+ `user_name` (string)
+ `resident` (string)
+ Body
{
"uid": "d4a44579-c996-4e30-a7c1-06245f1eb1fb",
"first_name": "John",
"last_name": "Doe",
"status": "enabled",
"kyc": {
"status": "pending"
},
"address": {
"line1": "487 Cumber Lane",
"line2": "Block 5",
"state": "CA",
"zip": "94105",
"country": "USA"
},
"partner_details": {
"partner_name":"partner_example",
"uid":"d4a44579-c996-4e30-a7c1-06245f1eb1fb"
},
"mobile": "4150689089",
"country_code":"+1",
"tc_enabled": "true",
"status":"enabled",
"dob":"12/31/91",
"user_name": "[email protected]",
"resident": "US"
}
+ Response 401
{
"error": "Un-Authorized",
"code" : "001"
}
+ Response 400
{
"error": "Bad request",
"code" : "400"
}
## Loan proposition [/ltv]
Loan proposition API provides detailed and up to day information on the offering for a particular financial application, like a C-LOC™, in this case. Details, such as effective Interest Rate, Tenor, Origination Fee, Fair Market Value of crypto-collateral and other proposition components are returned to a partner to help build customized loan calculator.
### Loan proposition [GET/api/v1/settings/ltv]
+ Request
+ Headers
Authorization: Basic YWxhZGRpbjpvcGVuc2VzYW1l
+ Response 200 (application/json)
+ Attributes
+ `currency` (string) - currency of the C-LOC
+ `max_credit` (number) - maximum amount for C-LOC offer
+ `min_credit` (number) - minimum amount for C-LOC offer
+ `interet_rates` (object) - list of interest profiles for the C-LOC available for the partner
+ `borrower_residence` (string) - US or non-US
+ `tenor_in_months` (number) - the duration of loan term
+ `rate` (number) - interest rate in percentage
+ `discounts` (object) - discounted interest rate given to borrower who holds specific amount of utility reservse (currency) at the time of loan origination. The interest rate would be lowered by discount_step in percentage with each 1% of the utility reserve held. The discount range is defined by min_discount and max_discount. For example, for US borrower, they can hold LBA of at least 1% of the principal value of the loan at the time of origination to benefit from reduced interest rate from 12% to 11%. Borrower can hold up to 3% of LBA of loan amount to get the optimal discounted rate of 9% for their loan.
+ `discounts: currency` (string)
+ `min_discount: currency` (string)
+ `max_discount: currency` (string)
+ `discount_step: currency` (string)
+ `eth_ltv` (number) - loan to value ratio for Etherum as collateral
+ `btc_ltv` (number) - loan to value ratio for Bitcoin as collateral
+ `xrp_ltv` (number) - loan to value ratio for Ripple as collateralpdate
+ `fee_response` (object) - all the finance charges related to the C-LOC
+`administrative_fee` (number)
+`annual_fee` (number)
+`exchange_fee_in_percentage` (number)
+`late_fee` (number)
+`origiation_fee_in_percentage` (number)
+`over_limit_fee` (number)
+`returned_payment_fee` (number)
+ `daily_withdrawal_limit` (number) - daily withdrawal limit for C-LOC which borrower must adhere to
+ Body
{
{
"currency":"USD",
"max_credit":200000,
"min_credit":2000,
"interest_rates":[
{
"borrower_residence":"US",
"tenor_in_months":36,
"rate":12,
"discounts":[
{
"currency":"LBA",
"min_discount":1,
"max_discount":3,
"discount_step":1
}
]
},
{
"borrower_residence":"NON-US",
"tenor_in_months":36,
"rate":15,
"discounts":[
{
"currency":"LBA",
"min_discount":1,
"max_discount":6,
"discount_step":1
}
]
}
],
"eth_ltv":0.50,
"btc_ltv":0.50,
"xrp_ltv":0.50,
"fees_response": {
"administrative_fee":0,
"annual_fee":0,
"exchange_fee_in_percentage":0,
"late_fee":0,
"origination_fee_in_percentage":0,
"over_limit_fee":0,
"returned_payment_fee":0
},
"daily_withdrawal_limit": 0,
}
}
+ Response 400 (application/json)
{
"error": "Bad request",
"code" : "400"
}
### Fair Market Value of coins [GET/api/v1/oracle/fmv?convert={convert}&numberOfCoins={numberOfCoins}&symbol={symbol}]
+ Parameters
+ convert (required) - Legal money symbol to get fair market value for (ISO 4217 Currency Codes)
+ numberOfCoins (required) - Number of coins intended to pledge for collateral
+ symbol (required) - Coin symbol (BTC, ETH or XRP)
+ Request
+ Headers
Authorization: None
+ Response 200 (application/json)
+ Attributes
+ `symbol` (string) - Coin symbol (BTC, ETH or XRP)
+ `convert` (string) - Legal money symbol to get fair market value for (ISO 4217 Currency Codes)
+ `number_of_coins` (number) - Number of coins intended to pledge for collateral
+ `fair_market_value` (number) - Fair market value of pledged collateral
+ Body
{
"symbol": "ETH",
"convert": "USD",
"number_of_coins": 1,
"fair_market_value": 113.583
}
+ Response 400 (application/json)
{
"error": "Bad request",
"code" : "400"
}
## Quotes [/quotes]
This API triggers official quote generation based on borrower’s specified loan requirements, such as collateral type, desired credit limit, expressed interest to stake utility coins and other loan customizing parameters. Each C-LOC™ quote is returned with a quoteID for future referencing. Thus generated quote has a validity of 3 hours from the time of issue. For a valid loan account to be originated it is within the next 3 hours the returned quote will need to be accepted by a borrower, borrower’s collateral to be transferred to Cred and Cred loan agreement to be electronically signed.
### Create quote request [POST/api/v1/users/{uid}/quotes]
+ Parameters
+ `uid` (string) - User uid issued by CRED
+ Request (application/json)
+ Attributes
+ `collateral` (object) - number of coin for each cryptocurrency to be pleged as colalteral. currently, we support BTC, ETH, and XRP
+ `btc` (number)
+ `eth` (number)
+ `xrp` (number)
+ `currency` (string) - the currency which customer wants to get a loan in (i.e. USD)
+ `interest_rate_rebates` (object) - the type and number of utility token to stake for discounted C-LOC interest rate
+ `currency` (string) - type of utiltiy token for staking (i.e. LBA)
+ `percentage` (number) - percentage of total loan amount for staking
+ tenor_in_months (number) - loan term in number of months
+ Body
{
"collateral":{
"btc":2,
"eth":1,
"xrp":0
},
"currency":"USD",
"interest_rate_rebates":[
{
"currency":"LBA",
"percentage":1
}
],
"tenor_in_months":36
}
+ Headers
Authorization: Basic YWxhZGRpbjpvcGVuc2VzYW1l
+ Response 200 (application/json)
+ Attributes
+ `id` (string) - quote ID returned for reference
+ `uid` (string) - the user ID for which this quote is created for
+ `status` (string) - status of the C-LOC quote (PENDING, EXPIRED, INACTIVE)
+ `credit_line` (number) -
+ `currency` (string) - the currency which customer wants to get a loan in (i.e. USD)
+ `annual_interest_percent` (number)
+ `tenor_in_months` (number)
+ `daily_withdrawal_limit` (number)
+ `over_limit_allowance_amount` (number)
+ `over_limit_allowance_count_per_billing` (number)
+ `fee` (object)
+ `annual_fee` (number)
+ `origination_fee_in_percentage` (number)
+ `administrative_fee` (number)
+ `late_fee` (number)
+ `over_limit_fee` (number)
+ `returned_payment_fee` (number)
+ `exchange_fee_in_percentage` (number)
+ `collateral` (object) - number of coin for each cryptocurrency to be pleged as colalteral. currently, we support BTC, ETH, and XRP
+ `btc` (number)
+ `eth` (number)
+ `xrp` (number)
+ `currency` (string) - the currency which customer wants to get a loan in (i.e. USD)
+ `interest_rate_rebates` (object) - the type and number of utility token to stake for discounted C-LOC interest rate
+ `currency` (string) - type of utiltiy token for staking (i.e. LBA)
+ `percentage` (number) - percentage of total loan amount for staking
+ `tenor_in_months` (number) - loan term in number of months
+ `expiration_date` (string) - timestamp on when the C-LOC quote would expire
+ Body
{
"id":"461022b1-9875-437c-b83f-6bc4c6e64434",
"uid":"c61fbb14-64f3-4693-b904-f799ff1dd84a",
"status":"PENDING",
"msg":"",
"credit_line":0,
"currency":"USD",
"annual_interest_percent":0,
"tenor_in_months":36,
"daily_withdrawal_limit":0,
"over_limit_allowance_amount":0,
"over_limit_allowance_count_per_billing":0,
"fees":{
"annual_fee":0,
"origination_fee_in_percentage":0,
"administrative_fee":0,
"late_fee":0,
"over_limit_fee":0,
"returned_payment_fee":0,
"exchange_fee_in_percentage":0
},
"collateral":{
"btc":2,
"eth":1,
"xrp":0
},
"discount":0,
"interest_rate_rebates":[
{
"currency":"LBA",
"percentage":1
}
],
"expiration_date":"2018-11-28T12:17:50.475+0000"
}
+ Response 401 (application/json)
{
"error": "Un-Authorized",
"code" : "001"
}
+ Response 400 (application/json)
{
"error": "Bad request",
"code" : "400"
}
### Get quote [GET/api/v1/users/uid/quotes/quoteId]
Retrieve C-LOC quote status (i.e. approved, expired etc) and details using the quoteID returned from POST
+ Parameters:
+ `uid` (string) - User uid issued by CRED
+ `quoteId` (string) - quoteId issued by cred during quote create request.
+ Request (application/json)
+ Headers
Authorization: Basic YWxhZGRpbjpvcGVuc2VzYW1l
+ Response 200 (application/json)
{
"id":"461022b1-9875-437c-b83f-6bc4c6e64434",
"uid":"c61fbb14-64f3-4693-b904-f799ff1dd84a",
"status":"APPROVED",
"msg":"",
"credit_line":2637.742,
"currency":"USD",
"annual_interest_percent":14,
"tenor_in_months":36,
"daily_withdrawal_limit":7500,
"over_limit_allowance_amount":100,
"over_limit_allowance_count_per_billing":3,
"fees":{
"annual_fee":0,
"origination_fee_in_percentage":3,
"administrative_fee":0,
"late_fee":39,
"over_limit_fee":29,
"returned_payment_fee":30,
"exchange_fee_in_percentage":1
},
"collateral":{
"btc":2,
"eth":1,
"xrp":0
},
"discount":1,
"interest_rate_rebates":[
{
"currency":"LBA",
"percentage":1
}
],
"expiration_date":"2018-11-28T15:18:04.000+0000"
}
+ Response 401
{
"error": "Un-Authorized",
"code" : "001"
}
+ Response 400
{
"error": "Bad request",
"code" : "400"
}
### Get all user quotes [GET/api/v1/users/{uid}/quotes/]
Request all the quotes for a specific user
+ Parameters:
+ `uid` (string) - User uid issued by CRED
+ Request (application/json)
+ Headers
Authorization: Basic YWxhZGRpbjpvcGVuc2VzYW1l
+ Response 200 (application/json)
{
"content": [
{
"id":"461022b1-9875-437c-b83f-6bc4c6e64434",
"uid":"c61fbb14-64f3-4693-b904-f799ff1dd84a",
"status":"PENDING",
"msg":"",
"credit_line":0,
"currency":"USD",
"annual_interest_percent":0,
"tenor_in_months":36,
"daily_withdrawal_limit":0,
"over_limit_allowance_amount":0,
"over_limit_allowance_count_per_billing":0,
"fees":{
"annual_fee":0,
"origination_fee_in_percentage":0,
"administrative_fee":0,
"late_fee":0,
"over_limit_fee":0,
"returned_payment_fee":0,
"exchange_fee_in_percentage":0
},
"collateral":{
"btc":2,
"eth":1,
"xrp":0
},
"discount":0,
"interest_rate_rebates":[
{
"currency":"LBA",
"percentage":1
}
],
"expiration_date":"2018-11-28T12:17:50.475+0000"
}
],
"pageable": {
"sort": {
"unsorted": true,
"sorted": false
},
"page_number": 0,
"page_size": 20,
"offset": 0,
"paged": true,
"unpaged": false
},
"total_pages": 1,
"last": true,
"total_elements": 1,
"first": true,
"sort": {
"unsorted": true,
"sorted": false
},
"number_of_elements": 1,
"size": 20,
"number": 0
}
+ Response 401 (application/json)
{
"error": "Un-Authorized",
"code" : "001"
}
+ Response 400 (application/json)
{
"error": "Bad request",
"code" : "400"
}
## C-LOC [/cloc]
### Create C-LOC [POST/api/v1/users/{uid}/cloc]
This API is responsible for loan account origination and is based on acceptance of previously shared official quote, captured borrower’s e-signature on Cred’s loan agreement and successful transfer of crypto collateral. Before collateral is received in Cred’s custody, borrower’s C-LOC account will be in ‘pend’ state. Once receipt of collateral is confirmed the status of C-LOC account will be updated to ‘active’. See below Get C-LOC API for C-LOC account status inquiry call.
+ Parameters
+ `uid` (string)- User uid issued by CRED
+ Request (application/json)
+ Attributes
+ `esignature` (string) - concatenation of IP address and timestamp when user signs the loan agreement. This is used as official e-signature for the C-LOC agreement.
+ `funding_method` - contains all the details for asset transfer
+ `collateral` (object) - contains details on collateral to be pledged to obtain C-LOC
+ `currency` (string) - cryptocurrency type to be used for collateral (BTC, ETH, XRP)
+ `ref_id` (string) - reference ID of source wallet address for collateral (i.e. public wallet address or other reference)
+ `transfer_method` (string) - method of cryptocurrency transfer for the collateral (i.e CRED, ONUS, ACH, DEBITCARD, SEPA)
+ `stake` (object) - contains details on utility tokens to be held for the discounted interest rate
+ `currency` (string) - utility token (LBA)
+ `ref_id` (string) - reference ID of source wallet address for utility tokens (i.e. public wallet address or other reference)
+ `transfer_method` (string) - method of cryptocurrency transfer for the reserved tokens (i.e CRED, ONUS, ACH, DEBITCARD, SEPA)
+ `destination account` (object) - contains details for withdrawal account
+ `currency` (string) - currency for withdrawal for the C-LOC
+ `ref_id` (string) - reference ID of customer's withdrawal account (i.e. bank account number, debit card number)
+ `transfer_method` (string) - method for disbursing fiat for C-LOC withdrawal (i.e ONUS, ACH, DEBITCARD, SEPA)
+ `source account` (object) - contains details for repayment account
+ `currency` (string) - currency for C-LOC repayment
+ `ref_id` (string) - reference ID of customer's repayment account (i.e. bank account number, debit card number)
+ `transfer_method` (string) - method for repayment (i.e ONUS, ACH, DEBITCARD, SEPA)
+ `quote_id` (string) - quote ID returned from Cred upon C-LOC quote creation
+ Body
{
"esignature":"34.234.234.23-2018-11-11T20:45:55.000+0000",
"funding_method":{
"collateral":[
{
"currency":"BTC",
"ref_id":"82b27574-9637-4156-9202-9657442ceffd",
"transfer_method":"CRED"
}
],
"stake":[
{
"currency":"LBA",
"ref_id":"89b27574-9637-4156-9202-9657442ceffd",
"transfer_method":"CRED"
}
]
"destination_account":{
"currency":"USD",
"ref_id":"92b27574-9637-4156-9202-9657442ceffd",
"transfer_method":"DEBITCARD"
},
"source_account":{
"currency":"USD",
"ref_id":"11b27574-9637-4156-9202-9657442ceffd",
"transfer_method":"ACH"
},
},
"quote_id":"461022b1-9875-437c-b83f-6bc4c6e64434"
}
+ Response 200 (applicantion/json)
+ Attributes
+ `id` (string) - C-LOC id generated for reference
+ `uid` (string) - the user ID submitted in the create C-LOC request
+ `quote_id` (string) - the quote id as it relates to this specific C-LOC agreement
+ `status` (string) - status of C-LOC account (PENDING, ACTIVE, SUSPENDED)
+ `msg` (string) - additional message for notes if the C-LOC account is SUSPENDED
+ `credit_line` (number) - credit line amount for the C-LOC account
+ `annual_interest_percent` (number) - interest rate for this C-LOC account
+ `discount` (number) - discounted interest rate for this C-LOC account
+ `tenor_in_months` (number) - the duration of the C-LOC account in months
+ `origination_date` (string) - the date when collateral was received and C-LOC account was created
+ `available_credit` (number) - the total amount of funds avaiable for withdrawal
+ `ltv` (number) - loan to value ratio for the type of collteral pledged
+ `maintenace_ltv` (number) - loan to value ratio at which the C-LOC must remain to not trigger default notification
+ `annual_interest_percent` (number) -
+ `daily_withdrawal_limit` (number) - the daily maximum amount of funds allowed for withdrawal
+ `over_limit_allowance_amount` (number) - tolerance for over limit withdrawal
+ `over_limit_allowance_count_per_billing` (number) - number of times allowed for over withdrawal per billing cycle
+ `billing_cycle` (string) - MONTH
+ `accounting_standing` (number) -
+ `outstanding_balance` (number) -
+ `principal_standing` (number) -
+ `total_charges` (number) -
+ `current_cycle_interest` (number) -
+ `current_cycle_fees` (number) -
+ `net_current_charges` (number) -
+ `minimum_payment_due_date`(string) -
+ `billed_interest`(string) -
+ `billed_fees`(string) -
+ `net_billed_charges`(string) -
+ `funding_method` - contains all the details for asset transfer
+ `collateral` (object) - contains details on collateral to be pledged to obtain C-LOC
+ `currency` (string) - cryptocurrency type to be used for collateral (BTC, ETH, XRP)
+ `ref_id` (string) - reference ID of source wallet address for collateral (i.e. public wallet address or other reference)
+ `transfer_method` (string) - method of cryptocurrency transfer for the collateral (i.e CRED, ONUS, ACH, DEBITCARD, SEPA)
+ `stake` (object) - contains details on utility tokens to be held for the discounted interest rate
+ `currency` (string) - utility token (LBA)
+ `ref_id` (string) - reference ID of source wallet address for utility tokens (i.e. public wallet address or other reference)
+ `transfer_method` (string) - method of cryptocurrency transfer for the reserved tokens (i.e CRED, ONUS, ACH, DEBITCARD, SEPA)
+ `destination account` (object) - contains details for withdrawal account
+ `currency` (string) - currency for withdrawal for the C-LOC
+ `ref_id` (string) - reference ID of customer's withdrawal account (i.e. bank account number, debit card number)
+ `transfer_method` (string) - method for disbursing fiat for C-LOC withdrawal (i.e ONUS, ACH, DEBITCARD, SEPA)
+ `source account` (object) - contains details for repayment account
+ `currency` (string) - currency for C-LOC repayment
+ `ref_id` (string) - reference ID of customer's repayment account (i.e. bank account number, debit card number)
+ `transfer_method` (string) - method for repayment (i.e ONUS, ACH, DEBITCARD, SEPA)
+ `fees` (object)
+ `annual_fee` (number)
+ `origination_fee` (number)
+ `administrative_fee` (number)
+ `late_fee` (number)
+ `over_limit_fee` (number)
+ `returned_payment_fee` (number)
+ `exchange_fee_in_percentage` (number)
+ `collateral` (object)
+ `btc` (number)
+ `eth` (number)
+ `xrp` (number)
+ `interest_rate_rebates` (object)
+ `currency` (string) - LBA
+ "percentage` (number)
+ `booking_information` (object)
+ `country`(string) - US
+ `currency` (string) - USD
+ `timezone` (string) - EST
+ `esignature` (string) -
+ Body
{
"id":"f92a6141-c567-469f-af47-d66457722762",
"uid":"c61fbb14-64f3-4693-b904-f799ff1dd84a",
"quote_id":"461022b1-9875-437c-b83f-6bc4c6e64434",
"status":"PENDING",
"msg":"",
"credit_line":200000,
"annual_interest_percent":9,
"discount":1,
"tenor_in_months":36,
"origination_date":"2018-11-28T13:59:16.848+0000",
"available_credit":20000,
"ltv":0.5,
"maintenance_ltv":0.7,
"daily_withdrawal_limit":7500,
"over_limit_allowance_amount":100,
"over_limit_allowance_count_per_billing":3,
"billing_cycle":"MONTH",
"account_standing":0,
"outstanding_balance":0,
"principal_outstanding":0,
"total_charges":0,
"current_cycle_interest":0,
"current_cycle_fees":0,
"net_current_charges":0,
"minimum_payment_due_date":"2018-11-28T13:59:16.848+0000",
"billed_interest":0,
"billed_fees":0,
"net_billed_charges":0,
"funding_method":{
"collateral":[
{
"currency":"BTC",
"ref_id":"82b27574-9637-4156-9202-9657442ceffd",
"transfer_method":"CRED"
}
],
"stake":[
{
"currency":"LBA",
"ref_id":"89b27574-9637-4156-9202-9657442ceffd",
"transfer_method":"CRED"
}
],
"destination_account":{
"currency":"USD",
"ref_id":"92b27574-9637-4156-9202-9657442ceffd",
"transfer_method":"DEBITCARD"
},
"source_account":{
"currency":"USD",
"ref_id":"11b27574-9637-4156-9202-9657442ceffd",
"transfer_method":"DEBITCARD"
},
},
"fees":{
"annual_fee":0,
"origination_fee":0,
"administrative_fee":0,
"late_fee":0,
"over_limit_fee":0,
"returned_payment_fee":0,
"exchange_fee_in_percentage":0
},
"collateral":{
"btc":2,
"eth":1,
"xrp":0
},
"interest_rate_rebates":[
{
"currency":"LBA",
"percentage":1
}
],
"booking_information":{
"country": "US",
"currency": "USD",
"timezone": "EST"
},
"esignature":"34.234.234.23-2018-11-11T20:45:55.000+0000"
}
+ Response 401 (application/json)
{
"error": "Un-Authorized",
"code" : "001"
}
+ Response 400 (application/json)
{
"error": "Bad request",
"code" : "400"
}
### Get C-LOC [GET/api/v1/users/{uid}/cloc/{clocId}]
Get C-LOC account information by id for a given user
+ Parameters:
+ `uid` (string) - User uid issued by CRED
+ `clocId` (string) - c-loc account id issued by CRED
+ Request (application/json)
+ Headers
Authorization: Basic YWxhZGRpbjpvcGVuc2VzYW1l
+ Response 200 (application/json)
{
"id":"f92a6141-c567-469f-af47-d66457722762",