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