Wiki source code of 2. Customer

Last modified by Thomas Hedström on 2025/12/12 14:21
Show last authors
1 (% class="jumbotron" %)
2 (((
3 (% class="container" %)
4 (((
5 Integrate to **PayEx Customer API **
6 )))
7 )))
8
9 == Introduction ==
10
11 (% class="lead" %)
12 This api is used to create/read customers or change properties related to the customer.
13
14 [[image:customerapi-2025-02.PNG||alt="1612164561442-820.png" height="699" width="587"]]
15
16
17 Each resource in the API corresponds to its own route. All routes are structured according to a specific standard, explained below
18
19 The below route is an example of a route towards resource2Id, to operate on this resource you must also include the ids of its parentresources in the route.
20 //lf-api.payex.com/ledger/**{Subdomain}**/v1/**{LedgerNumber}**/resource1/**{resource1Id}**/resource2/**{resource2Id}**//
21
22 (% class="table-bordered table-striped" %)
23 |=(% style="width: 604px;" %)Route segment|=(% style="width: 2790px;" %)Description
24 |(% style="width:604px" %)Subdomain|(% style="width:2790px" %)In this part of the API it will be **customer**
25 |(% style="width:604px" %)LedgerNumber|(% style="width:2790px" %)The ledger identifier/number at PayEx
26 |(% style="width:604px" %)resource1Id|(% style="width:2790px" %)Identifier of resource1
27 |(% style="width:604px" %)resource2Id|(% style="width:2790px" %)identifier of resource2, subresource to resource1
28
29 (% class="wikigeneratedid" %)
30 Routes that occurs in examples of this documentation will use the following identifiers
31
32 (% class="table-bordered table-striped" %)
33 |=(% style="width: 488px;" %)Resource|=(% style="width: 2271px;" %)Identifier
34 |(% style="width:488px" %)LedgerNumber|(% style="width:2271px" %)XXX
35 |(% style="width:488px" %)Customer|(% style="width:2271px" %)NNN (CustomerNo)
36
37 (% id="HChangelog" %)
38 == Changelog ==
39
40 2026-01-27
41 Added new possible value for to ActiveConsents - PharmaciesSE
42
43 2023-01-17
44 Added //surpluses// property to the Customer resource with planned release 2024-01-23
45
46 2023-11-27
47 Added new resource Surpluses & added a general 404 not-found to problems list.
48
49 2024-04-26
50
51 Added TaxIdentificationNumber to the Customer resource with planned release 2024-05-28
52
53 2024-05-15
54
55 Added Consent and underlying resources with planned release 2024-05-28. Updated Introduction API overview visual.
56
57 2025-02-14
58
59 Added operation Update-Kyc-Answers and updates to the Customer resource Operations list to reflect that. Planned release 2025-03-04
60
61 Added resource Kyc-Questions. Planned release 2025-03-04
62
63
64 == Customer ==
65
66 The **customer **resource is located under **ledger/customer/v1/ **api**. **The customer- and its sub-resources are used to create, read and modify information related to customers.
67
68 ==== (% style="color:inherit; font-family:inherit" %)Get a specific customer(%%) ====
69
70 {{code language="http" title="**Request**"}}
71 GET /ledger/customer/v1/XXX/customers/NNN HTTP/1.1
72 Host: -
73 Authorization: Bearer <Token>
74 Content-Type: application/json
75 {{/code}}
76
77 ==== ====
78
79 {{code language="http" title="**Response**"}}
80 HTTP/1.1 200 OK
81 Content-Type: application/json
82
83 {
84 "@id" : "/ledger/customer/v1/XXX/customers/9999",
85 "customerNo" : "9999",
86 "nationalIdentifier": {
87 "regNo" : "YYYYMMDD-NNNN",
88 "countryCode" : "SE"
89 },
90 "vatNo" : "SE101010101001",
91 "legalEntity" : "consumer|business",
92 "name" : "Britt-Marie Axelstopp",
93 "emailAddress" : "britt@axelstopp.com",
94 "protectedIdentity": false,
95 "preferredLanguageCode": "SV",
96 "legalStatus": "active",
97 "msisdn" : "+91485918841",
98 "activeConsents": [
99 "Betalingsservice",
100 "Avtalegiro"
101 ],
102 "eDIAddressInfo" : {
103 "VAN": "ABCXYZ",
104 "InterChangeRecipient": "Recipient_ID1",
105 "BuyerId": "123465"
106 },
107 "legalAddress" : "/ledger/customer/v1/XXX/customers/9999/legal-address",
108 "billingAddress" : "/ledger/customer/v1/XXX/customers/9999/billing-address",
109 "surpluses": "/ledger/customer/v1/XXX/customers/9999/surpluses",
110 "operations" :
111 [
112 {
113 "rel": "partial-update-customer",
114 "method": "PATCH",
115 "href": "/ledger/customer/v1/XXX/customers/9999"
116 },
117 {
118 "rel": "add-billing-address",
119 "method": "POST",
120 "href": "/ledger/customer/v1/XXX/customers/9999/billing-address"
121 },
122 {
123 "rel": "update-kyc-answers",
124 "method": "POST",
125 "href": "/ledger/customer/v1/XXX/customers/9999/update-kyc-answers"
126 }
127 ]
128 }
129 {{/code}}
130
131 ==== Get a specific customer using $expand ====
132
133 if the entire customer model is needed, you can expand property references to other resources, in this example to get the customer model including the addresses on a single call.
134
135 (% class="box infomessage" %)
136 (((
137 Performance is affected when expand is used as more resources are retrieved. Only use $expand if you always need the referenced properties, otherwise it should be retrevied on demand.
138 )))
139
140 {{code language="http" title="**Request**"}}
141 GET /ledger/customer/v1/XXX/customers/NNN?$expand=legaladdress,billingaddress HTTP/1.1
142 Host: -
143 Authorization: Bearer <Token>
144 Content-Type: application/json
145 {{/code}}
146
147
148 {{code language="http" title="**Response**"}}
149 HTTP/1.1 200 OK
150 Content-Type: application/json
151
152 {
153 "@id" : "/ledger/customer/v1/XXX/customers/9999",
154 "customerNo" : "9999",
155 "nationalIdentifier": {
156 "regNo" : "YYYYMMDD-NNNN",
157 "countryCode" : "SE"
158 },
159 "vatNo" : "SE101010101001",
160 "legalEntity" : "consumer|business",
161 "name" : "Britt-Marie Axelstopp",
162 "emailAddress" : "britt@axelstopp.com",
163 "protectedIdentity": false,
164 "preferredLanguageCode": "SV",
165 "legalStatus": "active",
166 "msisdn" : "+91485918841",
167 "activeConsents": [
168 "Betalingsservice",
169 "Avtalegiro"
170 ],
171 "eDIAddressInfo" : {
172 "VAN": "ABCXYZ",
173 "InterChangeRecipient": "Recipient_ID1",
174 "BuyerId": "123456"
175 },
176 "legalAddress" : {
177 "addressee" : "Britt-Marie Axelstopp",
178 "streetAddress" : "The street 18",
179 "coAddress" : "c/o Jansson",
180 "city" : "STOCKHOLM",
181 "zipCode" : "15961",
182 "countryCode" : "SE",
183 "operations" :
184 [
185 {
186 "rel" : "update",
187 "href" : "/ledger/customer/v1/XXX/customers/9999/legal-address",
188 "method" : "PUT"
189 },
190 {
191 "rel" : "update-legal-address-from-population-register",
192 "href" : "/ledger/customer/v1/XXX/customers/9999/legal-address",
193 "method" : "POST"
194 }
195 ]
196 },
197 "billingAddress" : {
198 "addressee" : "Kalle Axelstopp",
199 "streetAddress" : "Axelgatan 18",
200 "city" : "STOCKHOLM",
201 "zipCode" : "16872",
202 "countryCode" : "se",
203 "operations" :
204 [
205 {
206 "rel" : "update",
207 "href" : "/ledger/customer/v1/XXX/customers/9999/billing-address",
208 "method" : "PUT"
209 },
210 {
211 "rel" : "delete",
212 "href" : "/ledger/customer/v1/XXX/customers/9999/billing-address",
213 "method" : "DELETE"
214 }
215 ]
216 },
217 "surpluses": "/ledger/customer/v1/XXX/customers/9999/surpluses",
218 "operations" :
219 [
220 {
221 "rel" : "add-billing-address",
222 "href" : "/ledger/customer/v1/XXX/customers/9999/billing-address",
223 "method" : "POST"
224 }
225 ]
226 }
227 {{/code}}
228
229
230 ----
231
232 ==== Create new customer ====
233
234
235 (% id="HImportanttonote21" %)
236 ===== Important to note! =====
237
238 * Standard length of customerNo in Norway and Denmark is 7 characters (numeric only).
239 * Only use numeric characters and not with a leading zero for customerNo in Sweden, in order to use AutoGiro (Direct Debit).
240 * Dependency to legalEntity:
241 ** [[Late fee>>url:https://developer.payex.com/xwiki/wiki/developer/view/Main/Invoicing/invoice-service/invoice-service-apis/Supplementary%20features/?HLatefee]] will be added instead of reminder fee or collection claim fee when legalEntity is set to "business" (if specially contracted with PayEx and configured in ledger).
242 ** SSN (regNo) for private individuals will not be displayed in ledger reports due to GDPR. regNO will only be displayed when legalEntity is set till "business".
243 ** When invoice/claim is distributed by e-mail: If legalEntity is set to "consumer" the e-mail message will only include a link to PayEx Invoice Portal where the invoice/claim is available, otherwise a copy of the invoice/claim will be added in the e-mail message as a pdf-file.
244 ** Finland only: Different claim processes will be used depending on "consumer" or "business".
245
246 A new customer is created by making a POST call to the API.
247 See below table of properties that is supported when creating a new customer. The table below also reflects what properties you can expect when retreiving a customer through a "GET" request.
248
249 (% class="table-bordered table-striped" %)
250 |=(% style="width: 509px;" %)Property|=(% style="width: 161px;" %)Required|=(% style="width: 1852px;" %)Comment *
251 |(% style="width:509px" %)customerNo|(% style="width:161px" %)Yes*|(% style="width:1852px" %)Normally required, //exception is when the configuration on the ledger is set for payex to generate customer numbers, in that case CustomerNo must not be set in request.//
252 |(% style="width:509px" %)__**nationalIdentifier**__|(% style="width:161px" %)No*|(% style="width:1852px" %)Normally optional, //exception is when the configuration on the ledger is set for payex to generate customer numbers, in that case nationalIdentifier is required.//
253 |(% style="width:509px" %) nationalIdentifier.regNo|(% style="width:161px" %)Yes|(% style="width:1852px" %)
254 |(% style="width:509px" %) nationalIdentifier.countryCode|(% style="width:161px" %)Yes|(% style="width:1852px" %)
255 |(% style="width:509px" %)vatNo|(% style="width:161px" %)No*|(% style="width:1852px" %)Required if reverse tax is used
256 |(% style="width:509px" %)legalEntity|(% style="width:161px" %)No|(% style="width:1852px" %)
257 |(% style="width:509px" %)name|(% style="width:161px" %)Yes|(% style="width:1852px" %)
258 |(% style="width:509px" %)preferredLanguageCode|(% style="width:161px" %)No|(% style="width:1852px" %)
259 |(% style="width:509px" %)emailAddress|(% style="width:161px" %)No|(% style="width:1852px" %)
260 |(% style="width:509px" %)msisdn|(% style="width:161px" %)No|(% style="width:1852px" %)
261 |(% style="width:509px" %)protectedIdentity|(% style="width:161px" %)No|(% style="width:1852px" %)
262 |(% style="width:509px" %)distributionType|(% style="width:161px" %)No|(% style="width:1852px" %)
263 |(% style="width:509px" %)taxIdentificationNumber|(% style="width:161px" %)No|(% style="width:1852px" %)
264 |(% style="width:509px" %)__**eDIAddressInfo**__|(% style="width:161px" %)No|(% style="width:1852px" %)
265 |(% style="width:509px" %) eDIAddressInfo.van|(% style="width:161px" %)No*|(% style="width:1852px" %)This field is required for distribution method EInvoiceB2B (EDI) to be used
266 |(% style="width:509px" %) eDIAddressInfo.interChangeRecipient|(% style="width:161px" %)No|(% style="width:1852px" %)
267 |(% style="width:509px" %) eDIAddressInfo.BuyerId|(% style="width:161px" %)Yes|(% style="width:1852px" %)
268 |(% style="width:509px" %)**__legalAddress__**|(% style="width:161px" %)Yes|(% style="width:1852px" %)
269 |(% style="width:183px" %) addressee|(% style="width:1602px" %)Yes|(% style="width:1852px" %)
270 |(% style="width:183px" %) streetAddress|(% style="width:1602px" %)No|(% style="width:1852px" %)
271 |(% style="width:183px" %) coAddress|(% style="width:1602px" %)No|(% style="width:1852px" %)
272 |(% style="width:183px" %) city|(% style="width:1602px" %)Yes|(% style="width:1852px" %)
273 |(% style="width:183px" %) zipCode|(% style="width:1602px" %)Yes|(% style="width:1852px" %)
274 |(% style="width:183px" %) countryCode|(% style="width:1602px" %)Yes|(% style="width:1852px" %)
275 |(% style="width:509px" %)**__billingAddress__**|(% style="width:161px" %)No|(% style="width:1852px" %)
276 |(% style="width:183px" %) addressee|(% style="width:1602px" %)Yes|(% style="width:1852px" %)
277 |(% style="width:183px" %) streetAddress|(% style="width:1602px" %)No|(% style="width:1852px" %)
278 |(% style="width:183px" %) coAddress|(% style="width:1602px" %)No|(% style="width:1852px" %)
279 |(% style="width:183px" %) city|(% style="width:1602px" %)Yes|(% style="width:1852px" %)
280 |(% style="width:183px" %) zipCode|(% style="width:1602px" %)Yes|(% style="width:1852px" %)
281 |(% style="width:183px" %) countryCode|(% style="width:1602px" %)Yes|(% style="width:1852px" %)
282
283 ===== Examples =====
284
285 (% class="wikigeneratedid" %)
286 Standard create customer
287
288 {{code language="http" title="**Request**"}}
289 POST /ledger/customer/v1/XXX/customers HTTP/1.1
290 Host: -
291 Authorization: Bearer <Token>
292 Content-Type: application/json
293
294 {
295 "customerNo" : "9999",
296 "nationalIdentifier": {
297 "regNo" : "YYYYMMDD-NNNN",
298 "countryCode" : "SE"
299 },
300 "vatNo" : "SE101010101001",
301 "legalEntity" : "consumer|business",
302 "name" : "Britt-Marie Axelstopp",
303 "emailAddress" : "britt@axelstopp.com",
304 "msisdn" : "+91485918841",
305 "eDIAddressInfo" : {
306 "VAN": "ABCXYZ",
307 "InterChangeRecipient": "Recipient_ID1",
308 "BuyerId": "123456"
309 },
310 "legalAddress" : {
311 "addressee" : "Britt-Marie Axelstopp",
312 "streetAddress" : "The street 18",
313 "coAddress" : "c/o Jansson",
314 "city" : "STOCKHOLM",
315 "zipCode" : "15961",
316 "countryCode" : "SE"
317 },
318 "distributionType": "postal",
319 "taxIdentificationNumber" : "123456789"
320 }
321 {{/code}}
322
323 (% id="HAccountresourceproperties" %)
324 ==== ====
325
326 {{code language="http" title="**Response**"}}
327 HTTP/1.1 201 CREATED
328 Content-Type: application/json
329
330 {
331 "@id" : "/ledger/customer/v1/XXX/customers/9999",
332 "customerNo" : " 9999"
333 }
334 {{/code}}
335
336 (% class="wikigeneratedid" id="HCreatecustomerwithbilling-address" %)
337 Create customer with billing-address
338
339 {{code language="http" title="**Request**"}}
340 POST /ledger/customer/v1/XXX/customers HTTP/1.1
341 Host: -
342 Authorization: Bearer <Token>
343 Content-Type: application/json
344
345 {
346 "customerNo" : "9999",
347 "nationalIdentifier": {
348 "regNo" : "YYYYMMDD-NNNN",
349 "countryCode" : "SE"
350 },
351 "vatNo" : "SE101010101001",
352 "legalEntity" : "consumer|business",
353 "name" : "Britt-Marie Axelstopp",
354 "emailAddress" : "britt@axelstopp.com",
355 "msisdn" : "+91485918841",
356 "eDIAddressInfo" : {
357 "VAN": "ABCXYZ",
358 "InterChangeRecipient": "Recipient_ID1",
359 "BuyerId": "123456"
360 },
361 "legalAddress" : {
362 "addressee" : "Britt-Marie Axelstopp",
363 "streetAddress" : "The street 18",
364 "coAddress" : "c/o Jansson",
365 "city" : "STOCKHOLM",
366 "zipCode" : "15961",
367 "countryCode" : "SE"
368 },
369 "billingAddress" : {
370 "addressee" : "Kalle Axelstopp",
371 "streetAddress" : "Axelgatan 18",
372 "city" : "STOCKHOLM",
373 "zipCode" : "16872",
374 "countryCode" : "SE"
375 }
376 }
377 {{/code}}
378
379 (% id="HAccountresourceproperties" %)
380 ==== ====
381
382 {{code language="http" title="**Response**"}}
383 HTTP/1.1 201 CREATED
384 Content-Type: application/json
385
386 {
387 "@id" : "/ledger/customer/v1/XXX/customers/9999",
388 "customerNo" : " 9999"
389 }
390 {{/code}}
391
392 ==== ====
393
394 ----
395
396 ==== Update customer ====
397
398 Some properties of the customer can be updated through this API. Properties will only be updated if included in the request. //To delete a property, for example, the property must be included in the request and have the value set to null (see examples below). //
399
400 The following customer properties is possible to update through a patch call
401
402 (% class="table-bordered table-striped" %)
403 |=(% style="width: 509px;" %)Property
404 |(% style="width:509px" %)emailAddress
405 |(% style="width:509px" %)legalStatus
406 |(% style="width:509px" %)preferredLanguageCode
407 |(% style="width:509px" %)protectedIdentity
408 |(% style="width:509px" %)msisdn
409 |(% style="width:509px" %)distributionType
410 |(% style="width:509px" %)taxIdentificationNumber
411 |(% style="width:509px" %)__**eDIAddressInfo**__
412 |(% style="width:509px" %) eDIAddressInfo.van
413 |(% style="width:509px" %) eDIAddressInfo.interChangeRecipient
414 |(% style="width:509px" %) eDIAddressInfo.BuyerId
415
416 ===== Examples =====
417
418 Update all properties
419
420 {{code language="http" title="**Request**"}}
421 PATCH /ledger/customer/v1/XXX/customers/NNN HTTP/1.1
422 Host: -
423 Authorization: Bearer <Token>
424 Content-Type: application/json
425
426 {
427 "emailAddress" : "britt@axelstopp.com",
428 "protectedIdentity": false,
429 "preferredLanguageCode": "SV",
430 "legalStatus": "active",
431 "msisdn" : "+91485918841",
432 "eDIAddressInfo" : {
433 "VAN": "ABCXYZ",
434 "InterChangeRecipient": "Recipient_ID1",
435 "BuyerId": "123456"
436 },
437 "distributionType": "postal",
438 "taxIdentificationNumber" : "987654321"
439 }
440 {{/code}}
441
442 Update only emailAddress
443
444 {{code language="http" title="**Request**"}}
445 PATCH /ledger/customer/v1/XXX/customers/NNN HTTP/1.1
446 Host: -
447 Authorization: Bearer <Token>
448 Content-Type: application/json
449
450 {
451 "emailAddress" : "britt@axelstopp.com"
452 }
453 {{/code}}
454
455 Update emailAddress and delete msisdn
456
457 {{code language="http" title="**Request**"}}
458 PATCH /ledger/customer/v1/XXX/customers/NNN HTTP/1.1
459 Host: -
460 Authorization: Bearer <Token>
461 Content-Type: application/json
462
463 {
464 "emailAddress" : "britt@axelstopp.com",
465 "msisdn" : null
466 }
467 {{/code}}
468
469 Remove EDIAddressInfo on a customer
470
471 {{code language="http" title="**Request**"}}
472 PATCH /ledger/customer/v1/XXX/customers/NNN HTTP/1.1
473 Host: -
474 Authorization: Bearer <Token>
475 Content-Type: application/json
476
477 {
478 "eDIAddressInfo" : null
479 }
480 {{/code}}
481
482
483 ----
484
485 (% id="HAccountresourceproperties" %)
486 ==== Customer resource properties ====
487
488 (% class="table-bordered table-striped" %)
489 |=(% style="width: 343px;" %)Property|=(% style="width: 137px;" %)Data type|=(% style="width: 230px;" %)Format|=(% style="width: 1076px;" %)Description
490 |(% style="width:343px" %)@id |(% style="width:137px" %)string|(% style="width:230px" %) |(% style="width:1076px" %)Uri of the specific customer
491 |(% style="width:343px" %)customerNo|(% style="width:137px" %)string|(% style="width:230px" %)MinLength: 1
492 MaxLength: 15*
493 numeric, 1-9 |(% style="width:1076px" %)The unique identifier of the customer
494 MaxLength may differ depending on configuration
495 KID (Norway)
496 |(% style="width:343px" %)__**nationalIdentifier**__|(% style="width:137px" %)object|(% style="width:230px" %) |(% style="width:1076px" %)
497 |(% style="width:343px" %) nationalIdentifier.regNo|(% style="width:137px" %)string|(% style="width:230px" %)Country specific|(% style="width:1076px" %)Sweden: YYYYMMDD-NNNC
498 Norway: DDMMYYNNNNN
499 |(% style="width:343px" %) nationalIdentifier.countryCode|(% style="width:137px" %)string|(% style="width:230px" %)[[ISO 3166-1 alpha-2>>url:https://sv.wikipedia.org/wiki/ISO_3166]]|(% style="width:1076px" %)
500 |(% style="width:343px" %)vatNo|(% style="width:137px" %)string|(% style="width:230px" %)MinLength: 7
501 MaxLength: 17
502 Regex pattern:
503 [A-Z]{2}.*|(% style="width:1076px" %)Customer VAT registration number. Mandatory if reverse tax is used. Must conform to country specific algorithm
504 |(% style="width:343px" %)legalEntity|(% style="width:137px" %)string|(% style="width:230px" %) |(% style="width:1076px" %)Valid values:
505 "consumer"
506 "business"
507 |(% style="width:343px" %)name|(% style="width:137px" %)string|(% style="width:230px" %)Maxlength: 72
508 Regex?|(% style="width:1076px" %)Full name of end-customer
509 |(% style="width:343px" %)emailAddress|(% style="width:137px" %)string|(% style="width:230px" %)Maxlength: 254
510 Regex pattern: [^@]+@[^\.]+\..+|(% style="width:1076px" %)
511 |(% style="width:343px" %)protectedIdentity|(% style="width:137px" %)bool|(% style="width:230px" %) |(% style="width:1076px" %)Set to true if the customer has protected identity
512 Postal distribution will be handled by "Skatteverket". **Only supported in Sweden**
513 |(% style="width:343px" %)preferredLanguageCode|(% style="width:137px" %)string|(% style="width:230px" %) |(% style="width:1076px" %)(((
514 Valid values:
515
516 * **SV**
517 * **NO**
518 * **DA**
519 * **FI**
520 * **EN**
521 )))
522 |(% style="width:343px" %)legalStatus|(% style="width:137px" %)string|(% style="width:230px" %) |(% style="width:1076px" %)(((
523 Valid values:
524
525 * active
526 * deceased
527 )))
528 |(% style="width:343px" %)msisdn|(% style="width:137px" %)string|(% style="width:230px" %)Maxlength: 15
529 Minlength: 5
530 +NNNN|(% style="width:1076px" %) "Mobile Subscriber Integrated Services Digital Network Number", ie. Cellphone number
531 Countrycode is always required as the example below
532 +46720000000
533 |(% style="width:343px" %)distributionType|(% style="width:137px" %)string|(% style="width:230px" %) |(% style="width:1076px" %)Sets distribution type. Allowed values are:(((
534 * **postal **
535 * **noDistribution **
536 )))
537 |(% style="width:343px" %)taxIdentificationNumber|(% style="width:137px" %)string|(% style="width:230px" %)Maxlength: 20
538 Minlength: 1|(% style="width:1076px" %)Is an identification number used by the Internal Revenue Service (IRS) in the administration of tax laws
539 |(% style="width:343px" %)**activeConsents**|(% style="width:137px" %)object|(% style="width:230px" %) |(% style="width:1076px" %)List of strings with possible values:(((
540 * (((
541 (% data-pm-slice="1 1 [~"table~",{~"isNumberColumnEnabled~":false,~"layout~":~"default~",~"__autoSize~":false,~"localId~":~"c8de3c26-1280-4cb1-a8ea-e56f5b08d910~"},~"tableRow~",null,~"tableCell~",{~"colspan~":1,~"rowspan~":1,~"colwidth~":null,~"background~":null}]" %)
542 **Autogiro**
543 )))
544 * (((
545 (% data-pm-slice="1 1 [~"table~",{~"isNumberColumnEnabled~":false,~"layout~":~"default~",~"__autoSize~":false,~"localId~":~"c8de3c26-1280-4cb1-a8ea-e56f5b08d910~"},~"tableRow~",null,~"tableCell~",{~"colspan~":1,~"rowspan~":1,~"colwidth~":null,~"background~":null}]" %)
546 **Avtalegiro**
547 )))
548 * (((
549 (% data-pm-slice="1 1 [~"table~",{~"isNumberColumnEnabled~":false,~"layout~":~"default~",~"__autoSize~":false,~"localId~":~"c8de3c26-1280-4cb1-a8ea-e56f5b08d910~"},~"tableRow~",null,~"tableCell~",{~"colspan~":1,~"rowspan~":1,~"colwidth~":null,~"background~":null}]" %)
550 **Betalingsservice**
551 )))
552 * (((
553 (% data-pm-slice="1 1 [~"table~",{~"isNumberColumnEnabled~":false,~"layout~":~"default~",~"__autoSize~":false,~"localId~":~"c8de3c26-1280-4cb1-a8ea-e56f5b08d910~"},~"tableRow~",null,~"tableCell~",{~"colspan~":1,~"rowspan~":1,~"colwidth~":null,~"background~":null}]" %)
554 **RecurringCard**
555 )))
556 * (((
557 (% data-pm-slice="1 1 [~"table~",{~"isNumberColumnEnabled~":false,~"layout~":~"default~",~"__autoSize~":false,~"localId~":~"c8de3c26-1280-4cb1-a8ea-e56f5b08d910~"},~"tableRow~",null,~"tableCell~",{~"colspan~":1,~"rowspan~":1,~"colwidth~":null,~"background~":null}]" %)
558 **RecurringInvoiceToken**
559 )))
560 * (((
561 (% data-pm-slice="1 1 [~"table~",{~"isNumberColumnEnabled~":false,~"layout~":~"default~",~"__autoSize~":false,~"localId~":~"c8de3c26-1280-4cb1-a8ea-e56f5b08d910~"},~"tableRow~",null,~"tableCell~",{~"colspan~":1,~"rowspan~":1,~"colwidth~":null,~"background~":null}]" %)
562 **EInvoice**
563 )))
564 * (((
565 (% data-pm-slice="1 1 [~"table~",{~"isNumberColumnEnabled~":false,~"layout~":~"default~",~"__autoSize~":false,~"localId~":~"c8de3c26-1280-4cb1-a8ea-e56f5b08d910~"},~"tableRow~",null,~"tableCell~",{~"colspan~":1,~"rowspan~":1,~"colwidth~":null,~"background~":null}]" %)
566 **Kivra**
567 )))
568 * (((
569 (% data-pm-slice="1 1 [~"table~",{~"isNumberColumnEnabled~":false,~"layout~":~"default~",~"__autoSize~":false,~"localId~":~"c8de3c26-1280-4cb1-a8ea-e56f5b08d910~"},~"tableRow~",null,~"tableCell~",{~"colspan~":1,~"rowspan~":1,~"colwidth~":null,~"background~":null}]" %)
570 **EBoks**
571 )))
572 * (((
573 (% data-pm-slice="1 1 [~"table~",{~"isNumberColumnEnabled~":false,~"layout~":~"default~",~"__autoSize~":false,~"localId~":~"c8de3c26-1280-4cb1-a8ea-e56f5b08d910~"},~"tableRow~",null,~"tableCell~",{~"colspan~":1,~"rowspan~":1,~"colwidth~":null,~"background~":null}]" %)
574 **PharmaciesSE**
575 )))
576 )))
577 |(% style="width:343px" %)__**eDIAddressInfo**__|(% style="width:137px" %)object|(% style="width:230px" %) |(% style="width:1076px" %)EDI addressing info
578 |(% style="width:343px" %) eDIAddressInfo.van|(% style="width:137px" %)string|(% style="width:230px" %)Maxlength: 255|(% style="width:1076px" %)(((
579 Buyer VAN identifier (OperatorId)
580 )))
581 |(% style="width:343px" %) eDIAddressInfo.interChangeRecipient|(% style="width:137px" %)string|(% style="width:230px" %)Maxlength: 13|(% style="width:1076px" %)Routing address. EAN
582 |(% style="width:343px" %) eDIAddressInfo.BuyerId|(% style="width:137px" %)string|(% style="width:230px" %)Maxlength: 13|(% style="width:1076px" %)NAD_BY/Buyerparty. EAN/Corporate identity number
583 |(% style="width:343px" %)legalAddress|(% style="width:137px" %)uri|(% style="width:230px" %) |(% style="width:1076px" %)reference to the customers legal address
584 |(% style="width:343px" %)billingAddress|(% style="width:137px" %)uri|(% style="width:230px" %) |(% style="width:1076px" %)reference to the customer billing address
585 |(% style="width:343px" %)surpluses|(% style="width:137px" %)uri|(% style="width:230px" %) |(% style="width:1076px" %)reference to the customer surpluses
586
587 ==== Operations ====
588
589 Depending on the current permissions the following operations is supported on the customer resource
590
591 ===== add-billing-address =====
592
593 Method: POST
594 This operation will be available if no billing-address exists on the customer, see [[billing-address>>Main.Invoicing.invoice-service.Implementation guide.Technical reference.API.CustomerApi.WebHome||anchor="HAddabilling-address"]] resource for more details
595
596 ----
597
598 == Update-kyc-answers ==
599
600
601 ==== Create Update-kyc-answer ====
602
603 When exposed on customer resources operations list it's a indication previous KYC answers up for renewal. Able update KYC with this operation even if current aren't expired but won't be suggested on the customer resource
604
605 {{code language="http" title="**Request**"}}
606 POST /ledger/customer/v1/{ownerNo}/customers/{customerNo}/update-kyc-answers HTTP/1.1
607 Host: -
608 Authorization: Bearer<Token>
609 Content-Type: application/json
610
611 {
612 "answers": [
613 {
614 "questionCode": "taxable_outside_sweden",
615 "answerCode": "no"
616 },
617 {
618 "questionCode": "multiple_citizenship",
619 "answerCode": "yes"
620 },
621 {
622 "questionCode": "citizen_ship_country_codes",
623 "answerCode": "SWE"
624 },
625 {
626 "questionCode": "citizen_ship_country_codes",
627 "answerCode": "NOR"
628 }
629 ]
630 }
631 {{/code}}
632
633
634 **Request object specification**
635
636 (% class="table-bordered table-striped" %)
637 |=Property |=Data type|=Format|=Required|=Description
638 |=answers |array | |Yes |
639 | questionCode |string | |Yes |The code definition of the question
640 | answerCode |string | |Yes |The code definition of the answer
641
642 {{code language="http" title="**Response**"}}
643 HTTP/1.1 204 NoContent
644 Content-Type: application/json
645 {}
646 {{/code}}
647
648
649 **Possible problems**
650
651 (% class="table-bordered table-striped" %)
652 |=Http status |=Problem type |=Description
653 |400 |validation |Occurs if the validation of the request fails, it is described in the problem why the input is invalid.
654 |404 |not-found |Occurs if the customer found or if kyc is not configured on this ledger.
655 |409 |kyc-configuration |Occurs if ledger is not currently configured for KYC
656 |500 |fatal |Unexpected error, logs may give details about the problem
657
658 == Surpluses ==
659
660 A surplus is the remaining value from a payment that was greater than the current debt, also referred as an 'overpayment'. Each instance of an overpayment will create a new surplus. A surplus will often have a connection to an account or invoice based of where the payment was placed but surpluses without connection to an account or invoice also exist. Surpluses can be used to settle upcoming debt or be disbursed.
661
662 ==== Get specified Surplus information ====
663
664 {{code language="http" title="**Request**"}}
665 GET /ledger/customer/v1/XXX/customers/NNN/surpluses/YYY HTTP/1.1
666 Host: -
667 Authorization: Bearer <Token>
668 Content-Type: application/json
669 {{/code}}
670
671
672 {{code language="http" title="**Response**"}}
673 HTTP/1.1 200 OK
674 Content-Type: application/json
675
676 {
677 "surplusId": "YYY",
678 "balance": 10.00,
679 "currency": "SEK",
680 "date": "2023-01-01T00:00:00",
681 "status": "open",
682 "invoice": "/ledger/invoice/v1/XXX/invoices/AAA",
683 "account": "/ledger/account/v1/XXX/accounts/BBB",
684 "operations": [],
685 "@id": "/ledger/customer/v1/XXX/customers/NNN/surpluses/YYY"
686
687 {{/code}}
688
689 ==== Get list of Surpluses Information ====
690
691 {{code language="http" title="**Request**"}}
692 GET /ledger/customer/v1/XXX/customers/NNN/surpluses HTTP/1.1
693 Host: -
694 Authorization: Bearer <Token>
695 Content-Type: application/json
696 {{/code}}
697
698
699 {{code language="http" title="**Response**"}}
700 HTTP/1.1 200 OK
701 Content-Type: application/json
702
703 {
704 "items": [
705 {
706 "surplusId": "123",
707 "balance": 10.00,
708 "currency": "SEK",
709 "date": "2023-01-01T00:00:00",
710 "status": "open",
711 "invoice": "/ledger/invoice/v1/XXX/invoices/AAA",
712 "operations": [],
713 "@id": "/ledger/customer/v1/XXX/customers/NNN/surpluses/123"
714
715 },
716 {
717 "surplusId": "456",
718 "balance": 20.00,
719 "currency": "SEK",
720 "date": "2023-01-02T00:00:00",
721 "status": "pending-disbursement",
722 "account": "/ledger/account/v1/XXX/accounts/BBB",
723 "operations": [],
724 "@id": "/ledger/customer/v1/XXX/customers/NNN/surpluses/456"
725
726 },
727 {
728 "surplusId": "789",
729 "balance": 30.00,
730 "currency": "SEK",
731 "date": "2023-01-03T00:00:00",
732 "status": "pending-regulate",
733 "invoice": "/ledger/invoice/v1/XXX/invoices/AAA",
734 "operations": [],
735 "@id": "/ledger/customer/v1/XXX/customers/NNN/surpluses/789"
736
737 }
738 ],
739 "navigation": {
740 "@id": "/ledger/customer/v1/XXX/customers/NNN/surpluses",
741 "first": "/ledger/customer/v1/XXX/customers/NNN/surpluses?skip=0",
742 "previous": "/ledger/customer/v1/XXX/customers/NNN/surpluses?skip=0"
743 }
744 }
745 {{/code}}
746
747
748 ==== Surpluses resource properties ====
749
750 (% class="table-bordered table-striped" %)
751 |=(% style="width: 248px;" %)Property|=(% style="width: 108px;" %)Data type|=(% style="width: 233px;" %)Format|=(% style="width: 1196px;" %)Description
752 |(% style="width:248px" %)@id |(% style="width:108px" %)string|(% style="width:233px" %)Maxlength: |(% style="width:1196px" %)Uri of the specific surplus
753 |(% style="width:248px" %)surplusId|(% style="width:108px" %)string|(% style="width:233px" %)Maxlength: 50|(% style="width:1196px" %)Value is not considered case sensitive
754 |(% style="width:248px" %)balance|(% style="width:108px" %)string|(% style="width:233px" %) |(% style="width:1196px" %)Amount value for the surplus, always a positive value
755 |(% style="width:248px" %)currency|(% style="width:108px" %)string|(% style="width:233px" %)[[ISO 4217>>https://sv.wikipedia.org/wiki/ISO_4217]]|(% style="width:1196px" %)
756 |(% style="width:248px" %)date|(% style="width:108px" %)date|(% style="width:233px" %)yyyy-MM-ddTHH:mm:ss|(% style="width:1196px" %)Surplus creation date
757 |(% style="width:248px" %)status|(% style="width:108px" %)string|(% style="width:233px" %) |(% style="width:1196px" %)Expected statuses: open ~| pending-disbursement ~| pending-regulate
758 After a surplus has been depleted it will no longer be returned from the API
759 |(% style="width:248px" %)invoice|(% style="width:108px" %)string|(% style="width:233px" %) |(% style="width:1196px" %)Relative Uri to the connected source of the surplus through the Invoice API. A surplus can have a connection to an account or invoice but not both.
760 |(% style="width:248px" %)account|(% style="width:108px" %)string|(% style="width:233px" %) |(% style="width:1196px" %)Relative Uri to the connected source of the surplus through the Account API. A surplus can have a connection to an account or invoice but not both.
761
762 ----
763
764 == (% style="color:inherit; font-family:inherit" %)Active-Disbursement-Orders(%%) ==
765
766 This shows if current surplus has been ordered to disburse the surplus to the end customer.
767
768 ==== Get active disbursement orders ====
769
770
771 {{code language="http" title="**Request**"}}
772 GET /ledger/customer/v1/XXX/customers/NNN/surpluses/YYY/active-disbursement-orders HTTP/1.1
773 Host: -
774 Authorization: Bearer <Token>
775 Content-Type: application/json
776 {{/code}}
777
778
779 {{code language="http" title="**Response**"}}
780 HTTP/1.1 200 OK
781 Content-Type: application/json
782
783 {
784 "items": [
785 {
786 "operations": [],
787 "swedishBankAccount": {
788 "accountNo": "3300-1010101010",
789 "accountType": "BKSE"
790 }
791 }
792 ],
793 "navigation": {
794 "@id": "/ledger/customer/v1/XXX/customers/NNN/surpluses/YYY/active-disbursement-orders"
795 }
796 }
797 {{/code}}
798
799 (% id="HOperations" %)
800 ==== Operations ====
801
802 Depending on the current permissions the following operations is supported on the surplus resource
803
804 (% id="Hadd-billing-address" %)
805 ===== add-disbursement-orders =====
806
807 Method: POST
808 This operation will be available if agreed with payex.
809
810 (% id="HActive-payment-ordersresourceproperties" %)
811 ==== request properties ====
812
813 (% class="table-bordered table-striped" %)
814 |=Property|=Data type|=Required|=Description
815 |__**norwegianBankAccount**__|object|No*|
816 | accountNo|string|Yes|
817 |__**swedishBankAccount**__|object|No*|
818 | clearingNo|string|Yes|
819 | accountNo|string|Yes|
820 |__**international**__|object|No*|
821 | iban|string|Yes|
822 | bic|string|Yes|
823 |__**swedishSus**__|object|No*|
824 |**nationalIdentifier**|object|Yes|
825 | regNo|string|Yes|
826 | countryCode|string|Yes|
827 |**address**|object|Yes|
828 | addressee|string|Yes|
829 | streetAddress|string|No|
830 | coAddress|string|No|
831 | city|string|Yes|
832 | zipCode|string|Yes|
833 | countryCode|string|Yes|
834 | | | |
835
836 //* One and only one of the specified objects can be set at each request//
837
838 Examples
839
840 Create disbursement with swedish bank account
841
842 {{code language="http" title="**Request**"}}
843 POST /ledger/customer/v1/XXX/customers/NNN/surpluses/YYY/active-disbursement-orders HTTP/1.1
844 Host: -
845 Authorization: Bearer <Token>
846 Content-Type: application/json
847
848 {
849 "SwedishBankAccount" : {
850 "AccountNo":"944-1049000",
851 "AccountType":"BGSE"
852 }
853 }
854 {{/code}}
855
856 Create a disbursement order with a norwegian bankaccount
857
858 {{code language="http" title="**Request**"}}
859 POST /ledger/customer/v1/XXX/customers/NNN/surpluses/YYY/active-disbursement-orders HTTP/1.1
860 Host: -
861 Authorization: Bearer <Token>
862 Content-Type: application/json
863
864 {
865 "norwegianBankAccount" : {
866 "accountNo" : "1234"
867 }
868 }
869 {{/code}}
870
871 Create a disbursement order with an international bankaccount
872
873 {{code language="http" title="**Request**"}}
874 POST /ledger/customer/v1/XXX/customers/NNN/surpluses/YYY/active-disbursement-orders HTTP/1.1
875 Host: -
876 Authorization: Bearer <Token>
877 Content-Type: application/json
878
879 {
880 "international" : {
881 "iban" : "123456",
882 "bic" : "SWED..."
883 }
884 }
885 {{/code}}
886
887 Create disbursement order using "Swedbanks lön- och utbetalningssystem (SUS)"
888
889 {{code language="http" title="**Request**"}}
890 POST /ledger/customer/v1/XXX/customers/NNN/surpluses/YYY/active-disbursement-orders HTTP/1.1
891 Host: -
892 Authorization: Bearer <Token>
893 Content-Type: application/json
894
895 {
896 "swedishSus" : {
897 "nationalIdentifier": {
898 "regNo" : "YYYYMMDD-NNNN",
899 "countryCode" : "SE"
900 },
901 "address" : {
902 "addressee" : "Kalle Axelstopp",
903 "streetAddress" : "Axelgatan 18",
904 "coAddress" : null,
905 "city" : "STOCKHOLM",
906 "zipCode" : "16872",
907 "countryCode" : "se",
908 }
909 }
910 }
911 {{/code}}
912
913 (% aria-label="macro:code widget" contenteditable="false" role="region" tabindex="-1" %)
914 (((
915
916 )))
917
918 == (% style="color:inherit; font-family:inherit" %)Legal-address(%%) ==
919
920 The legal address is where claims is normally sent to. It is required for a customer to have a legal address registered
921
922 ==== Get the legal address of the customer ====
923
924 {{code language="http" title="**Request**"}}
925 GET /ledger/customer/v1/XXX/customers/NNN/legal-address HTTP/1.1
926 Host: -
927 Authorization: Bearer <Token>
928 Content-Type: application/json
929 {{/code}}
930
931
932 {{code language="http" title="**Response**"}}
933 HTTP/1.1 200 OK
934 Content-Type: application/json
935
936 {
937 "addressee" : "Britt-Marie Axelstopp",
938 "streetAddress" : "The street 18",
939 "coAddress" : "c/o Jansson",
940 "city" : "STOCKHOLM",
941 "zipCode" : "15961",
942 "countryCode" : "SE",
943 "operations" :
944 [
945 {
946 "rel" : "update",
947 "href" : "/ledger/customer/v1/XXX/customers/9999/legal-address",
948 "method" : "PUT"
949 },
950 {
951 "rel" : "update-legal-address-from-population-register",
952 "href" : "/ledger/customer/v1/XXX/customers/9999/legal-address/update-legal-address-from-population-register",
953 "method" : "POST"
954 }
955 ]
956 }
957 {{/code}}
958
959 ==== Operations ====
960
961 Depending on the current permissions the following operations is supported on the legal address resource
962
963 ===== Update (replace) =====
964
965 Method: PUT
966 Use this operation to update the address, this "PUT" operation will replace the existing billing-address with the address specified in the request body.
967
968 (% class="table-bordered table-striped" %)
969 |=(% style="width: 183px;" %)Property|=(% style="width: 1602px;" %)Required
970 |(% style="width:183px" %)addressee|(% style="width:1602px" %)Yes
971 |(% style="width:183px" %)streetAddress|(% style="width:1602px" %)No
972 |(% style="width:183px" %)coAddress|(% style="width:1602px" %)No
973 |(% style="width:183px" %)city|(% style="width:1602px" %)Yes
974 |(% style="width:183px" %)zipCode|(% style="width:1602px" %)Yes
975 |(% style="width:183px" %)countryCode|(% style="width:1602px" %)Yes
976
977 Example
978
979 {{code language="http" title="**Request**"}}
980 PUT /ledger/customer/v1/XXX/customers/NNN/legal-address HTTP/1.1
981 Host: -
982 Authorization: Bearer <Token>
983 Content-Type: application/json
984
985 {
986 "addressee" : "Kalle Axelstopp",
987 "streetAddress" : "Axelgatan 18",
988 "city" : "STOCKHOLM",
989 "zipCode" : "16872",
990 "countryCode" : "SE"
991 }
992 {{/code}}
993
994
995 ----
996
997 ===== update-legal-address-from-population-register =====
998
999 Method: POST
1000 Execution of this operation will result in an attempt to retrieve (and replace) the customer's legal address from the population registry.
1001
1002 (% class="box infomessage" %)
1003 (((
1004 Access to this operation is not normally granted, unless otherwise agreed.
1005 )))
1006
1007 {{code language="http" title="**Request**"}}
1008 POST /ledger/customer/v1/XXX/customers/NNN/legal-address/update-legal-address-from-population-register HTTP/1.1
1009 Host: -
1010 Authorization: Bearer <Token>
1011 Content-Type: application/json
1012
1013 {
1014 }
1015 {{/code}}
1016
1017 ----
1018
1019 ==== Legal-address resource properties ====
1020
1021 (% class="table-bordered table-striped" %)
1022 |=(% style="width: 161px;" %)Property|=(% style="width: 121px;" %)Data type|=(% style="width: 195px;" %)Format|=(% style="width: 1309px;" %)Description
1023 |(% style="width:161px" %)addressee|(% style="width:121px" %)string|(% style="width:195px" %)Maxlength: 72|(% style="width:1309px" %)Fullname
1024 |(% style="width:161px" %)streetAddress|(% style="width:121px" %)string|(% style="width:195px" %)Maxlength: 72|(% style="width:1309px" %)
1025 |(% style="width:161px" %)coAddress|(% style="width:121px" %)string|(% style="width:195px" %)Maxlength: 72|(% style="width:1309px" %)Care of (C/O) name. This is optional.
1026 |(% style="width:161px" %)city|(% style="width:121px" %)string|(% style="width:195px" %)Maxlength: 27|(% style="width:1309px" %)
1027 |(% style="width:161px" %)zipCode|(% style="width:121px" %)string|(% style="width:195px" %)Maxlength: 9|(% style="width:1309px" %)ZipCode without whitespaces
1028 |(% style="width:161px" %)countryCode|(% style="width:121px" %)string|(% style="width:195px" %)[[ISO 3166-1 alpha-2>>url:https://sv.wikipedia.org/wiki/ISO_3166]]|(% style="width:1309px" %)
1029
1030 ----
1031
1032 == Billing-address ==
1033
1034 The billing address is where invoices/bills/letters etc. is normally sent to.This address is optional
1035
1036 ==== Get the billing address of the customer ====
1037
1038 {{code language="http" title="**Request**"}}
1039 GET /ledger/customer/v1/XXX/customers/NNN/billing-address HTTP/1.1
1040 Host: -
1041 Authorization: Bearer <Token>
1042 Content-Type: application/json
1043 {{/code}}
1044
1045
1046 {{code language="http" title="**Response**"}}
1047 HTTP/1.1 200 OK
1048 Content-Type: application/json
1049
1050 {
1051 "addressee" : "Kalle Axelstopp",
1052 "streetAddress" : "Axelgatan 18",
1053 "coAddress" : "c/o Jansson",
1054 "city" : "STOCKHOLM",
1055 "zipCode" : "16872",
1056 "countryCode" : "SE",
1057 "operations" :
1058 [
1059 {
1060 "rel" : "update",
1061 "href" : "/ledger/customer/v1/XXX/customers/9999/billing-address",
1062 "method" : "PUT"
1063 },
1064 {
1065 "rel" : "delete",
1066 "href" : "/ledger/customer/v1/XXX/customers/9999/billing-address",
1067 "method" : "DELETE"
1068 }
1069 ]
1070 }
1071 {{/code}}
1072
1073 ==== Add a billing-address ====
1074
1075 (% class="table-bordered table-striped" %)
1076 |=(% style="width: 183px;" %)Property|=(% style="width: 1602px;" %)Required
1077 |(% style="width:183px" %)addressee|(% style="width:1602px" %)Yes
1078 |(% style="width:183px" %)streetAddress|(% style="width:1602px" %)No
1079 |(% style="width:183px" %)coAddress|(% style="width:1602px" %)No
1080 |(% style="width:183px" %)city|(% style="width:1602px" %)Yes
1081 |(% style="width:183px" %)zipCode|(% style="width:1602px" %)Yes
1082 |(% style="width:183px" %)countryCode|(% style="width:1602px" %)Yes
1083
1084 {{code language="http" title="**Request**"}}
1085 POST /ledger/customer/v1/XXX/customers/NNN/billing-address HTTP/1.1
1086 Host: -
1087 Authorization: Bearer <Token>
1088 Content-Type: application/json
1089
1090 {
1091 "addressee" : "Kalle Axelstopp",
1092 "streetAddress" : "Axelgatan 18",
1093 "city" : "STOCKHOLM",
1094 "zipCode" : "16872",
1095 "countryCode" : "SE"
1096 }
1097 {{/code}}
1098
1099 ==== Operations ====
1100
1101 Depending on the current permissions the following operations is supported on the billing address resource
1102
1103 ===== Update (replace) =====
1104
1105 Method: PUT
1106 Use this operation to update the address, the "PUT" body of the request should be accoring to the properties of the resource.
1107
1108 (% class="table-bordered table-striped" %)
1109 |=(% style="width: 183px;" %)Property|=(% style="width: 1602px;" %)Required
1110 |(% style="width:183px" %)addressee|(% style="width:1602px" %)Yes
1111 |(% style="width:183px" %)streetAddress|(% style="width:1602px" %)No
1112 |(% style="width:183px" %)coAddress|(% style="width:1602px" %)No
1113 |(% style="width:183px" %)city|(% style="width:1602px" %)Yes
1114 |(% style="width:183px" %)zipCode|(% style="width:1602px" %)Yes
1115 |(% style="width:183px" %)countryCode|(% style="width:1602px" %)Yes
1116
1117 {{code language="http" title="**Request**"}}
1118 PUT /ledger/customer/v1/XXX/customers/NNN/billing-address HTTP/1.1
1119 Host: -
1120 Authorization: Bearer <Token>
1121 Content-Type: application/json
1122
1123 {
1124 "addressee" : "Kalle Axelstopp",
1125 "streetAddress" : "Axelgatan 18",
1126 "city" : "STOCKHOLM",
1127 "zipCode" : "16872",
1128 "countryCode" : "SE"
1129 }
1130 {{/code}}
1131
1132 ===== Delete =====
1133
1134 Method: DELETE
1135 Use this operation to delete the billing address.
1136
1137 {{code language="http" title="**Request**"}}
1138 DELETE /ledger/customer/v1/XXX/customers/NNN/billing-address HTTP/1.1
1139 Host: -
1140 Authorization: Bearer <Token>
1141 Content-Type: application/json
1142
1143 {
1144 }
1145 {{/code}}
1146
1147 ==== Billing-address resource properties ====
1148
1149 (% class="table-bordered table-striped" %)
1150 |=Property|=(% style="width: 94px;" %)Data type|=(% style="width: 255px;" %)Format|=(% style="width: 1053px;" %)Description
1151 |addressee|(% style="width:94px" %)string|(% style="width:255px" %)Maxlength: 72|(% style="width:1053px" %)Fullname
1152 |streetAddress|(% style="width:94px" %)string|(% style="width:255px" %)Maxlength: 72|(% style="width:1053px" %)
1153 |coAddress|(% style="width:94px" %)string|(% style="width:255px" %)Maxlength: 72|(% style="width:1053px" %)Care of (C/O) name. This is optional.
1154 |city|(% style="width:94px" %)string|(% style="width:255px" %)Maxlength: 27|(% style="width:1053px" %)
1155 |zipCode|(% style="width:94px" %)string|(% style="width:255px" %)Maxlength: 9|(% style="width:1053px" %)ZipCode without whitespaces
1156 |countryCode|(% style="width:94px" %)string|(% style="width:255px" %)[[ISO 3166-1 alpha-2>>url:https://sv.wikipedia.org/wiki/ISO_3166]]|(% style="width:1053px" %)
1157
1158 ----
1159
1160 == Consent ==
1161
1162 The consent resource is used to get the underlying resources that display information or enable registration of a customer's consent.
1163
1164 ==== Get the underlying consent resources of the customer ====
1165
1166 {{code language="http" title="**Request**"}}
1167 GET /ledger/customer/v1/XXX/customers/NNN/consent HTTP/1.1
1168 Host: -
1169 Authorization: Bearer <Token>
1170 Content-Type: application/json
1171 {{/code}}
1172
1173
1174 {{code language="http" title="**Response**"}}
1175 HTTP/1.1 200 OK
1176 Content-Type: application/json
1177
1178 {
1179 "recurringCard": "/ledger/customer/v1/XXX/customers/NNN/consent/recurring-card",
1180 "recurringCardRedirectRegistration": "/ledger/customer/v1/XXX/customers/NNN/consent/recurring-card-redirect-registration"
1181 }
1182 {{/code}}
1183
1184 ==== Consent resource properties ====
1185
1186 (% class="table-bordered table-striped" %)
1187 |=Property|=(% style="width: 94px;" %)Data type|=(% style="width: 255px;" %)Format|=(% style="width: 1053px;" %)Description
1188 |recurringCard|(% style="width:94px" %)string|(% style="width:255px" %)Path|(% style="width:1053px" %)Endpoint to resource
1189 |recurringCardRedirectRegistration|(% style="width:94px" %)string|(% style="width:255px" %)Path|(% style="width:1053px" %)Endpoint to resource
1190
1191 ----
1192
1193 ==== Recurring-card ====
1194
1195 This resource provides details about the customer's active Recurring Card Consent and the ability to remove it.
1196
1197 ===== Get customer active Recurring Card Consent =====
1198
1199 {{code language="http" title="**Request**"}}
1200 GET /ledger/customer/v1/XXX/customers/NNN/consent/recurring-card HTTP/1.1
1201 Host: -
1202 Authorization: Bearer <Token>
1203 Content-Type: application/json
1204 {{/code}}
1205
1206
1207 {{code language="http" title="**Response**"}}
1208 HTTP/1.1 200 OK
1209 Content-Type: application/json
1210
1211 {
1212 "cardToken": "2eb28854-07ec-4e88-b672-7c61cc54b461",
1213 "consentExpiryDate": "04-2035",
1214 "instrumentDisplayName": "551000******1232",
1215 "cardExpiryDate": "04/2035"
1216 }
1217 {{/code}}
1218
1219 ===== Delete customer active Recurring Card Consent =====
1220
1221 {{code language="http" title="**Request**"}}
1222 DELETE /ledger/customer/v1/XXX/customers/NNN/consent/recurring-card HTTP/1.1
1223 Host: -
1224 Authorization: Bearer <Token>
1225 Content-Type: application/json
1226
1227 {
1228 }
1229 {{/code}}
1230
1231 {{code language="http" title="**Response**"}}
1232 HTTP/1.1 204 NoContent
1233 Content-Type: application/json
1234
1235 {
1236 }
1237 {{/code}}
1238
1239 ===== Recurring-card resource properties =====
1240
1241 (% class="table-bordered table-striped" %)
1242 |=Property|=(% style="width: 94px;" %)Data type|=(% style="width: 255px;" %)Format|=(% style="width: 1053px;" %)Description
1243 |cardToken|(% style="width:94px" %)string|(% style="width:255px" %)Guid|(% style="width:1053px" %)Card Token Id
1244 |consentExpiryDate|(% style="width:94px" %)string|(% style="width:255px" %)Date (MM-yyyy)|(% style="width:1053px" %)Expiry date of the consent
1245 |instrumentDisplayName|(% style="width:94px" %)string|(% style="width:255px" %)Masked number|(% style="width:1053px" %)Masked card number used in the presentation layer
1246 |cardExpiryDate|(% style="width:94px" %)string|(% style="width:255px" %)Date (MM/yyyy)|(% style="width:1053px" %)Expiry date of the card
1247
1248 ----
1249
1250 ==== Recurring-card-redirect-registration ====
1251
1252 Initializes the customer's Recurring Card registration with redirect to SwedbankPay. The resource should be inquired until the status reaches an end status. Only one registration can be active at a time.
1253
1254 ===== Start a Recurring Card registration =====
1255
1256 (% class="table-bordered table-striped" %)
1257 |=(% style="width: 509px;" %)Property|=(% style="width: 161px;" %)Required|=(% style="width: 1852px;" %)Comment
1258 |(% style="width:509px" %)completeUrl|(% style="width:161px" %)Yes|(% style="width:1852px" %)Redirect Url to be used if the user completes the card verification process.
1259 |(% style="width:509px" %)cancelUrl|(% style="width:161px" %)Yes|(% style="width:1852px" %)Redirect Url to be used if the user cancels the card verification process.
1260 |(% style="width:509px" %)language|(% style="width:161px" %)Yes|(% style="width:1852px" %)A language specified in the ISO 639-1 language code and with two letter country codes in the format "xx-YY". The following pairs are available: "en-US", "sv-SE", "nb-NO", "da-DK" and "fi-FI".
1261
1262 {{code language="http" title="**Request**"}}
1263 POST /ledger/customer/v1/XXX/customers/NNN/consent/recurring-card-redirect-registration HTTP/1.1
1264 Host: -
1265 Authorization: Bearer <Token>
1266 Content-Type: application/json
1267
1268 {
1269 "completeUrl": "https://www.google.com/search?q=cancelurl",
1270 "cancelUrl": "https://www.google.com/search?q=completeurl",
1271 "language": "en-US"
1272 }
1273 {{/code}}
1274
1275
1276 {{code language="http" title="**Response**"}}
1277 HTTP/1.1 200 OK
1278 Content-Type: application/json
1279
1280 {
1281 "redirectUrl": "https://ecom.externalintegration.payex.com/checkout/abc123",
1282 "status": "Initialized",
1283 "@id": "/ledger/customer/v1/xxx/customers/yyy/consent/recurring-card-redirect-registration"
1284 }
1285 {{/code}}
1286
1287 ===== Get Recurring Card Redirect Registration =====
1288
1289 {{code language="http" title="**Request**"}}
1290 GET /ledger/customer/v1/XXX/customers/NNN/consent/recurring-card-redirect-registration HTTP/1.1
1291 Host: -
1292 Authorization: Bearer <Token>
1293 Content-Type: application/json
1294
1295 {
1296 }
1297 {{/code}}
1298
1299
1300 {{code language="http" title="**Response**"}}
1301 HTTP/1.1 200 OK
1302 Content-Type: application/json
1303
1304 {
1305 "redirectUrl": "https://ecom.externalintegration.payex.com/checkout/abc123",
1306 "status": "Initialized"
1307 }
1308 {{/code}}
1309
1310 ===== Recurring-card-redirect-registration resource properties =====
1311
1312 (% class="table-bordered table-striped" %)
1313 |=Property|=(% style="width: 94px;" %)Data type|=(% style="width: 255px;" %)Format|=(% style="width: 1053px;" %)Description
1314 |redirectUrl|(% style="width:94px" %)string|(% style="width:255px" %)Url|(% style="width:1053px" %)The redirect url to a flow that confirms the validity of card information without reserving or charging any amount.
1315 |status|(% style="width:94px" %)string|(% style="width:255px" %) |(% style="width:1053px" %)Status of the card validity verification process. One of the following: "Initialized", "Completed", "Aborted" or "Failed".
1316
1317 ----
1318
1319 == Find customer ==
1320
1321 The **find customer **resource is located under **ledger/customer/v1/ **api**. **It is used to find customer with nationalIdentifier.
1322
1323 (% class="table-bordered table-striped" %)
1324 |=(% style="width: 222px;" %)Property|=(% style="width: 1562px;" %)Required
1325 |(% style="width:222px" %)nationalIdentifier.regNo|(% style="width:1562px" %)Yes
1326 |(% style="width:222px" %)nationalIdentifier.countryCode|(% style="width:1562px" %)Yes
1327
1328 {{code language="http" title="**Request**"}}
1329 POST /ledger/customer/v1/XXX/find-customer HTTP/1.1
1330 Host: -
1331 Authorization: Bearer <Token>
1332 Content-Type: application/json
1333
1334 {
1335 "nationalIdentifier": {
1336 "regNo" : "YYYYMMDD-NNNN",
1337 "countryCode" : "SE"
1338 }
1339 }
1340 {{/code}}
1341
1342 {{code language="http" title="**Response**"}}
1343 HTTP/1.1 200 OK
1344 Content-Type: application/json
1345
1346 {
1347 "@id" : "/ledger/customer/v1/XXX/customers/9999",
1348 "customerNo" : " 9999"
1349 }
1350 {{/code}}
1351
1352 (% id="HAccountresourceproperties" %)
1353 ==== Find customer resource properties ====
1354
1355 (% class="table-bordered table-striped" %)
1356 |=(% style="width: 248px;" %)Property|=(% style="width: 108px;" %)Data type|=(% style="width: 233px;" %)Format|=(% style="width: 1196px;" %)Description
1357 |(% style="width:248px" %)@id |(% style="width:108px" %)string|(% style="width:233px" %)Maxlength: |(% style="width:1196px" %)Uri of the specific customer
1358 |(% style="width:248px" %)customerNo|(% style="width:108px" %)string|(% style="width:233px" %)Maxlength: 15|(% style="width:1196px" %)
1359 |(% style="width:248px" %)nationalIdentifier.regNo|(% style="width:108px" %)string|(% style="width:233px" %)Country specific|(% style="width:1196px" %)Sweden: YYYYMMDD-NNNC
1360 Norway: DDMMYYNNNNN
1361 |(% style="width:248px" %)nationalIdentifier.countryCode|(% style="width:108px" %)string|(% style="width:233px" %)[[ISO 3166-1 alpha-2>>url:https://sv.wikipedia.org/wiki/ISO_3166]]|(% style="width:1196px" %)
1362
1363 ----
1364
1365 == Generate customer ==
1366
1367 The **generate consumer customer by reg no **resource is located under **ledger/customer/v1/ **api**. **It is used to genarate a customer with a nationalIdentifier. It will retreive an legal address from the population register and create a consumer customer.
1368
1369 (% class="box infomessage" %)
1370 (((
1371 Access to this operation is not normally granted, unless otherwise agreed.
1372 )))
1373
1374 (% class="table-bordered table-striped" %)
1375 |=(% style="width: 222px;" %)Property|=(% style="width: 1562px;" %)Required
1376 |(% style="width:222px" %)customerNo|(% style="width:1562px" %)No
1377 |(% style="width:222px" %)nationalIdentifier.regNo|(% style="width:1562px" %)Yes
1378 |(% style="width:222px" %)nationalIdentifier.countryCode|(% style="width:1562px" %)Yes
1379 |(% style="width:222px" %)emailAddress|(% style="width:1562px" %)No
1380 |(% style="width:222px" %)msisdn|(% style="width:1562px" %)No
1381
1382 {{code language="http" title="**Request**"}}
1383 POST /ledger/customer/v1/XXX/generate-consumer-customer-by-reg-no HTTP/1.1
1384 Host: -
1385 Authorization: Bearer <Token>
1386 Content-Type: application/json
1387
1388 {
1389 "nationalIdentifier": {
1390 "regNo" : "YYYYMMDD-NNNN",
1391 "countryCode" : "SE"
1392 },
1393 "emailAddress" : "britt@axelstopp.com",
1394 "msisdn" : "+91485918841",
1395 "customerNo" : "9999"
1396 }
1397 {{/code}}
1398
1399 {{code language="http" title="**Response**"}}
1400 HTTP/1.1 201 CREATED
1401 Content-Type: application/json
1402
1403 {
1404 "@id" : "/ledger/customer/v1/XXX/customers/9999",
1405 "customerNo" : " 9999"
1406 }
1407 {{/code}}
1408
1409 (% id="HAccountresourceproperties" %)
1410 ==== Generate customer resource properties ====
1411
1412 (% class="table-bordered table-striped" %)
1413 |=(% style="width: 248px;" %)Property|=(% style="width: 108px;" %)Data type|=(% style="width: 233px;" %)Format|=(% style="width: 1196px;" %)Description
1414 |(% style="width:248px" %)@id |(% style="width:108px" %)string|(% style="width:233px" %)Maxlength: |(% style="width:1196px" %)Uri of the specific customer
1415 |(% style="width:248px" %)customerNo|(% style="width:108px" %)string|(% style="width:233px" %)Maxlength: 15|(% style="width:1196px" %)
1416 |(% style="width:248px" %)nationalIdentifier.regNo|(% style="width:108px" %)string|(% style="width:233px" %)Country specific|(% style="width:1196px" %)Sweden: YYYYMMDD-NNNC
1417 Norway: DDMMYYNNNNN
1418 |(% style="width:248px" %)nationalIdentifier.countryCode|(% style="width:108px" %)string|(% style="width:233px" %)[[ISO 3166-1 alpha-2>>url:https://sv.wikipedia.org/wiki/ISO_3166]]|(% style="width:1196px" %)
1419 |(% style="width:248px" %)emailAddress|(% style="width:108px" %)string|(% style="width:233px" %)Maxlength: 254
1420 Regex pattern: [^@]+@[^\.]+\..+|(% style="width:1196px" %)
1421 |(% style="width:248px" %)msisdn|(% style="width:108px" %)string|(% style="width:233px" %)Maxlength: 15|(% style="width:1196px" %) "Mobile Subscriber Integrated Services Digital Network Number", ie. Cellphone number
1422 +46720000000
1423
1424 {{display reference="developer:Main.Invoicing.ledger-api-general-docs.api-section-problems.WebHome"/}}
1425
1426 ----
1427
1428 == Kys-Questions ==
1429
1430 The **Kys-Questions** resource is located under **ledger/customer/v1/ **api**. **Get the company Know-your-customer(KYC) questions and possible answers, if company no configured questions then it returns Http Status 404
1431
1432 (% class="box infomessage" %)
1433 (((
1434 This endpoint has an optional query parameter **Language**, used to set desired translations for the questions by **Language Code(ISO 639-1)**. If not set or if language code is not supported then translations defaults to EN(English).
1435 Just as the questions, accepted languages differs by configurations, if you are missing a translation please contact our support.
1436
1437 Example: ///ledger/customer/v1/{ledgerNo}/Kyc-Questions?**language=sv **//
1438 )))
1439
1440 Get KYC questions from ledger using company number as identifier
1441
1442 ==== Get list of Kyc-questions ====
1443
1444 {{code language="http" title="**Request**"}}
1445 GET /ledger/customer/v1/{ownerNo}/kyc-questions?language={language} HTTP/1.1
1446 Host: -
1447 Authorization: Bearer<Token>
1448 Content-Type: application/json
1449
1450 {{/code}}
1451
1452 Get CompanyInstance KYC questions if configured or a 404 company-kyc-questions-not-configured response if not
1453
1454 {{code language="http" title="**Response**"}}
1455 HTTP/1.1 200 OK
1456 Content-Type: application/json
1457
1458 {
1459 "kycQuestions": [
1460 {
1461 "questionText": "What is your current employment?",
1462 "answer": {
1463 "type": "single",
1464 "required": true,
1465 "possibleAnswers": [
1466 {
1467 "answerCode": "selfemployed",
1468 "answerText": "Own business"
1469 },
1470 {
1471 "answerCode": "private_employee",
1472 "answerText": "Private employee"
1473 },
1474 {
1475 "answerCode": "goverment_employee",
1476 "answerText": "Government employee"
1477 }
1478 ]
1479 },
1480 "questionCode": "employment"
1481 },
1482 {
1483 "questionText": "What is your yearly income",
1484 "answer": {
1485 "type": "single",
1486 "required": true,
1487 "possibleAnswers": [
1488 {
1489 "answerCode": "incomeinterval1",
1490 "answerText": "0-100 000 SEK"
1491 },
1492 {
1493 "answerCode": "incomeinterval2",
1494 "answerText": "100 001-200 000 SEK"
1495 },
1496 {
1497 "answerCode": "incomeinterval3",
1498 "answerText": "200 001-300 000 SEK"
1499 },
1500 {
1501 "answerCode": "incomeinterval4",
1502 "answerText": "Over 300 001 SEK"
1503 }
1504 ]
1505 },
1506 "questionCode": "income"
1507 }
1508 ],
1509 "operations": []
1510 }
1511 {{/code}}
1512
1513
1514
1515 **Possible problems**
1516
1517 (% class="table-bordered table-striped" %)
1518 |=Http status |=Problem type |=Description
1519 |400 |general-validation-error |Validation error when accessing resource . Please refer to the problems property for additional details.
1520 |404 |company-kyc-questions-not-configured |The requested resource '' was not found.
1521 |500 |internal-server-error |The requested resource '' could not be processed. Please contact support.
1522 |500 |handled-exception |The requested resource '' could not be processed. Please contact support.
1523 |500 |unhandled-exception |The requested resource '' could not be processed. Please contact support.
1524
1525 **Response object specification**
1526
1527 (% class="table-bordered table-striped" %)
1528 |=Property |=Data type|=Format|=Description
1529 |@id |string | |Uri identifier of the current resource
1530 |=kycQuestions |array of question's| |
1531 | question.questionCode |string | |The code definition of the question. Use this value when creating an answer request for /customers/{customerNo}/update-kyc-answers
1532 | question.questionText |string | |The translated text of the question
1533 |= answer |object | |
1534 | type |string | |(((
1535 The type of the expected answer:
1536
1537 * **single | **one answer only
1538 * **multi **| possible multiple answer
1539 * **text** | free text answer
1540 )))
1541 | required |boolean | |If the answer is required
1542 | textValidationRegEx |string | |The regex the answer should match, not all answers has a defined RegEx.
1543 |= possibleAnswers |array of possibleAwnser's| |
1544 | possibleAwnser.answerCode |string | |The code definition of the answer. Use this value when creating an answer request for /customers/{customerNo}/update-kyc-answers
1545 | possibleAwnser.answerText |string | |The translated text of the answer
1546 |= subQuestions |array of question's| |Is recursive structure of **kycQuestions** but limited to depth of 1, meaning a sub question can't have sub questions.
1547 |operations |array | |List of operations that is possible to perform on the current resource, read more about the ~[~[hypermedia part of the response>>https://developer.payex.com/xwiki/wiki/developer/view/Main/Invoicing/ledger-api-general-docs/restful-pattern-guideline/#HHyper-mediaresponse]]
1548
1549 {{display reference="developer:Main.Invoicing.ledger-api-general-docs.api-section-problems.WebHome"/}}
1550
1551
1552 === Problem types ===
1553
1554 (% class="box infomessage" %)
1555 (((
1556 Note, each problem typecode is preceded by "ledger/customer/v1/problems/" in this API, e.g. the error "validation" in the table below will appear as typecode "ledger/customer/v1/problems/validation".
1557 )))
1558
1559 (% class="table-bordered table-striped" %)
1560 |=(% style="width: 537px;" %)Problem type (code)|=(% style="width: 172px;" %)Httpstatus|=(% style="width: 796px;" %)Description
1561 |(% style="width:537px" %)validation|(% style="width:172px" %)400|(% style="width:796px" %)occurs if any of the inputvalidation fails, it is described in the problem which parameter that failed the validation
1562 |(% style="width:537px" %)forbidden|(% style="width:172px" %)403|(% style="width:796px" %)occurs if access to method is not allowed.
1563 |(% style="width:537px" %)not-found|(% style="width:172px" %)404|(% style="width:796px" %)specified resource not found
1564 |(% style="width:537px" %)customer-not-found|(% style="width:172px" %)404|(% style="width:796px" %)specified customer number does not exists
1565 |(% style="width:537px" %)legal-address-does-not-exists|(% style="width:172px" %)404|(% style="width:796px" %)legal address does not exists for the specified customer
1566 |(% style="width:537px" %)billing-address-does-not-exists|(% style="width:172px" %)404|(% style="width:796px" %)billing address does not exists for the specified customer
1567 |(% style="width:537px" %) |(% style="width:172px" %) |(% style="width:796px" %)