Changes for page 2. Customer

Last modified by Thomas Hedström on 2025/02/14 16:16
From empty
To version 227.1
edited by Thomas Hedström
on 2025/02/14 12:50
Change comment: There is no comment for this version

Summary

Details

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