Changes for page 2 Customer
Last modified by David Persson on 2023/04/27 14:54
From empty
To version 132.1
edited by David Persson
on 2023/04/27 14:54
on 2023/04/27 14:54
Change comment: There is no comment for this version
Summary
-
Page properties (6 modified, 0 added, 0 removed)
-
Attachments (0 modified, 3 added, 0 removed)
Details
- Page properties
-
- Title
-
... ... @@ -1,0 +1,1 @@ 1 +2 Customer - Parent
-
... ... @@ -1,0 +1,1 @@ 1 +developer:Main.Invoicing.invoice-service.invoice-service-apis.Technical reference.WebHome - Author
-
... ... @@ -1,1 +1,1 @@ 1 - XWiki.XWikiGuest1 +xwiki:XWiki.dap - Default language
-
... ... @@ -1,0 +1,1 @@ 1 +en - Tags
-
... ... @@ -1,0 +1,1 @@ 1 +px-custom-page-content - Content
-
... ... @@ -1,0 +1,869 @@ 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:1612164561442-820.png||height="242" width="558"]] 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 +//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 +== Customer == 38 + 39 +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. 40 + 41 +==== (% style="color:inherit; font-family:inherit" %)Get a specific customer(%%) ==== 42 + 43 +{{code language="http" title="**Request**"}} 44 +GET /ledger/customer/v1/XXX/customers/NNN HTTP/1.1 45 +Host: - 46 +Authorization: Bearer <Token> 47 +Content-Type: application/json 48 +{{/code}} 49 + 50 +==== ==== 51 + 52 +{{code language="http" title="**Response**"}} 53 +HTTP/1.1 200 OK 54 +Content-Type: application/json 55 + 56 +{ 57 + "@id" : "/ledger/customer/v1/XXX/customers/9999", 58 + "customerNo" : "9999", 59 + "nationalIdentifier": { 60 + "regNo" : "YYYYMMDD-NNNN", 61 + "countryCode" : "SE" 62 + }, 63 + "vatNo" : "SE101010101001", 64 + "legalEntity" : "consumer|business", 65 + "name" : "Britt-Marie Axelstopp", 66 + "emailAddress" : "britt@axelstopp.com", 67 + "msisdn" : "+91485918841", 68 + "activeConsents": [ 69 + "Betalingsservice", 70 + "Avtalegiro" 71 + ], 72 + "eDIAddressInfo" : { 73 + "VAN": "ABCXYZ", 74 + "InterChangeRecipient": "Recipient_ID1", 75 + "BuyerId": "123465" 76 + }, 77 + "legalAddress" : "/ledger/customer/v1/XXX/customers/9999/legal-address", 78 + "billingAddress" : "/ledger/customer/v1/XXX/customers/9999/billing-address", 79 + "operations" : 80 + [ 81 + { 82 + "rel" : "add-billing-address", 83 + "href" : "/ledger/customer/v1/XXX/customers/9999/billing-address", 84 + "method" : "POST" 85 + } 86 + ] 87 +} 88 +{{/code}} 89 + 90 +==== Get a specific customer using $expand ==== 91 + 92 +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. 93 + 94 +(% class="box infomessage" %) 95 +((( 96 +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. 97 +))) 98 + 99 +{{code language="http" title="**Request**"}} 100 +GET /ledger/customer/v1/XXX/customers/NNN?$expand=legaladdress,billingaddress HTTP/1.1 101 +Host: - 102 +Authorization: Bearer <Token> 103 +Content-Type: application/json 104 +{{/code}} 105 + 106 + 107 +{{code language="http" title="**Response**"}} 108 +HTTP/1.1 200 OK 109 +Content-Type: application/json 110 + 111 +{ 112 + "@id" : "/ledger/customer/v1/XXX/customers/9999", 113 + "customerNo" : "9999", 114 + "nationalIdentifier": { 115 + "regNo" : "YYYYMMDD-NNNN", 116 + "countryCode" : "SE" 117 + }, 118 + "vatNo" : "SE101010101001", 119 + "legalEntity" : "consumer|business", 120 + "name" : "Britt-Marie Axelstopp", 121 + "emailAddress" : "britt@axelstopp.com", 122 + "msisdn" : "+91485918841", 123 + "activeConsents": [ 124 + "Betalingsservice", 125 + "Avtalegiro" 126 + ], 127 + "eDIAddressInfo" : { 128 + "VAN": "ABCXYZ", 129 + "InterChangeRecipient": "Recipient_ID1", 130 + "BuyerId": "123456" 131 + }, 132 + "legalAddress" : { 133 + "addressee" : "Britt-Marie Axelstopp", 134 + "streetAddress" : "The street 18", 135 + "coAddress" : "c/o Jansson", 136 + "city" : "STOCKHOLM", 137 + "zipCode" : "15961", 138 + "countryCode" : "SE", 139 + "operations" : 140 + [ 141 + { 142 + "rel" : "update", 143 + "href" : "/ledger/customer/v1/XXX/customers/9999/legal-address", 144 + "method" : "PUT" 145 + }, 146 + { 147 + "rel" : "update-legal-address-from-population-register", 148 + "href" : "/ledger/customer/v1/XXX/customers/9999/legal-address", 149 + "method" : "POST" 150 + } 151 + ] 152 + }, 153 + "billingAddress" : { 154 + "addressee" : "Kalle Axelstopp", 155 + "streetAddress" : "Axelgatan 18", 156 + "city" : "STOCKHOLM", 157 + "zipCode" : "16872", 158 + "countryCode" : "se", 159 + "operations" : 160 + [ 161 + { 162 + "rel" : "update", 163 + "href" : "/ledger/customer/v1/XXX/customers/9999/billing-address", 164 + "method" : "PUT" 165 + }, 166 + { 167 + "rel" : "delete", 168 + "href" : "/ledger/customer/v1/XXX/customers/9999/billing-address", 169 + "method" : "DELETE" 170 + } 171 + ] 172 + }, 173 + "operations" : 174 + [ 175 + { 176 + "rel" : "add-billing-address", 177 + "href" : "/ledger/customer/v1/XXX/customers/9999/billing-address", 178 + "method" : "POST" 179 + } 180 + ] 181 +} 182 +{{/code}} 183 + 184 + 185 +---- 186 + 187 +==== Create new customer ==== 188 + 189 + 190 +(% id="HImportanttonote21" %) 191 +===== Important to note! ===== 192 + 193 +* Standard length of customerNo in Norway and Denmark is 7 characters (numeric only). 194 +* Only use numeric characters and not with a leading zero for customerNo in Sweden, in order to use AutoGiro (Direct Debit). 195 +* Dependency to legalEntity: 196 +** [[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). 197 +** 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". 198 +** 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. 199 +** Finland only: Different claim processes will be used depending on "consumer" or "business". 200 + 201 +A new customer is created by making a POST call to the API. 202 +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. 203 + 204 +(% class="table-bordered table-striped" %) 205 +|=(% style="width: 509px;" %)Property|=(% style="width: 161px;" %)Required|=(% style="width: 1852px;" %)Comment * 206 +|(% 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.// 207 +|(% 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.// 208 +|(% style="width:509px" %) nationalIdentifier.regNo|(% style="width:161px" %)Yes|(% style="width:1852px" %) 209 +|(% style="width:509px" %) nationalIdentifier.countryCode|(% style="width:161px" %)Yes|(% style="width:1852px" %) 210 +|(% style="width:509px" %)vatNo|(% style="width:161px" %)No*|(% style="width:1852px" %)Required if reverse tax is used 211 +|(% style="width:509px" %)legalEntity|(% style="width:161px" %)No|(% style="width:1852px" %) 212 +|(% style="width:509px" %)name|(% style="width:161px" %)Yes|(% style="width:1852px" %) 213 +|(% style="width:509px" %)emailAddress|(% style="width:161px" %)No|(% style="width:1852px" %) 214 +|(% style="width:509px" %)msisdn|(% style="width:161px" %)No|(% style="width:1852px" %) 215 +|(% style="width:509px" %)protectedIdentity|(% style="width:161px" %)No|(% style="width:1852px" %) 216 +|(% style="width:509px" %)distributionType|(% style="width:161px" %)No|(% style="width:1852px" %) 217 +|(% style="width:509px" %)__**eDIAddressInfo**__|(% style="width:161px" %)No|(% style="width:1852px" %) 218 +|(% style="width:509px" %) eDIAddressInfo.van|(% style="width:161px" %)No|(% style="width:1852px" %)((( 219 + 220 +))) 221 +|(% style="width:509px" %) eDIAddressInfo.interChangeRecipient|(% style="width:161px" %)No|(% style="width:1852px" %) 222 +|(% style="width:509px" %) eDIAddressInfo.BuyerId|(% style="width:161px" %)Yes|(% style="width:1852px" %) 223 +|(% style="width:509px" %)**__legalAddress__**|(% style="width:161px" %)Yes|(% style="width:1852px" %) 224 +|(% style="width:183px" %) addressee|(% style="width:1602px" %)Yes|(% style="width:1852px" %) 225 +|(% style="width:183px" %) streetAddress|(% style="width:1602px" %)No|(% style="width:1852px" %) 226 +|(% style="width:183px" %) coAddress|(% style="width:1602px" %)No|(% style="width:1852px" %) 227 +|(% style="width:183px" %) city|(% style="width:1602px" %)Yes|(% style="width:1852px" %) 228 +|(% style="width:183px" %) zipCode|(% style="width:1602px" %)Yes|(% style="width:1852px" %) 229 +|(% style="width:183px" %) countryCode|(% style="width:1602px" %)Yes|(% style="width:1852px" %) 230 +|(% style="width:509px" %)**__billingAddress__**|(% style="width:161px" %)No|(% style="width:1852px" %) 231 +|(% style="width:183px" %) addressee|(% style="width:1602px" %)Yes|(% style="width:1852px" %) 232 +|(% style="width:183px" %) streetAddress|(% style="width:1602px" %)No|(% style="width:1852px" %) 233 +|(% style="width:183px" %) coAddress|(% style="width:1602px" %)No|(% style="width:1852px" %) 234 +|(% style="width:183px" %) city|(% style="width:1602px" %)Yes|(% style="width:1852px" %) 235 +|(% style="width:183px" %) zipCode|(% style="width:1602px" %)Yes|(% style="width:1852px" %) 236 +|(% style="width:183px" %) countryCode|(% style="width:1602px" %)Yes|(% style="width:1852px" %) 237 + 238 +===== Examples ===== 239 + 240 +(% class="wikigeneratedid" %) 241 +Standard create customer 242 + 243 +{{code language="http" title="**Request**"}} 244 +POST /ledger/customer/v1/XXX/customers HTTP/1.1 245 +Host: - 246 +Authorization: Bearer <Token> 247 +Content-Type: application/json 248 + 249 +{ 250 + "customerNo" : "9999", 251 + "nationalIdentifier": { 252 + "regNo" : "YYYYMMDD-NNNN", 253 + "countryCode" : "SE" 254 + }, 255 + "vatNo" : "SE101010101001", 256 + "legalEntity" : "consumer|business", 257 + "name" : "Britt-Marie Axelstopp", 258 + "emailAddress" : "britt@axelstopp.com", 259 + "msisdn" : "+91485918841", 260 + "protectedIdentity" : false, 261 + "eDIAddressInfo" : { 262 + "VAN": "ABCXYZ", 263 + "InterChangeRecipient": "Recipient_ID1", 264 + "BuyerId": "123456" 265 + }, 266 + "legalAddress" : { 267 + "addressee" : "Britt-Marie Axelstopp", 268 + "streetAddress" : "The street 18", 269 + "coAddress" : "c/o Jansson", 270 + "city" : "STOCKHOLM", 271 + "zipCode" : "15961", 272 + "countryCode" : "SE" 273 + }, 274 + "distributionType": "postal" 275 +} 276 +{{/code}} 277 + 278 +(% id="HAccountresourceproperties" %) 279 +==== ==== 280 + 281 +{{code language="http" title="**Response**"}} 282 +HTTP/1.1 201 CREATED 283 +Content-Type: application/json 284 + 285 +{ 286 + "@id" : "/ledger/customer/v1/XXX/customers/9999", 287 + "customerNo" : " 9999" 288 +} 289 +{{/code}} 290 + 291 +(% class="wikigeneratedid" id="HCreatecustomerwithbilling-address" %) 292 +Create customer with billing-address 293 + 294 +{{code language="http" title="**Request**"}} 295 +POST /ledger/customer/v1/XXX/customers HTTP/1.1 296 +Host: - 297 +Authorization: Bearer <Token> 298 +Content-Type: application/json 299 + 300 +{ 301 + "customerNo" : "9999", 302 + "nationalIdentifier": { 303 + "regNo" : "YYYYMMDD-NNNN", 304 + "countryCode" : "SE" 305 + }, 306 + "vatNo" : "SE101010101001", 307 + "legalEntity" : "consumer|business", 308 + "name" : "Britt-Marie Axelstopp", 309 + "emailAddress" : "britt@axelstopp.com", 310 + "msisdn" : "+91485918841", 311 + "eDIAddressInfo" : { 312 + "VAN": "ABCXYZ", 313 + "InterChangeRecipient": "Recipient_ID1", 314 + "BuyerId": "123456" 315 + }, 316 + "legalAddress" : { 317 + "addressee" : "Britt-Marie Axelstopp", 318 + "streetAddress" : "The street 18", 319 + "coAddress" : "c/o Jansson", 320 + "city" : "STOCKHOLM", 321 + "zipCode" : "15961", 322 + "countryCode" : "SE" 323 + }, 324 + "billingAddress" : { 325 + "addressee" : "Kalle Axelstopp", 326 + "streetAddress" : "Axelgatan 18", 327 + "city" : "STOCKHOLM", 328 + "zipCode" : "16872", 329 + "countryCode" : "SE" 330 + } 331 +} 332 +{{/code}} 333 + 334 +(% id="HAccountresourceproperties" %) 335 +==== ==== 336 + 337 +{{code language="http" title="**Response**"}} 338 +HTTP/1.1 201 CREATED 339 +Content-Type: application/json 340 + 341 +{ 342 + "@id" : "/ledger/customer/v1/XXX/customers/9999", 343 + "customerNo" : " 9999" 344 +} 345 +{{/code}} 346 + 347 +==== ==== 348 + 349 +---- 350 + 351 +==== Update customer ==== 352 + 353 +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). // 354 + 355 +The following customer properties is possible to update through a patch call 356 + 357 +(% class="table-bordered table-striped" %) 358 +|=(% style="width: 509px;" %)Property 359 +|(% style="width:509px" %)emailAddress 360 +|(% style="width:509px" %)msisdn 361 +|(% style="width:509px" %)distributionType 362 +|(% style="width:509px" %)__**eDIAddressInfo**__ 363 +|(% style="width:509px" %) eDIAddressInfo.van 364 +|(% style="width:509px" %) eDIAddressInfo.interChangeRecipient 365 +|(% style="width:509px" %) eDIAddressInfo.BuyerId 366 + 367 +===== Examples ===== 368 + 369 +Update all properties 370 + 371 +{{code language="http" title="**Request**"}} 372 +PATCH /ledger/customer/v1/XXX/customers/NNN HTTP/1.1 373 +Host: - 374 +Authorization: Bearer <Token> 375 +Content-Type: application/json 376 + 377 +{ 378 + "emailAddress" : "britt@axelstopp.com", 379 + "msisdn" : "+91485918841", 380 + "eDIAddressInfo" : { 381 + "VAN": "ABCXYZ", 382 + "InterChangeRecipient": "Recipient_ID1", 383 + "BuyerId": "123456" 384 + }, 385 + "distributionType": "postal" 386 +} 387 +{{/code}} 388 + 389 +Update only emailAddress 390 + 391 +{{code language="http" title="**Request**"}} 392 +PATCH /ledger/customer/v1/XXX/customers/NNN HTTP/1.1 393 +Host: - 394 +Authorization: Bearer <Token> 395 +Content-Type: application/json 396 + 397 +{ 398 + "emailAddress" : "britt@axelstopp.com" 399 +} 400 +{{/code}} 401 + 402 +Update emailAddress and delete msisdn 403 + 404 +{{code language="http" title="**Request**"}} 405 +PATCH /ledger/customer/v1/XXX/customers/NNN HTTP/1.1 406 +Host: - 407 +Authorization: Bearer <Token> 408 +Content-Type: application/json 409 + 410 +{ 411 + "emailAddress" : "britt@axelstopp.com", 412 + "msisdn" : null 413 +} 414 +{{/code}} 415 + 416 +---- 417 + 418 +(% id="HAccountresourceproperties" %) 419 +==== Customer resource properties ==== 420 + 421 +(% class="table-bordered table-striped" %) 422 +|=(% style="width: 343px;" %)Property|=(% style="width: 137px;" %)Data type|=(% style="width: 230px;" %)Format|=(% style="width: 1076px;" %)Description 423 +|(% style="width:343px" %)@id |(% style="width:137px" %)string|(% style="width:230px" %) |(% style="width:1076px" %)Uri of the specific customer 424 +|(% style="width:343px" %)customerNo|(% style="width:137px" %)string|(% style="width:230px" %)MinLength: 1 425 +MaxLength: 15* 426 +numeric, 1-9 |(% style="width:1076px" %)The unique identifier of the customer 427 +MaxLength may differ depending on configuration 428 +KID (Norway) 429 +|(% style="width:343px" %)__**nationalIdentifier**__|(% style="width:137px" %)object|(% style="width:230px" %) |(% style="width:1076px" %) 430 +|(% style="width:343px" %) nationalIdentifier.regNo|(% style="width:137px" %)string|(% style="width:230px" %)Country specific|(% style="width:1076px" %)Sweden: YYYYMMDD-NNNC 431 +Norway: DDMMYYNNNNN 432 +|(% 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" %) 433 +|(% style="width:343px" %)vatNo|(% style="width:137px" %)string|(% style="width:230px" %)MinLength: 7 434 +MaxLength: 17 435 +Regex pattern: 436 +[A-Z]{2}.*|(% style="width:1076px" %)Customer VAT registration number. Mandatory if reverse tax is used. Must conform to country specific algorithm 437 +|(% style="width:343px" %)legalEntity|(% style="width:137px" %)string|(% style="width:230px" %) |(% style="width:1076px" %)valid values: 438 +"consumer" 439 +"business" 440 +|(% style="width:343px" %)name|(% style="width:137px" %)string|(% style="width:230px" %)Maxlength: 72 441 +Regex?|(% style="width:1076px" %)Full name of end-customer 442 +|(% style="width:343px" %)emailAddress|(% style="width:137px" %)string|(% style="width:230px" %)Maxlength: 254 443 +Regex pattern: [^@]+@[^\.]+\..+|(% style="width:1076px" %) 444 +|(% style="width:343px" %)protectedIdentity|(% style="width:137px" %)bool|(% style="width:230px" %) |(% style="width:1076px" %)Set to true if the customer has protected identity 445 +Postal distribution will be handled by "Skatteverket". **Only supported in Sweden** 446 +|(% style="width:343px" %)msisdn|(% style="width:137px" %)string|(% style="width:230px" %)Maxlength: 15 447 +Minlength: 5 448 ++NNNN|(% style="width:1076px" %) "Mobile Subscriber Integrated Services Digital Network Number", ie. Cellphone number 449 +Countrycode is always required as the example below 450 ++46720000000 451 +|(% style="width:343px" %)distributionType|(% style="width:137px" %)string|(% style="width:230px" %) |(% style="width:1076px" %)Sets distribution type. Allowed values are:((( 452 +* **postal ** 453 +* **noDistribution ** 454 +))) 455 +|(% style="width:343px" %)**activeConsents**|(% style="width:137px" %)object|(% style="width:230px" %) |(% style="width:1076px" %)List of strings with possible values:((( 456 +* ((( 457 +(% 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}]" %) 458 +**Autogiro** 459 +))) 460 +* ((( 461 +(% 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}]" %) 462 +**Avtalegiro** 463 +))) 464 +* ((( 465 +(% 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}]" %) 466 +**Betalingsservice** 467 +))) 468 +* ((( 469 +(% 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}]" %) 470 +**RecurringCard** 471 +))) 472 +* ((( 473 +(% 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}]" %) 474 +**RecurringInvoiceToken** 475 +))) 476 +* ((( 477 +(% 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}]" %) 478 +**EInvoice** 479 +))) 480 +* ((( 481 +(% 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}]" %) 482 +**Kivra** 483 +))) 484 +* ((( 485 +(% 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}]" %) 486 +**EBoks** 487 +))) 488 +))) 489 +|(% style="width:343px" %)__**eDIAddressInfo**__|(% style="width:137px" %)object|(% style="width:230px" %) |(% style="width:1076px" %)EDI addressing info 490 +|(% style="width:343px" %) eDIAddressInfo.van|(% style="width:137px" %)string|(% style="width:230px" %)Maxlength: 255|(% style="width:1076px" %)((( 491 +Buyer VAN identifier (OperatorId) 492 +))) 493 +|(% style="width:343px" %) eDIAddressInfo.interChangeRecipient|(% style="width:137px" %)string|(% style="width:230px" %)Maxlength: 13|(% style="width:1076px" %)Routing address. EAN 494 +|(% style="width:343px" %) eDIAddressInfo.BuyerId|(% style="width:137px" %)string|(% style="width:230px" %)Maxlength: 13|(% style="width:1076px" %)NAD_BY/Buyerparty. EAN/Corporate identity number 495 +|(% style="width:343px" %)legalAddress|(% style="width:137px" %)uri|(% style="width:230px" %) |(% style="width:1076px" %)reference to the customers legal address 496 +|(% style="width:343px" %)billingAddress|(% style="width:137px" %)uri|(% style="width:230px" %) |(% style="width:1076px" %)reference to the customer billing address 497 + 498 +==== Operations ==== 499 + 500 +Depending on the current permissions the following operations is supported on the customer resource 501 + 502 +===== add-billing-address ===== 503 + 504 +Method: POST 505 +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 506 + 507 +---- 508 + 509 +== Legal-address == 510 + 511 +The legal address is where claims is normally sent to. It is required for a customer to have a legal address registered 512 + 513 +==== Get the legal address of the customer ==== 514 + 515 +{{code language="http" title="**Request**"}} 516 +GET /ledger/customer/v1/XXX/customers/NNN/legal-address HTTP/1.1 517 +Host: - 518 +Authorization: Bearer <Token> 519 +Content-Type: application/json 520 +{{/code}} 521 + 522 + 523 +{{code language="http" title="**Response**"}} 524 +HTTP/1.1 200 OK 525 +Content-Type: application/json 526 + 527 +{ 528 + "addressee" : "Britt-Marie Axelstopp", 529 + "streetAddress" : "The street 18", 530 + "coAddress" : "c/o Jansson", 531 + "city" : "STOCKHOLM", 532 + "zipCode" : "15961", 533 + "countryCode" : "SE", 534 + "operations" : 535 + [ 536 + { 537 + "rel" : "update", 538 + "href" : "/ledger/customer/v1/XXX/customers/9999/legal-address", 539 + "method" : "PUT" 540 + }, 541 + { 542 + "rel" : "update-legal-address-from-population-register", 543 + "href" : "/ledger/customer/v1/XXX/customers/9999/legal-address/update-legal-address-from-population-register", 544 + "method" : "POST" 545 + } 546 + ] 547 +} 548 +{{/code}} 549 + 550 +==== Operations ==== 551 + 552 +Depending on the current permissions the following operations is supported on the legal address resource 553 + 554 +===== Update (replace) ===== 555 + 556 +Method: PUT 557 +Use this operation to update the address, this "PUT" operation will replace the existing billing-address with the address specified in the request body. 558 + 559 +(% class="table-bordered table-striped" %) 560 +|=(% style="width: 183px;" %)Property|=(% style="width: 1602px;" %)Required 561 +|(% style="width:183px" %)addressee|(% style="width:1602px" %)Yes 562 +|(% style="width:183px" %)streetAddress|(% style="width:1602px" %)No 563 +|(% style="width:183px" %)coAddress|(% style="width:1602px" %)No 564 +|(% style="width:183px" %)city|(% style="width:1602px" %)Yes 565 +|(% style="width:183px" %)zipCode|(% style="width:1602px" %)Yes 566 +|(% style="width:183px" %)countryCode|(% style="width:1602px" %)Yes 567 + 568 +Example 569 + 570 +{{code language="http" title="**Request**"}} 571 +PUT /ledger/customer/v1/XXX/customers/NNN/legal-address HTTP/1.1 572 +Host: - 573 +Authorization: Bearer <Token> 574 +Content-Type: application/json 575 + 576 +{ 577 + "addressee" : "Kalle Axelstopp", 578 + "streetAddress" : "Axelgatan 18", 579 + "city" : "STOCKHOLM", 580 + "zipCode" : "16872", 581 + "countryCode" : "SE" 582 +} 583 +{{/code}} 584 + 585 + 586 +---- 587 + 588 +===== update-legal-address-from-population-register ===== 589 + 590 +Method: POST 591 +Execution of this operation will result in an attempt to retrieve (and replace) the customer's legal address from the population registry. 592 + 593 +(% class="box infomessage" %) 594 +((( 595 +Access to this operation is not normally granted, unless otherwise agreed. 596 +))) 597 + 598 +{{code language="http" title="**Request**"}} 599 +POST /ledger/customer/v1/XXX/customers/NNN/legal-address/update-legal-address-from-population-register HTTP/1.1 600 +Host: - 601 +Authorization: Bearer <Token> 602 +Content-Type: application/json 603 + 604 +{ 605 +} 606 +{{/code}} 607 + 608 +---- 609 + 610 +==== Legal-address resource properties ==== 611 + 612 +(% class="table-bordered table-striped" %) 613 +|=(% style="width: 161px;" %)Property|=(% style="width: 121px;" %)Data type|=(% style="width: 195px;" %)Format|=(% style="width: 1309px;" %)Description 614 +|(% style="width:161px" %)addressee|(% style="width:121px" %)string|(% style="width:195px" %)Maxlength: 72|(% style="width:1309px" %)Fullname 615 +|(% style="width:161px" %)streetAddress|(% style="width:121px" %)string|(% style="width:195px" %)Maxlength: 72|(% style="width:1309px" %) 616 +|(% style="width:161px" %)coAddress|(% style="width:121px" %)string|(% style="width:195px" %)Maxlength: 72|(% style="width:1309px" %)Care of (C/O) name. This is optional. 617 +|(% style="width:161px" %)city|(% style="width:121px" %)string|(% style="width:195px" %)Maxlength: 27|(% style="width:1309px" %) 618 +|(% style="width:161px" %)zipCode|(% style="width:121px" %)string|(% style="width:195px" %)Maxlength: 9|(% style="width:1309px" %)ZipCode without whitespaces 619 +|(% 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" %) 620 + 621 +---- 622 + 623 +== Billing-address == 624 + 625 +The billing address is where invoices/bills/letters etc. is normally sent to.This address is optional 626 + 627 +==== Get the billing address of the customer ==== 628 + 629 +{{code language="http" title="**Request**"}} 630 +GET /ledger/customer/v1/XXX/customers/NNN/billing-address HTTP/1.1 631 +Host: - 632 +Authorization: Bearer <Token> 633 +Content-Type: application/json 634 +{{/code}} 635 + 636 + 637 +{{code language="http" title="**Response**"}} 638 +HTTP/1.1 200 OK 639 +Content-Type: application/json 640 + 641 +{ 642 + "addressee" : "Kalle Axelstopp", 643 + "streetAddress" : "Axelgatan 18", 644 + "coAddress" : "c/o Jansson", 645 + "city" : "STOCKHOLM", 646 + "zipCode" : "16872", 647 + "countryCode" : "SE", 648 + "operations" : 649 + [ 650 + { 651 + "rel" : "update", 652 + "href" : "/ledger/customer/v1/XXX/customers/9999/billing-address", 653 + "method" : "PUT" 654 + }, 655 + { 656 + "rel" : "delete", 657 + "href" : "/ledger/customer/v1/XXX/customers/9999/billing-address", 658 + "method" : "DELETE" 659 + } 660 + ] 661 +} 662 +{{/code}} 663 + 664 +==== Add a billing-address ==== 665 + 666 +(% class="table-bordered table-striped" %) 667 +|=(% style="width: 183px;" %)Property|=(% style="width: 1602px;" %)Required 668 +|(% style="width:183px" %)addressee|(% style="width:1602px" %)Yes 669 +|(% style="width:183px" %)streetAddress|(% style="width:1602px" %)No 670 +|(% style="width:183px" %)coAddress|(% style="width:1602px" %)No 671 +|(% style="width:183px" %)city|(% style="width:1602px" %)Yes 672 +|(% style="width:183px" %)zipCode|(% style="width:1602px" %)Yes 673 +|(% style="width:183px" %)countryCode|(% style="width:1602px" %)Yes 674 + 675 +{{code language="http" title="**Request**"}} 676 +POST /ledger/customer/v1/XXX/customers/NNN/billing-address HTTP/1.1 677 +Host: - 678 +Authorization: Bearer <Token> 679 +Content-Type: application/json 680 + 681 +{ 682 + "addressee" : "Kalle Axelstopp", 683 + "streetAddress" : "Axelgatan 18", 684 + "city" : "STOCKHOLM", 685 + "zipCode" : "16872", 686 + "countryCode" : "SE" 687 +} 688 +{{/code}} 689 + 690 +==== Operations ==== 691 + 692 +Depending on the current permissions the following operations is supported on the billing address resource 693 + 694 +===== Update (replace) ===== 695 + 696 +Method: PUT 697 +Use this operation to update the address, the "PUT" body of the request should be accoring to the properties of the resource. 698 + 699 +(% class="table-bordered table-striped" %) 700 +|=(% style="width: 183px;" %)Property|=(% style="width: 1602px;" %)Required 701 +|(% style="width:183px" %)addressee|(% style="width:1602px" %)Yes 702 +|(% style="width:183px" %)streetAddress|(% style="width:1602px" %)No 703 +|(% style="width:183px" %)coAddress|(% style="width:1602px" %)No 704 +|(% style="width:183px" %)city|(% style="width:1602px" %)Yes 705 +|(% style="width:183px" %)zipCode|(% style="width:1602px" %)Yes 706 +|(% style="width:183px" %)countryCode|(% style="width:1602px" %)Yes 707 + 708 +{{code language="http" title="**Request**"}} 709 +PUT /ledger/customer/v1/XXX/customers/NNN/billing-address HTTP/1.1 710 +Host: - 711 +Authorization: Bearer <Token> 712 +Content-Type: application/json 713 + 714 +{ 715 + "addressee" : "Kalle Axelstopp", 716 + "streetAddress" : "Axelgatan 18", 717 + "city" : "STOCKHOLM", 718 + "zipCode" : "16872", 719 + "countryCode" : "SE" 720 +} 721 +{{/code}} 722 + 723 +===== Delete ===== 724 + 725 +Method: DELETE 726 +Use this operation to delete the billing address. 727 + 728 +{{code language="http" title="**Request**"}} 729 +DELETE /ledger/customer/v1/XXX/customers/NNN/billing-address HTTP/1.1 730 +Host: - 731 +Authorization: Bearer <Token> 732 +Content-Type: application/json 733 + 734 +{ 735 +} 736 +{{/code}} 737 + 738 +==== Billing-address resource properties ==== 739 + 740 +(% class="table-bordered table-striped" %) 741 +|=Property|=(% style="width: 94px;" %)Data type|=(% style="width: 255px;" %)Format|=(% style="width: 1053px;" %)Description 742 +|addressee|(% style="width:94px" %)string|(% style="width:255px" %)Maxlength: 72|(% style="width:1053px" %)Fullname 743 +|streetAddress|(% style="width:94px" %)string|(% style="width:255px" %)Maxlength: 72|(% style="width:1053px" %) 744 +|coAddress|(% style="width:94px" %)string|(% style="width:255px" %)Maxlength: 72|(% style="width:1053px" %)Care of (C/O) name. This is optional. 745 +|city|(% style="width:94px" %)string|(% style="width:255px" %)Maxlength: 27|(% style="width:1053px" %) 746 +|zipCode|(% style="width:94px" %)string|(% style="width:255px" %)Maxlength: 9|(% style="width:1053px" %)ZipCode without whitespaces 747 +|countryCode|(% style="width:94px" %)string|(% style="width:255px" %)[[ISO 3166-1 alpha-2>>url:https://sv.wikipedia.org/wiki/ISO_3166]]|(% style="width:1053px" %) 748 + 749 +== Find customer == 750 + 751 +The **find customer **resource is located under **ledger/customer/v1/ **api**. **It is used to find customer with nationalIdentifier. 752 + 753 +(% class="table-bordered table-striped" %) 754 +|=(% style="width: 222px;" %)Property|=(% style="width: 1562px;" %)Required 755 +|(% style="width:222px" %)nationalIdentifier.regNo|(% style="width:1562px" %)Yes 756 +|(% style="width:222px" %)nationalIdentifier.countryCode|(% style="width:1562px" %)Yes 757 + 758 +{{code language="http" title="**Request**"}} 759 +POST /ledger/customer/v1/XXX/find-customer HTTP/1.1 760 +Host: - 761 +Authorization: Bearer <Token> 762 +Content-Type: application/json 763 + 764 +{ 765 + "nationalIdentifier": { 766 + "regNo" : "YYYYMMDD-NNNN", 767 + "countryCode" : "SE" 768 + } 769 +} 770 +{{/code}} 771 + 772 +{{code language="http" title="**Response**"}} 773 +HTTP/1.1 200 OK 774 +Content-Type: application/json 775 + 776 +{ 777 + "@id" : "/ledger/customer/v1/XXX/customers/9999", 778 + "customerNo" : " 9999" 779 +} 780 +{{/code}} 781 + 782 +(% id="HAccountresourceproperties" %) 783 +==== Find customer resource properties ==== 784 + 785 +(% class="table-bordered table-striped" %) 786 +|=(% style="width: 248px;" %)Property|=(% style="width: 108px;" %)Data type|=(% style="width: 233px;" %)Format|=(% style="width: 1196px;" %)Description 787 +|(% style="width:248px" %)@id |(% style="width:108px" %)string|(% style="width:233px" %)Maxlength: |(% style="width:1196px" %)Uri of the specific customer 788 +|(% style="width:248px" %)customerNo|(% style="width:108px" %)string|(% style="width:233px" %)Maxlength: 15|(% style="width:1196px" %) 789 +|(% style="width:248px" %)nationalIdentifier.regNo|(% style="width:108px" %)string|(% style="width:233px" %)Country specific|(% style="width:1196px" %)Sweden: YYYYMMDD-NNNC 790 +Norway: DDMMYYNNNNN 791 +|(% 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" %) 792 + 793 +---- 794 + 795 +== Generate customer == 796 + 797 +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. 798 + 799 +(% class="box infomessage" %) 800 +((( 801 +Access to this operation is not normally granted, unless otherwise agreed. 802 +))) 803 + 804 +(% class="table-bordered table-striped" %) 805 +|=(% style="width: 222px;" %)Property|=(% style="width: 1562px;" %)Required 806 +|(% style="width:222px" %)customerNo|(% style="width:1562px" %)No 807 +|(% style="width:222px" %)nationalIdentifier.regNo|(% style="width:1562px" %)Yes 808 +|(% style="width:222px" %)nationalIdentifier.countryCode|(% style="width:1562px" %)Yes 809 +|(% style="width:222px" %)emailAddress|(% style="width:1562px" %)No 810 +|(% style="width:222px" %)msisdn|(% style="width:1562px" %)No 811 + 812 +{{code language="http" title="**Request**"}} 813 +POST /ledger/customer/v1/XXX/generate-consumer-customer-by-reg-no HTTP/1.1 814 +Host: - 815 +Authorization: Bearer <Token> 816 +Content-Type: application/json 817 + 818 +{ 819 + "nationalIdentifier": { 820 + "regNo" : "YYYYMMDD-NNNN", 821 + "countryCode" : "SE" 822 + }, 823 + "emailAddress" : "britt@axelstopp.com", 824 + "msisdn" : "+91485918841", 825 + "customerNo" : "9999" 826 +} 827 +{{/code}} 828 + 829 +{{code language="http" title="**Response**"}} 830 +HTTP/1.1 201 CREATED 831 +Content-Type: application/json 832 + 833 +{ 834 + "@id" : "/ledger/customer/v1/XXX/customers/9999", 835 + "customerNo" : " 9999" 836 +} 837 +{{/code}} 838 + 839 +(% id="HAccountresourceproperties" %) 840 +==== Generate customer resource properties ==== 841 + 842 +(% class="table-bordered table-striped" %) 843 +|=(% style="width: 248px;" %)Property|=(% style="width: 108px;" %)Data type|=(% style="width: 233px;" %)Format|=(% style="width: 1196px;" %)Description 844 +|(% style="width:248px" %)@id |(% style="width:108px" %)string|(% style="width:233px" %)Maxlength: |(% style="width:1196px" %)Uri of the specific customer 845 +|(% style="width:248px" %)customerNo|(% style="width:108px" %)string|(% style="width:233px" %)Maxlength: 15|(% style="width:1196px" %) 846 +|(% style="width:248px" %)nationalIdentifier.regNo|(% style="width:108px" %)string|(% style="width:233px" %)Country specific|(% style="width:1196px" %)Sweden: YYYYMMDD-NNNC 847 +Norway: DDMMYYNNNNN 848 +|(% 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" %) 849 +|(% style="width:248px" %)emailAddress|(% style="width:108px" %)string|(% style="width:233px" %)Maxlength: 254 850 +Regex pattern: [^@]+@[^\.]+\..+|(% style="width:1196px" %) 851 +|(% 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 852 ++46720000000 853 + 854 +{{display reference="developer:Main.Invoicing.ledger-api-general-docs.api-section-problems.WebHome"/}} 855 + 856 +=== Problem types === 857 + 858 +(% class="box infomessage" %) 859 +((( 860 +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". 861 +))) 862 + 863 +(% class="table-bordered table-striped" %) 864 +|=(% style="width: 537px;" %)Problem type (code)|=(% style="width: 172px;" %)Httpstatus|=(% style="width: 796px;" %)Description 865 +|(% 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 866 +|(% style="width:537px" %)forbidden|(% style="width:172px" %)403|(% style="width:796px" %)occurs if access to method is not allowed. 867 +|(% style="width:537px" %)customer-not-found|(% style="width:172px" %)404|(% style="width:796px" %)specified customer number does not exists 868 +|(% style="width:537px" %)legal-address-does-not-exists|(% style="width:172px" %)404|(% style="width:796px" %)legal address does not exists for the specified customer 869 +|(% style="width:537px" %)billing-address-does-not-exists|(% style="width:172px" %)404|(% style="width:796px" %)billing address does not exists for the specified customer
- 1612164530151-211.png
-
- Author
-
... ... @@ -1,0 +1,1 @@ 1 +xwiki:XWiki.dap - Size
-
... ... @@ -1,0 +1,1 @@ 1 +8.3 KB - Content
- 1661344288319-663.png
-
- Author
-
... ... @@ -1,0 +1,1 @@ 1 +xwiki:XWiki.mly - Size
-
... ... @@ -1,0 +1,1 @@ 1 +111.1 KB - Content
- 1612164561442-820.png
-
- Author
-
... ... @@ -1,0 +1,1 @@ 1 +xwiki:XWiki.dap - Size
-
... ... @@ -1,0 +1,1 @@ 1 +12.9 KB - Content