Hide last authors
David Persson 3.1 1 (% class="jumbotron" %)
2 (((
3 (% class="container" %)
4 (((
David Persson 6.1 5 Integrate to **PayEx Credit Account Onboarding API **
David Persson 3.1 6 )))
7 )))
8
Adam Ingmansson 34.1 9 (% id="HChangelog" %)
David Persson 30.1 10 = Changelog =
11
David Persson 46.1 12 2020-03-02
13
14 * Added statuses on applicationresource: "InitializedSigning" and "SigningFailed"
15
David Persson 42.1 16 2020-02-28
17
18 * minor changes in kyc object structure
19
David Persson 30.1 20 2020-02-14
21
22 * changed KYC object in ApplicationResource
23
Adam Ingmansson 35.1 24 (% class="lead" id="HThisAPIisusedtolistcurrentlyavailablecreditaccountoffersaswellastheassociatedonboardingprocess" %)
David Persson 18.1 25 This API is used to list currently available credit account offers as well as the associated onboarding process
David Persson 17.1 26
Adam Ingmansson 35.1 27 == [[image:1581023587369-139.png||height="253" width="461"]] ==
David Persson 16.1 28
David Persson 3.2 29 == Offers ==
Adam Ingmansson 35.1 30
Adam Ingmansson 33.4 31 ==== List all offers ====
David Persson 3.1 32
David Persson 20.1 33 {{code language="http" title="**Response**"}}
David Persson 3.2 34 GET /ledger/credit-account-onboarding/v1/XXX/offers HTTP/1.1
David Persson 3.1 35 Host: -
36 Authorization: Bearer <Token>
37 Content-Type: application/json
David Persson 19.1 38
39 {
40 "operations": null,
41 "items": [
42 {
43 "accountProfile" : "kontotyp-1",
44 "title" : "kontotyp 1",
45 "currency" : "SEK",
David Persson 24.1 46 "maxCreditLimit" : 50000.00,
David Persson 19.1 47 "interestFreePurchaseMonth" : true|false,
48 "monthlyAdminFee" : 35.00,
49 "reminderFee" : 35.00,
50 "interest" : 35.00,
51 "termsAndConditions" :
52 {
53 "standardEuropeeanAgreements" : "https://www.payex.com/term-and-conditions/no/-----.pdf",
54 "accountTerms" : "https://www.payex.com/term-and-conditions/no/-----.pdf"
55 },
David Persson 22.1 56 "@id" : "/ledger/credit-account-onboarding/v1/XXX/offers/kontotyp-1",
David Persson 19.1 57 },
58 {
59 "accountProfile" : "kontotyp-2",
60 "title" : "kontotyp 2",
61 "currency" : "SEK",
David Persson 24.1 62 "maxCreditLimit" : 0.00,
David Persson 19.1 63 "interestFreePurchaseMonth" : true|false,
64 "monthlyAdminFee" : 35.00,
65 "reminderFee" : 35.00,
66 "interest" : 35.00,
67 "termsAndConditions" :
68 {
69 "standardEuropeeanAgreements" : "https://www.payex.com/term-and-conditions/no/-----.pdf",
70 "accountTerms" : "https://www.payex.com/term-and-conditions/no/-----.pdf"
71 },
David Persson 22.1 72 "@id" : "/ledger/credit-account-onboarding/v1/XXX/offers/kontotyp-2",
David Persson 19.1 73 }
74 ],
David Persson 22.1 75 "@id": "/ledger/credit-account-onboarding/v1/XXX/offers",
David Persson 19.1 76 "view": {
David Persson 22.1 77 "@id": "/ledger/credit-account-onboarding/v1/XXX/offers?$top=2&$skip=0",
78 "next": "/ledger/credit-account-onboarding/v1/XXX/offers?$top=2&$skip=2"
David Persson 19.1 79 }
80 }
David Persson 3.1 81 {{/code}}
82
Adam Ingmansson 33.4 83 ==== Offers Resource ====
David Persson 3.1 84
85 {{code language="http" title="**Response**"}}
86 HTTP/1.1 200 OK
87 Content-Type: application/json
88
David Persson 5.1 89 {
90 "accountProfile" : "kontotyp-1000",
91 "title" : "kontotyp 1,000",
92 "currency" : "NOK",
Adam Ingmansson 35.1 93 "maxCreditLimit" : 50000.00,
David Persson 5.1 94 "interestFreePurchaseMonth" : true|false,
95 "monthlyAdminFee" : 35.00,
96 "reminderFee" : 35.00,
97 "interest" : 35.00,
98 "termsAndConditions" :
99 {
100 "standardEuropeeanAgreements" : "https://www.payex.com/term-and-conditions/no/-----.pdf",
101 "accountTerms" : "https://www.payex.com/term-and-conditions/no/-----.pdf"
102 },
David Persson 22.1 103 "@id" : "/ledger/credit-account-onboarding/v1/XXX/offers/kontotyp-1000",
David Persson 5.1 104 "operations" :
105 [
106 {
Magnus Kull 39.2 107 "rel" : "apply-for-account",
David Persson 22.1 108 "href" : "/ledger/credit-account-onboarding/v1/XXX/offers/kontotyp-1000/applications",
Magnus Kull 39.2 109 "method" : "POST"
David Persson 5.1 110 }
111 ]
David Persson 3.1 112 }
113 {{/code}}
114
115
116 **Resource properties**
117
118 (% class="table-bordered table-striped" %)
119 |=(% style="width: 215px;" %)Property|=(% style="width: 114px;" %)Data type|=(% style="width: 118px;" %)Format|=(% style="width: 586px;" %)Description
David Persson 7.2 120 |(% style="width:215px" %)@id |(% style="width:114px" %)string|(% style="width:118px" %)Uri|(% style="width:586px" %)
121 |(% style="width:215px" %)accountProfile|(% style="width:114px" %)string|(% style="width:118px" %)Maxlength: 50|(% style="width:586px" %)
122 |(% style="width:215px" %)title|(% style="width:114px" %)string|(% style="width:118px" %)Maxlength: 50|(% style="width:586px" %)
123 |(% style="width:215px" %)currency|(% style="width:114px" %)string|(% style="width:118px" %)[[ISO 4217>>url:https://sv.wikipedia.org/wiki/ISO_4217]]|(% style="width:586px" %)
Adam Ingmansson 35.1 124 |(% style="width:215px" %)maxCreditLimit|(% style="width:114px" %)decimal|(% style="width:118px" %) |(% style="width:586px" %)
David Persson 5.1 125 |(% style="width:215px" %)interestFreePurchaseMonth|(% style="width:114px" %)bool|(% style="width:118px" %)[[ISO 8601>>url:http://en.wikipedia.org/wiki/ISO_8601||rel="noreferrer" title="ISO8601 on Wikipedia"]]|(% style="width:586px" %)
126 |(% style="width:215px" %)monthlyAdminFee|(% style="width:114px" %)decimal|(% style="width:118px" %) |(% style="width:586px" %)
127 |(% style="width:215px" %)reminderFee|(% style="width:114px" %)decimal|(% style="width:118px" %) |(% style="width:586px" %)
128 |(% style="width:215px" %)termsAndConditions.standardEuropeeanAgreements|(% style="width:114px" %)string|(% style="width:118px" %)Uri|(% style="width:586px" %)
129 |(% style="width:215px" %)termsAndConditions.accountTerms|(% style="width:114px" %)string|(% style="width:118px" %)Uri|(% style="width:586px" %)
David Persson 3.1 130
David Persson 5.1 131 == Applications ==
David Persson 3.1 132
Adam Ingmansson 33.4 133 ==== Add application to offer ====
David Persson 3.1 134
135 {{code language="http" title="**Request**"}}
David Persson 23.1 136 POST /ledger/credit-account-onboarding/v1/XXX/offers/YYY/applications HTTP/1.1
David Persson 3.1 137 Host: -
138 Authorization: Bearer <Token>
139 Content-Type: application/json
140
David Persson 5.1 141 {
142 "nationalConsumerIdentifier" : {
143 "value" : "19101010-1010",
144 "countryCode" : "SE"
145 },
David Persson 12.1 146 "creditLimit": 5000.00,
David Persson 5.1 147 "customerNo" : "951753456",
148 "emailAddress" : "test@testshop.se",
149 "cellPhone" : "+46701234456",
150 "ipAddress": "1.1.1.1",
David Persson 42.3 151 "legalAddress" : {
David Persson 5.1 152 "name" : "John Smith",
153 "streetAddress" : "Teststreet",
154 "city" : "Testcity",
155 "coAddress" : "",
156 "zipCode" : "12345",
157 "countryCode" : "SE"
David Persson 12.1 158 },
159 "kyc": {
David Persson 29.1 160 "questions":[
David Persson 12.1 161 {
David Persson 42.1 162 "code": "employment",
163 "text": "Vad är din sysselsättning?",
164 "answer" : {
165 "code": "self-employed",
166 "text": "Egen företagare"
167 }
David Persson 12.1 168 },
169 {
David Persson 42.1 170 "code": "employment-since",
171 "text": "Hur länge har du haft denna sysselsättning?",
172 "answer" : {
173 "code": "2016-09",
174 "text": "2016-09"
175 }
David Persson 12.1 176 },
177 {
David Persson 42.1 178 "code": "monthlyIncome",
179 "text": "Månadsinkomst före skatt",
180 "answer" : {
181 "code": "10000.00",
182 "text": "10000"
183 }
David Persson 12.1 184 },
185 {
David Persson 42.1 186 "code": "monthlyPurchaseAmount",
187 "text": "Hur mycket kommer du genomsnitt att handla på ditt kort?",
188 "answer" : {
189 "code": "3000.00",
190 "text": "3000"
191 }
David Persson 12.1 192 },
193 {
David Persson 42.1 194 "code": "monthlyNumberOfDeposits",
195 "text": "Hur många inbetalningar kommer du att göra per månad?",
196 "answer" : {
197 "code": "1-2",
198 "text": "1-2"
199 }
David Persson 12.1 200 },
David Persson 29.1 201 {
David Persson 42.1 202 "code": "IsPep",
203 "text": "Är du en person i politiskt utsatt ställning (PEP), det vill säga.....",
204 "answer" : {
205 "code" : "true",
206 "text" : "Ja"
207 }
David Persson 29.1 208 }
David Persson 12.1 209 ]
David Persson 42.1 210 }
David Persson 3.1 211 }
212 {{/code}}
213
Adam Ingmansson 33.4 214 ==== List all applications ====
David Persson 19.1 215
216 {{code language="http" title="**Request**"}}
217 GET /ledger/credit-account-onboarding/v1/XXX/offers/YYY/applications HTTP/1.1
218 Host: -
219 Authorization: Bearer <Token>
220 Content-Type: application/json
221
222 {{/code}}
223
Adam Ingmansson 33.4 224 ==== Get a single application ====
David Persson 19.1 225
226 {{code language="http" title="**Request**"}}
227 GET /ledger/credit-account-onboarding/v1/XXX/offers/YYY/applications/NNN HTTP/1.1
228 Host: -
229 Authorization: Bearer <Token>
230 Content-Type: application/json
231
232 {{/code}}
233
Adam Ingmansson 33.4 234 ==== Applications Resource ====
David Persson 3.1 235
236 {{code language="http" title="**Response**"}}
237 HTTP/1.1 200 OK
238 Content-Type: application/json
239
David Persson 5.1 240 {
241 "nationalConsumerIdentifier" : {
242 "value" : "19101010-1010",
243 "countryCode" : "SE"
244 },
245 "status" : "awaiting-sign",
246 "customerNo" : "951753456",
David Persson 49.2 247 "creditLimit": 5000.00,
David Persson 5.1 248 "emailAddress" : "test@testshop.se",
249 "cellPhone" : "+46701234456",
250 "ipAddress": "1.1.1.1",
David Persson 42.2 251 "legalAddress" : {
David Persson 5.1 252 "name" : "John Smith",
253 "streetAddress" : "Teststreet",
254 "city" : "Testcity",
255 "coAddress" : "",
256 "zipCode" : "12345",
257 "countryCode" : "SE"
258 },
David Persson 12.1 259 "kyc": {
David Persson 29.1 260 "questions":[
David Persson 12.1 261 {
David Persson 42.1 262 "code": "employment",
263 "text": "Vad är din sysselsättning?",
264 "answer" : {
265 "code": "self-employed",
266 "text": "Egen företagare"
267 }
David Persson 12.1 268 },
269 {
David Persson 42.1 270 "code": "employment-since",
271 "text": "Hur länge har du haft denna sysselsättning?",
272 "answer" : {
273 "code": "2016-09",
274 "text": "2016-09"
275 }
David Persson 12.1 276 },
277 {
David Persson 42.1 278 "code": "monthlyIncome",
279 "text": "Månadsinkomst före skatt",
280 "answer" : {
281 "code": "10000.00",
282 "text": "10000"
283 }
David Persson 12.1 284 },
285 {
David Persson 42.1 286 "code": "monthlyPurchaseAmount",
287 "text": "Hur mycket kommer du genomsnitt att handla på ditt kort?",
288 "answer" : {
289 "code": "3000.00",
290 "text": "3000"
291 }
David Persson 12.1 292 },
293 {
David Persson 42.1 294 "code": "monthlyNumberOfDeposits",
295 "text": "Hur många inbetalningar kommer du att göra per månad?",
296 "answer" : {
297 "code": "1-2",
298 "text": "1-2"
299 }
David Persson 12.1 300 },
David Persson 29.1 301 {
David Persson 42.1 302 "code": "IsPep",
303 "text": "Är du en person i politiskt utsatt ställning (PEP), det vill säga.....",
304 "answer" : {
305 "code" : "true",
306 "text" : "Ja"
307 }
David Persson 29.1 308 }
David Persson 12.1 309 ]
310 },
David Persson 5.1 311 "account" : null,
312 "@id" : "/ledger/credit-account-onboardings/v1/501/offers/kontotyp-10000/applications/1561561-54641515-56456",
David Persson 22.1 313 "parentHREF" : "/ledger/credit-account-onboardings/v1/XXX/offers/kontotyp-10000",
David Persson 5.1 314 "operations" : [
David Persson 3.1 315 {
Magnus Kull 37.1 316 "rel" : "sign-agreement",
David Persson 22.1 317 "href" : "/ledger/credit-account-onboardings/v1/XXX/offers/kontotyp-10000/applications/1561561-54641515-56456/sign-agreement",
Magnus Kull 41.1 318 "method" : "POST"
David Persson 3.1 319 }
320 ]
321 }
322 {{/code}}
323
324 **Resource properties**
325
326 (% class="table-bordered table-striped" %)
David Persson 47.1 327 |=(% style="width: 215px;" %)Property|=(% style="width: 114px;" %)Data type|=(% style="width: 133px;" %)Required in post|=(% style="width: 479px;" %)Format|=(% style="width: 586px;" %)Description
David Persson 48.1 328 |(% style="width:215px" %)@id |(% style="width:114px" %)string|(% style="width:133px" %)-|(% style="width:479px" %)Maxlength: |(% style="width:586px" %)
David Persson 47.1 329 |(% style="width:215px" %)nationalConsumerIdentifier.value|(% style="width:114px" %)string|(% style="width:133px" %)Yes|(% style="width:479px" %)YYYYMMDD-NNNC|(% style="width:586px" %)A valid swedish "personnummer"
330 |(% style="width:215px" %)nationalConsumerIdentifier.countryCode|(% style="width:114px" %)string|(% style="width:133px" %)Yes|(% style="width:479px" %)[[ISO 3166-1 alpha-2>>url:https://sv.wikipedia.org/wiki/ISO_3166]]|(% style="width:586px" %)
David Persson 48.1 331 |(% style="width:215px" %)status|(% style="width:114px" %)string|(% style="width:133px" %)-|(% style="width:479px" %)Maxlength: 25|(% style="width:586px" %)(((
Adam Ingmansson 36.1 332 * AwaitingSign
David Persson 44.2 333 * InitializedSigning
Adam Ingmansson 36.1 334 * Approved
335 * Rejected
David Persson 44.2 336 * SigningFailed
David Persson 7.2 337 )))
David Persson 53.1 338 |(% style="width:215px" %)customerNo|(% style="width:114px" %)string|(% style="width:133px" %)Yes|(% style="width:479px" %)Maxlength: 15|(% style="width:586px" %)
David Persson 49.2 339 |(% style="width:215px" %)creditLimit|(% style="width:114px" %)decimal|(% style="width:133px" %)Yes|(% style="width:479px" %) |(% style="width:586px" %)
David Persson 49.1 340 |(% style="width:215px" %)emailAddress|(% style="width:114px" %)string|(% style="width:133px" %)Yes|(% style="width:479px" %)Maxlength: 254
David Persson 7.3 341 Regex pattern: [^@]+@[^\.]+\..+|(% style="width:586px" %)
David Persson 49.1 342 |(% style="width:215px" %)cellPhone|(% style="width:114px" %)string|(% style="width:133px" %)Yes|(% style="width:479px" %)Maxlength: 15|(% style="width:586px" %)
David Persson 47.1 343 |(% style="width:215px" %)ipAddress|(% style="width:114px" %)string|(% style="width:133px" %)No|(% style="width:479px" %)Maxlength: 43
David Persson 7.3 344 Regex pattern: [a-z0-9.:/]*|(% style="width:586px" %)
David Persson 47.1 345 |(% style="width:215px" %)legalAddress.name|(% style="width:114px" %)string|(% style="width:133px" %)Yes|(% style="width:479px" %)Maxlength: 72|(% style="width:586px" %)end-customer fullname
346 |(% style="width:215px" %)legalAddress.streetAddress|(% style="width:114px" %)string|(% style="width:133px" %)No|(% style="width:479px" %)Maxlength: 35|(% style="width:586px" %)
347 |(% style="width:215px" %)legalAddress.city|(% style="width:114px" %)string|(% style="width:133px" %)Yes|(% style="width:479px" %)Maxlength: 30|(% style="width:586px" %)
348 |(% style="width:215px" %)legalAddress.coAddress|(% style="width:114px" %)string|(% style="width:133px" %)No|(% style="width:479px" %)Maxlength: 35|(% style="width:586px" %)
David Persson 50.1 349 |(% style="width:215px" %)legalAddress.zipCode|(% style="width:114px" %)string|(% style="width:133px" %)Yes|(% style="width:479px" %)Maxlength: 15|(% style="width:586px" %)ZipCode without whitespaces
David Persson 47.1 350 |(% style="width:215px" %)legalAddress.countryCode|(% style="width:114px" %)string|(% style="width:133px" %)Yes|(% style="width:479px" %)[[ISO 3166-1 alpha-2>>url:https://sv.wikipedia.org/wiki/ISO_3166]]|(% style="width:586px" %)
David Persson 48.1 351 |(% style="width:215px" %)account|(% style="width:114px" %)string|(% style="width:133px" %)-|(% style="width:479px" %)Uri|(% style="width:586px" %)Reference to created account
David Persson 47.1 352 |(% style="width:215px" %)kyc|(% style="width:114px" %)object|(% style="width:133px" %)Yes|(% style="width:479px" %) |(% style="width:586px" %)kyc (know your customer). The questions and answers in the above example are just examples of what it might look like. This API does not validate that "correct" questions are asked
353 |(% style="width:215px" %)kyc.questions|(% style="width:114px" %)list of objects|(% style="width:133px" %)Yes|(% style="width:479px" %) |(% style="width:586px" %)
354 |(% style="width:215px" %)kyc.questions.code|(% style="width:114px" %)string|(% style="width:133px" %)Yes|(% style="width:479px" %) |(% style="width:586px" %)The code definition of the question
355 |(% style="width:215px" %)kyc.questions.text|(% style="width:114px" %)string|(% style="width:133px" %)Yes|(% style="width:479px" %) |(% style="width:586px" %)The actual question text that was presented to the end-customer
356 |(% style="width:215px" %)kyc.questions.aswer.code|(% style="width:114px" %)string|(% style="width:133px" %)Yes|(% style="width:479px" %) |(% style="width:586px" %)The answered code definition from the end-customer
357 |(% style="width:215px" %)kyc.questions.aswer.text|(% style="width:114px" %)string|(% style="width:133px" %)Yes|(% style="width:479px" %) |(% style="width:586px" %)The actual displayed answertext that was presented to the customer
David Persson 3.1 358
David Persson 5.1 359 == Sign-agreement (Operation) ==
David Persson 3.1 360
David Persson 5.1 361 ==== Request ====
David Persson 3.1 362
363 {{code language="http" title="**Request**"}}
David Persson 23.1 364 POST /ledger/credit-account-onboarding/v1/XXX/offers/YYY/applications/NNN/sign-agreement HTTP/1.1
David Persson 3.1 365 Host: -
366 Authorization: Bearer <Token>
367 Content-Type: application/json
368
369 {{/code}}
370
David Persson 5.1 371 ==== Response ====
David Persson 3.1 372
373 {{code language="http" title="**Request**"}}
David Persson 5.1 374 HTTP/1.1 201 Created
David Persson 3.1 375 Content-Type: application/json
376
377 {
David Persson 22.1 378 "createdAccount" : "https://api.payex.com/ledger/credit-account/v1/XXX/accounts/123456",
David Persson 3.1 379 }
380 {{/code}}
381
382 **Resource properties**
383
384 (% class="table-bordered table-striped" %)
385 |=(% style="width: 215px;" %)Property|=(% style="width: 114px;" %)Data type|=(% style="width: 118px;" %)Format|=(% style="width: 586px;" %)Description
David Persson 5.1 386 |(% style="width:215px" %)createdAccount|(% style="width:114px" %)string|(% style="width:118px" %)Uri|(% style="width:586px" %)
David Persson 3.1 387
David Persson 53.2 388 (% id="HProblems-1" %)
David Persson 5.1 389 == Problems ==
David Persson 3.1 390
David Persson 53.2 391 All errors from the api are returned in the form of "problems" (response body), except for the http status code itself.
392 The problem object contain more detailed info on what the error is. The "type" property can be used to programmatically interpret the error as it contains a code definition of the problem.
393 Other properties can be useful for logging and subsequent troubleshooting. Some problems are extended with additional parameters so it may be a good idea to log response body as raw data to include these.
David Persson 3.1 394
David Persson 53.2 395 Problems of type validation does contain an additional list ("Problems") that describes exactly which parameter that failed the validation
David Persson 3.1 396
David Persson 53.2 397 (% id="HExample" %)
398 === Example ===
David Persson 3.1 399
400 {{code language="http" title="**Response**"}}
401 HTTP/1.1 400 Error
402 Content-Type: application/problem+json
403
404 {
David Persson 53.3 405 "Type" : "ledger.credit-account-onboarding.validation",
David Persson 53.2 406 "Title" : "A validation error occurred",
407 "Status" : 400,
David Persson 53.3 408 "Instance" : "f1f431d7-d2b2-49ca-93e0-ffe15753610a",
David Persson 53.2 409 "Detail" : "A validation error occurred. Please fix the problems mentioned in the 'problems' property below.",
410 "Problems" : [
411 {
David Persson 53.3 412 "CellPhone" : "The CellPhone field is required."
413 },
414 {
415 "EmailAddress" : "The EmailAddress field is required."
416 },
417 {
418 "LegalAddress.Name" : "The Name field is required."
David Persson 53.2 419 }
420 ]
David Persson 3.1 421 }
David Persson 53.3 422
David Persson 3.1 423 {{/code}}
David Persson 53.2 424
425 (% id="HProblemtypes" %)
426 === Problem types ===
427
David Persson 53.4 428 Note, each problem typecode is preceded by "ledger.credit-account-onboarding." in this API, e.g. the error "validation" in the table below will appear as typecode "ledger.credit-account-onboarding.validation".
David Persson 53.2 429
430 |=Problem type (code)|=Httpstatus|=Description
431 |validation|400|occurs if any of the inputvalidation fails, it is described in the problem which parameter that failed the validation
David Persson 55.1 432 |account-profile-exists|409|occurs if the customer already has an account with the requested account profile
David Persson 53.2 433
434