-
Notifications
You must be signed in to change notification settings - Fork 5
/
openapi.yaml
3681 lines (3681 loc) · 111 KB
/
openapi.yaml
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
openapi: 3.0.1
info:
title: C4C REST API
description: Access to the Crowd4Cash Crowdlending Platform through an API
version: 2.0.0
termsOfService: https://crowd4cash.ch/api2.license.html
contact:
name: Crowd Solutions AG
url: https://crowd4cash.ch
email: info@crowd4cash.ch
x-konfig-ignore:
object-with-no-properties: true
potential-incorrect-type: true
servers:
- url: https://api2.crowd4cash.ch
tags:
- name: Application
- name: Contracts
- name: Reports
- name: Bidding
- name: Portfolio
- name: Authentication
- name: Opportunities
- name: Loans
paths:
/Authenticate:
post:
tags:
- Authentication
summary: Authenticate yourself and get an access token
operationId: Authentication_getToken
requestBody:
description: Your username and password
content:
application/json:
schema:
$ref: '#/components/schemas/Login'
responses:
'200':
description: Successfully Authenticated
content:
application/json:
schema:
$ref: '#/components/schemas/Token'
'400':
description: Invalid Login
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
/Loan:
post:
tags:
- Application
summary: Apply for a regular loan - 100% online application
operationId: Application_submitLoanApplication
security:
- Bearer: []
description: >-
**Note**: Approval and funding times vary, but typically it takes only
24 hours.
requestBody:
description: ''
content:
application/json:
schema:
$ref: '#/components/schemas/LoanApplication'
responses:
'200':
description: Successful Loan Application
content:
application/json:
schema:
$ref: '#/components/schemas/ApplicationResult'
'400':
description: Bad Request
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'401':
description: Unauthorized
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
/IntermediaryLoan:
post:
tags:
- Application
summary: Apply for a loan on behalf of your partners e.g. garages/shops/stores
operationId: Application_submitPartnerLoanApplication
security:
- Bearer: []
description: >-
**Note**: Each successful application creates a binding obligation on
you. Once you apply you may not retract the application.
requestBody:
description: ''
content:
application/json:
schema:
$ref: '#/components/schemas/IntermediaryLoanApplication'
responses:
'200':
description: Successful Loan Application
content:
application/json:
schema:
$ref: '#/components/schemas/ApplicationResult'
'400':
description: Bad Request
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'401':
description: Unauthorized
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
put:
tags:
- Application
summary: >-
Set the definitive Handover Date (a date when the item is handed over to
the customer)
operationId: Application_setDefinitiveHandoverDate
security:
- Bearer: []
description: >-
**Note**: It's valid only for loans made indirectly through the
intermediary.
requestBody:
description: ''
content:
application/json:
schema:
$ref: '#/components/schemas/IntermediaryLoanHandoverDate'
responses:
'200':
description: Success
content:
application/json:
schema:
$ref: '#/components/schemas/ApplicationResult'
'400':
description: Bad Request
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'401':
description: Unauthorized
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
/RentalLoan:
post:
tags:
- Application
summary: Apply for a rental loan
operationId: Application_submitRentalLoanApplication
security:
- Bearer: []
description: >-
**Note**: Each successful application creates a binding obligation on
you. Once you apply you may not retract the application.
requestBody:
description: ''
content:
application/json:
schema:
$ref: '#/components/schemas/RentalLoanApplication'
responses:
'200':
description: Successful Loan Application
content:
application/json:
schema:
$ref: '#/components/schemas/RentalApplicationResult'
'400':
description: Bad Request
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'401':
description: Unauthorized
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
/Opportunities:
get:
tags:
- Opportunities
summary: Get available investment opportunities
operationId: Opportunities_getAvailableInvestments
security:
- Bearer: []
description: >-
__Note__: C4C offers a private, secure and uncomplicated way for the
investors to discover, analyze, review and invest.
parameters:
- description: >-
Evaluation of the credit risk based on a borrower's credit history,
quality of the collateral, and the likelihood of repayment e.g. AA
name: Rating
in: query
schema:
$ref: '#/components/schemas/LoanRating'
- description: Loan amount e.g. 25000
name: LoanAmount
in: query
schema:
type: number
format: double
- description: Type of the loan e.g. Private, SME
name: LoanType
in: query
schema:
type: string
- description: >-
Available amount to be invested at the moment of our API consuming
e.g. 2000
name: AvailableAmount
in: query
schema:
type: number
format: double
- description: Interest rate of the loan in % e.g. 5.6
name: InterestRate
in: query
schema:
type: number
format: double
- description: Duration in months e.g. 24
name: Duration
in: query
schema:
type: integer
format: int32
- description: Is loan issured? - Yes, No
name: Insurance
in: query
schema:
$ref: '#/components/schemas/YN'
- description: Is loan collaterialized? - Yes, No
name: Collateral
in: query
schema:
$ref: '#/components/schemas/YN'
- description: Age of the borrower e.g. 42
name: BorrowerAge
in: query
schema:
type: integer
format: int32
- description: Nationality of the borrower, e.g Switzerland, Liechtenstein ...
name: BorrowerNationality
in: query
schema:
type: string
responses:
'200':
description: Investment Opportunities List
content:
application/json:
schema:
$ref: '#/components/schemas/Opportunity'
'400':
description: Bad Request
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'401':
description: Unauthorized
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'404':
description: No opportunities at the moment
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
/Bid:
post:
tags:
- Bidding
summary: Place a bid on certain loan
operationId: Bidding_placeBid
security:
- Bearer: []
description: >-
**Note**: Each successful bid creates a binding obligation on you. Once
you place you may not retract your bid.
requestBody:
description: ''
content:
application/json:
schema:
$ref: '#/components/schemas/Bid'
responses:
'200':
description: Successful Bidding
content:
application/json:
schema:
$ref: '#/components/schemas/BiddingResult'
'400':
description: Bad Request
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
/Bids:
post:
tags:
- Bidding
summary: Place bids on behalf of your connected investor(s)
operationId: Bidding_submitBids
security:
- Bearer: []
description: >-
**Note**: Crowd4Cash allows you to invest as agent on behalf of other
investors. You can submit multiple bids on the same request.
requestBody:
description: ''
content:
application/json:
schema:
$ref: '#/components/schemas/BiddingSubmitBidsRequest'
responses:
'200':
description: Successful Bidding
content:
application/json:
schema:
$ref: '#/components/schemas/MultipleBiddingResult'
'400':
description: Bad Request
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
/Contracts:
get:
tags:
- Contracts
summary: Get all your contracts
operationId: Contracts_getAll
security:
- Bearer: []
responses:
'200':
description: Loan Agreements List
content:
application/json:
schema:
$ref: '#/components/schemas/Contract'
'400':
description: Bad Request
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'401':
description: Unauthorized
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'404':
description: No loan agreements found
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
/Contracts/{loanId}:
get:
tags:
- Contracts
summary: Get specific contract
operationId: Contracts_getSpecific
security:
- Bearer: []
parameters:
- name: loanId
in: path
required: true
schema:
type: integer
format: int32
responses:
'200':
description: Loan Agreement
content:
application/json:
schema:
$ref: '#/components/schemas/Contract'
'400':
description: Bad Request
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'401':
description: Unauthorized
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'404':
description: No loan agreement found
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
/Contracts/{partnerId}/{loanId}:
get:
tags:
- Contracts
summary: Get specific intermediary loan contract
operationId: Contracts_getSpecificIntermediaryLoanContract
security:
- Bearer: []
parameters:
- name: partnerId
in: path
required: true
schema:
type: integer
format: int32
- name: loanId
in: path
required: true
schema:
type: integer
format: int32
responses:
'200':
description: Loan Agreement
content:
application/json:
schema:
$ref: '#/components/schemas/Contract'
'400':
description: Bad Request
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'401':
description: Unauthorized
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'404':
description: No loan agreement found
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
/Contracts/RentalLoan/{loanId}:
get:
tags:
- Contracts
summary: Get specific rental loan contract
operationId: Contracts_getLoanContract
security:
- Bearer: []
parameters:
- name: loanId
in: path
required: true
schema:
type: integer
format: int32
responses:
'200':
description: Loan Agreement
content:
application/json:
schema:
$ref: '#/components/schemas/Contract'
'400':
description: Bad Request
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'401':
description: Unauthorized
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'404':
description: No loan agreement found
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
/Portfolio:
get:
tags:
- Portfolio
summary: Get your investment portfolio
operationId: Portfolio_getInvestments
security:
- Bearer: []
parameters:
- name: from
in: query
schema:
type: string
- name: to
in: query
schema:
type: string
responses:
'200':
description: Investment Portfolio Info
content:
application/json:
schema:
$ref: '#/components/schemas/Portfolio'
'400':
description: Bad Request
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
/CustomPortfolio:
get:
tags:
- Portfolio
summary: Get your customized investment portfolio
operationId: Portfolio_getCustomizedPortfolio
security:
- Bearer: []
description: >-
__Note__: If the standard portfolio doesn't suit your needs, please
[contact C4C](https://crowd4cash.ch/contact) to request customization
parameters:
- description: ''
name: from
in: query
schema:
type: string
- description: ''
name: to
in: query
schema:
type: string
responses:
'200':
description: Investment Portfolio Info
content:
application/json:
schema:
$ref: '#/components/schemas/Portfolio'
'400':
description: Bad Request
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
/Connector:
get:
tags:
- Reports
summary: >-
Get your connector account summary and investments of the connected
investors
operationId: Reports_getConnectorInvestments
security:
- Bearer: []
description: >-
__Note__: It's valid only for investments made indirectly through
connector
responses:
'200':
description: Investments List
content:
application/json:
schema:
$ref: '#/components/schemas/ConnectorReport'
'400':
description: Bad Request
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
/Intermediary:
get:
tags:
- Reports
summary: Get your intermediary account summary and your partner loans data
operationId: Reports_getIntermediaryData
security:
- Bearer: []
description: >-
__Note__: It's valid only for loans made indirectly through the
intermediary
responses:
'200':
description: Account Overview
content:
application/json:
schema:
$ref: '#/components/schemas/IntermediaryReport'
'400':
description: Bad Request
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
/Rental:
get:
tags:
- Reports
summary: Get your rental account summary and your loans data
operationId: Reports_rentalAccountSummary
security:
- Bearer: []
description: '__Note__: It''s valid only for loans made through this API'
responses:
'200':
description: Account Overview
content:
application/json:
schema:
$ref: '#/components/schemas/RentalReport'
'400':
description: Bad Request
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
/Loans:
get:
tags:
- Loans
summary: Get a complete C4C loan data dataset for your credit analyses
operationId: Loans_getLoanData
security:
- Bearer: []
description: >-
**Note**: In order to consume this endpoint we need to grant a special
access to your account. Please [contact
us](https://crowd4cash.ch/contact) for further information.
parameters:
- description: Page number you want to access
name: PageNumber
in: query
required: true
schema:
type: integer
format: int32
- description: Number of items per page. Max is 20
name: PageSize
in: query
required: true
schema:
type: integer
format: int32
- description: Status values that need to be considered for filter
name: loanstatus
in: query
required: true
schema:
$ref: '#/components/schemas/Status'
responses:
'200':
description: Loan Data Dataset
content:
application/json:
schema:
$ref: '#/components/schemas/PagedList'
'400':
description: Bad Request
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'401':
description: Unauthorized
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
components:
schemas:
AccountDetails:
type: object
properties:
availableCash:
description: Receivables that are not paid to investor
type: number
format: double
example: 250.32
availableCashCurrency:
description: Currency
type: string
nullable: true
example: CHF
accountValue:
description: Current principal balance + available cash
type: number
format: double
example: 4750.32
investedAmount:
description: Current principal balance
type: number
format: double
example: 4500
numberOfInvestments:
description: Current number of investments
type: integer
format: int32
example: 5
losses:
description: The sum of "bad debt" and "default"
type: number
format: double
example: 250
AccountStatement:
description: Information about the payment of the instalments by the borrower
type: object
properties:
entries:
type: array
items:
$ref: '#/components/schemas/AccountStatementEntry'
nullable: true
AccountStatementEntry:
description: Information about the each payment by the borrower
type: object
properties:
annuityNumber:
description: Number of the borrower instalment
type: integer
format: int32
example: 5320
dueDate:
description: Instalment due date
type: string
nullable: true
example: 26.02.2021
messageDate:
description: A date when the instalment is paid by borrower
type: string
nullable: true
example: 01.03.2021
matchingDate:
description: A date when payment is booked in C4C system
type: string
nullable: true
example: 01.03.2021
amount:
description: An amount paid by the borrower
type: number
format: double
example: 945.78
AccountSummary:
type: object
properties:
openingBalance:
description: Balance at the beggining of the month
type: number
format: double
example: 0
interest:
description: >-
Interest that investor receives for all investments during the
months
type: number
format: double
example: 50.3
defaultInterest:
description: Interest that investor receives for the late payments
type: number
format: double
example: 10.25
principal:
description: Principal paid to investor during the month
type: number
format: double
example: 150
investments:
description: Investor's investments during the month
type: number
format: double
example: 6000
commission:
description: Commission paid by investor during the month
type: number
format: double
example: 10
deposits:
description: Paid bids by investor during the months
type: number
format: double
example: 600
withdrawals:
description: >-
Deposits returned to investor during the month, due to cancelation
of the agreement by the borrower
type: number
format: double
example: 0
closingBalance:
description: Balance at the end of the month
type: number
format: double
example: 0
ActiveBid:
description: Offers made by the other investors
type: object
properties:
pseudonym:
description: Investor pseudonym
type: string
nullable: true
dateCreated:
description: Bidding date
type: string
nullable: true
amount:
description: Bid amount
type: number
format: double
AmortizationSchedule:
description: Complete table of monthly payments to investor
type: object
properties:
payments:
type: array
items:
$ref: '#/components/schemas/SchedulePayment'
nullable: true
ApplicationResult:
description: ''
type: object
properties:
result:
description: Success or Error
type: string
nullable: true
message:
description: Message of the action
type: string
nullable: true
loanId:
description: ID of the newly created loan
type: integer
format: int32
esr:
description: ESR of the newly created loan
type: string
nullable: true
error:
description: If no error, it's empty
type: string
nullable: true
AutoInvestSettings:
type: object
properties:
automaticBuilder:
$ref: '#/components/schemas/AutomaticBuilder'
manualBuilder:
$ref: '#/components/schemas/ManualBuilder'
AutomaticBuilder:
type: object
properties:
builderOption:
$ref: '#/components/schemas/AutomaticBuilderOption'
AutomaticBuilderOption:
type: object
properties:
id:
description: Id of the automatic portfolio builder
type: integer
format: int32
example: 370
investmentCurrently:
description: Current investment using automatic autoinvest
type: number
format: double
example: 6000
totalAmountForInvestment:
description: Total amount that can be invested using automatic autoinvest
type: number
format: double
example: 10000
originators:
description: Who's create/update the automatic portfolio builder?
type: string
nullable: true
example: Crowd Solutions AG
interestRateFrom:
description: Minimum interest rate of the loan in which investor wants to invest
type: number
format: double
example: 4
interestRateTo:
description: Mаџимум interest rate of the loan in which investor wants to invest
type: number
format: double
example: 8
maximumPerBid:
description: Maximum bid amount per loan
type: number
format: double
example: 2500
minimumPerBid:
description: Minimum bid amount per loan
type: number
format: double
example: 500
reinvest:
description: Can investments be reinvested? - yes, no
type: boolean
investmentLevel:
description: Investment level - conservative, balanced, growth
type: string
nullable: true
example: balanced
secondaryMarket:
description: Can investment be sold on the secondary market? - yes, no
type: boolean
isActive:
description: Is automatic portfolio builder active? - yes, no
type: boolean
durationFrom:
description: Date when automatic autoinvest starts to be used
type: integer
format: int32
durationTo:
description: Date when automatic autoinvest ends to be used
type: integer
format: int32
currency:
description: Currency
type: string
nullable: true
example: CHF
Bid:
description: Placing a bid on certain loan
required:
- amount
- loanId
type: object
properties:
loanId:
description: Loan ID which you want to invest in
type: integer
format: int32
amount:
description: Amount of the bid
type: number
format: double
BiddingResult:
type: object
properties:
result:
description: Success or Error
type: string
nullable: true
error:
description: If no error, it's empty
type: string
nullable: true
Company:
description: A company that takes out a loan
type: object
properties:
legalForm:
description: Legal form of the company
type: string
nullable: true
example: Public limited company, Cooperative, Association, Foundation etc.
yearEstablished:
description: Year established in the commercial resgister
type: integer
format: int32
nullable: true
example: 1996
city:
description: Company headquarter
type: string
nullable: true