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