Changes for page ../credit-account
Last modified by David Persson on 2022/08/11 10:52
From empty
To version 118.1
edited by David Persson
on 2020/02/12 17:12
on 2020/02/12 17:12
Change comment: There is no comment for this version
Summary
-
Page properties (6 modified, 0 added, 0 removed)
-
Attachments (0 modified, 5 added, 0 removed)
Details
- Page properties
-
- Title
-
... ... @@ -1,0 +1,1 @@ 1 +../credit-account - Parent
-
... ... @@ -1,0 +1,1 @@ 1 +Main.credit-account.api.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,760 @@ 1 +(% class="jumbotron" %) 2 +((( 3 +(% class="container" %) 4 +((( 5 +Integrate to **PayEx Credit Account API ** 6 +))) 7 +))) 8 + 9 +(% class="box errormessage" %) 10 +((( 11 +Todo: Saknar operation för att hitta konton som tillhör en person/ett personnummer 12 +))) 13 + 14 +(% id="HChangelog" %) 15 += Changelog = 16 + 17 +2020-02-06 18 +Added resource "active-payment-orders" 19 + 20 +2020-01-31 21 +renamed resource "recurring-payment-consent" to "recurring-payment-setting" (not implemented in API yet) 22 + 23 +(% class="lead" %) 24 +This api is used to retrieve information and to change properties related to the customer's credit account. 25 + 26 +[[image:1581025117966-675.png||height="416" width="433"]] 27 + 28 +(% id="HRoutesegments" %) 29 +== Introduction == 30 + 31 +Each resource in the API corresponds to its own route. All routes are structured according to a specific standard, explained below 32 + 33 +The below route is an example of a route towards resource3Id, to operate on this resource you must also include the ids of its parentresources in the route. 34 +//api.payex.com/ledger/**{Subdomain}**/v1/**{LedgerNumber}**/resource1/**{resource1Id}**/resource2/**{resource2Id}**/resource3/**{resource3Id}**// 35 + 36 +(% class="table-bordered table-striped" %) 37 +|=(% style="width: 604px;" %)Route segment|=(% style="width: 2790px;" %)Description 38 +|(% style="width:604px" %)Subdomain|(% style="width:2790px" %)In this part of the API it will be credit-account 39 +|(% style="width:604px" %)LedgerNumber|(% style="width:2790px" %)The ledger identifier/number at PayEx 40 +|(% style="width:604px" %)resource1Id|(% style="width:2790px" %)Identifier of resource1 41 +|(% style="width:604px" %)resource2Id|(% style="width:2790px" %)identifier of resource2, subresource to resource1 42 +|(% style="width:604px" %)resource3Id|(% style="width:2790px" %)identifier of resource3, subresource to resource2 43 + 44 +(% class="wikigeneratedid" %) 45 +Routes that occurs in examples of this documentation will use the following identifiers 46 + 47 +(% class="table-bordered table-striped" %) 48 +|=(% style="width: 488px;" %)Resource|=(% style="width: 2271px;" %)Identifier 49 +|(% style="width:488px" %)LedgerNumber|(% style="width:2271px" %)XXX 50 +|(% style="width:488px" %)Accounts|(% style="width:2271px" %)NNN 51 +|(% style="width:488px" %)Bills|(% style="width:2271px" %)reminder-123 52 +bill-456 53 +|(% style="width:488px" %)Cards|(% style="width:2271px" %)954c8699-b38f-47a2-b568-668b8837dad8 54 +274c8699-b38f-47a2-b568-668b8837dat7 55 + 56 +== Accounts == 57 + 58 +The **accounts** resource is located under **ledger/credit-account/v1/ **api**. **The accounts- and its sub-resources are used to create, read and modify information related to a credit-account. 59 +The accounts resource provides an overview of the end customer's account, it contains information such as current balance, credit limit etc. The resource also contains URIs for additional sub-resources such as bills, cards, recurring payments, etc. 60 + 61 +The following operations is supported 62 + 63 +* Change the account credit limit 64 +* Add extra cards 65 +* Request cancellation of account 66 +* Turn on/off charity donation 67 +* Set behaviour of recurring payments 68 + 69 +==== Get a specific account ==== 70 + 71 +==== ==== 72 + 73 +{{code language="http" title="**Request**"}} 74 +GET /ledger/credit-account/v1/XXX/accounts/NNN HTTP/1.1 75 +Host: - 76 +Authorization: Bearer <Token> 77 +Content-Type: application/json 78 +{{/code}} 79 + 80 + 81 +{{code language="http" title="**Response**"}} 82 +HTTP/1.1 200 OK 83 +Content-Type: application/json 84 + 85 +{ 86 + "@id": "/ledger/credit-account/v1/XXX/accounts/NNN", 87 + "accountNo": "1234567", 88 + "startDate": "2018-05-21", 89 + "description": null, 90 + "accountProfileType": "accountType1 | accountType2 | accountType3 etc.", 91 + "accountAlias" : "accountAlias1 | accountAlias2 etc.", 92 + "customerNo" : "123789654", 93 + "status" : "open | pending-close | closed", 94 + "creditLimit": 2000.00, 95 + "totalBalance" : -1900.0, 96 + "reservedAmount": 50.0, 97 + "availableAmount": 50.0, 98 + "openBill" : "/ledger/credit-account/v1/XXX/accounts/NNN/bills/reminder-456", 99 + "charityDonation": true, 100 + "interestRate": { 101 + "debtInterest" : 10.00, 102 + "penaltyInterest": 15.00 103 + }, 104 + "bankPayment": { 105 + "bankAccountNo": "123", 106 + "bankAccountType": "BGSE", 107 + "bic": "123456", 108 + "iban": "SE12345678945631", 109 + "paymentReference": "54867165675646" 110 + }, 111 + "activePaymentOrders": "/ledger/credit-account/v1/XXX/accounts/NNN/active-payment-orders", 112 + "recurringPaymentSetting": "/ledger/credit-account/v1/XXX/accounts/NNN/recurring-payment-setting", 113 + "cards": "/ledger/credit-account/v1/XXX/accounts/123456/cards", 114 + "transactions": "/ledger/credit-account/v1/XXX/accounts/NNN/transactions", 115 + "currency": "sek", 116 + "bills": "/ledger/credit-account/v1/XXX/accounts/NNN/bills", 117 + "customer": "/ledger/customers/v1/XXX/customer/123456", 118 + "operation" : [ 119 + { 120 + "rel" : "add-card-info", 121 + "method" : "post", 122 + "href" : "/ledger/credit-account/v1/XXX/accounts/NNN/cards" 123 + }, 124 + { 125 + "rel" : "request-close-account", 126 + "method" : "post", 127 + "href" : "/ledger/credit-account/v1/XXX/accounts/NNN/request-close-account" 128 + }, 129 + { 130 + "rel" : "apply-for-raised-credit-limit", 131 + "method" : "post", 132 + "href" : "/ledger/credit-account-onboardings/v1/XXX/accounts/NNN/apply-for-raised-credit-limit" 133 + }, 134 + { 135 + "rel" : "partial-update", 136 + "method" : "patch", 137 + "href" : "/ledger/credit-account-onboardings/v1/XXX/accounts/NNN" 138 + } 139 + ] 140 +} 141 +{{/code}} 142 + 143 +==== Account resource properties ==== 144 + 145 +(% class="table-bordered table-striped" %) 146 +|=(% style="width: 215px;" %)Property|=(% style="width: 114px;" %)Data type|=(% style="width: 161px;" %)Format|=(% style="width: 61px;" %)Modify (patch)|=(% style="width: 877px;" %)Description 147 +|(% style="width:215px" %)@id |(% style="width:114px" %)string|(% style="width:161px" %)Maxlength: |(% style="width:61px" %) |(% style="width:877px" %)Uri of the specific account 148 +|(% style="width:215px" %)accountNo |(% style="width:114px" %)string|(% style="width:161px" %)Maxlength: 50|(% style="width:61px" %) |(% style="width:877px" %)The identifier of the account 149 +|(% style="width:215px" %)startDate |(% style="width:114px" %)date|(% style="width:161px" %)[[ISO 8601>>url:http://en.wikipedia.org/wiki/ISO_8601||rel="noreferrer" title="ISO8601 on Wikipedia"]]|(% style="width:61px" %) |(% style="width:877px" %)Date when the account was started 150 +|(% style="width:215px" %)description |(% style="width:114px" %)string|(% style="width:161px" %)Maxlength: 200|(% style="width:61px" %) |(% style="width:877px" %)A description of the type of account 151 +|(% style="width:215px" %)accountProfileType |(% style="width:114px" %)string|(% style="width:161px" %)Maxlength: 50|(% style="width:61px" %) |(% style="width:877px" %)The defined code of the accounttype, //Examples: kontodebet, kontokredit, kontofaktura// 152 +|(% style="width:215px" %)accountAlias |(% style="width:114px" %)string|(% style="width:161px" %)Maxlength: 50|(% style="width:61px" %) |(% style="width:877px" %)A descriptive name for the account type, //Examples: kontokredit1, matkonto1// 153 +|(% style="width:215px" %)customerNo |(% style="width:114px" %)string|(% style="width:161px" %)Maxlength: 50|(% style="width:61px" %) |(% style="width:877px" %)Identifier of the customer (account owner) 154 +|(% style="width:215px" %)status |(% style="width:114px" %)string|(% style="width:161px" %)Maxlength: 25|(% style="width:61px" %) |(% style="width:877px" %)Status of the account((( 155 +* **pending-close**: the customer has requested the account to be closed, the account will be closed when possible. 156 +* **open**: the account is open and active 157 +* **closed**: the account has been closed 158 +))) 159 +|(% style="width:215px" %)creditLimit |(% style="width:114px" %)decimal|(% style="width:161px" %) |(% style="background-color:palegreen; width:61px" %) |(% style="width:877px" %)The creditlimit of the account, support patch operation but only lower 160 +|(% style="width:215px" %)totalBalance|(% style="width:114px" %)decimal|(% style="width:161px" %) |(% style="width:61px" %) |(% style="width:877px" %)Total current sum of all balances (including capital / interest / fees, etc.) 161 +|(% style="width:215px" %)reservedAmount |(% style="width:114px" %)decimal|(% style="width:161px" %) |(% style="width:61px" %) |(% style="width:877px" %)Sum of all outstanding reservations (which are valid and not captured) 162 +|(% style="width:215px" %)availableAmount |(% style="width:114px" %)decimal|(% style="width:161px" %) |(% style="width:61px" %) |(% style="width:877px" %)Available credit (cannot be calculated from the above amounts as fees can be included there, which does not affect available credit) 163 +|(% style="width:215px" %)openBill|(% style="width:114px" %)string|(% style="width:161px" %)Uri|(% style="width:61px" %) |(% style="width:877px" %) 164 +|(% style="width:215px" %)charityDonation |(% style="width:114px" %)bool|(% style="width:161px" %) |(% style="background-color:palegreen; width:61px" %) |(% style="width:877px" %)If donations should be made from the account 165 +|(% style="width:215px" %)interestRate.debtInterest|(% style="width:114px" %)decimal|(% style="width:161px" %)Percentage|(% style="width:61px" %) |(% style="width:877px" %)yearly debt interestrate 166 +|(% style="width:215px" %)interestRate.penaltyInterest|(% style="width:114px" %)decimal|(% style="width:161px" %)Percentage|(% style="width:61px" %) |(% style="width:877px" %)yearly penalty interestrate 167 +|(% style="width:215px" %)recurringPaymentConsent|(% style="width:114px" %)string|(% style="width:161px" %)Uri|(% style="width:61px" %) |(% style="width:877px" %) 168 +|(% style="width:215px" %)cards |(% style="width:114px" %)string|(% style="width:161px" %)Uri|(% style="width:61px" %) |(% style="width:877px" %) 169 +|(% style="width:215px" %)transactions |(% style="width:114px" %)string|(% style="width:161px" %)Uri|(% style="width:61px" %) |(% style="width:877px" %) 170 +|(% style="width:215px" %)currency |(% style="width:114px" %)string|(% style="width:161px" %)[[ISO 4217>>https://sv.wikipedia.org/wiki/ISO_4217]]|(% style="width:61px" %) |(% style="width:877px" %) 171 +|(% style="width:215px" %)bills |(% style="width:114px" %)string|(% style="width:161px" %)Uri|(% style="width:61px" %) |(% style="width:877px" %) 172 +|(% style="width:215px" %)customer |(% style="width:114px" %)string|(% style="width:161px" %)Uri|(% style="width:61px" %) |(% style="width:877px" %) 173 +|(% style="width:337px" %)activePaymentOrder.paymentMethod|(% style="width:205px" %)string|(% style="width:208px" %)Maxlength: 15|(% style="width:61px" %)((( 174 + 175 +)))|(% style="width:877px" %)((( 176 +PaymentTypes: 177 + 178 +* AUTOGIRO 179 +))) 180 +|(% style="width:337px" %)activePaymentOrder.executionDate|(% style="width:205px" %)date|(% style="width:208px" %)[[ISO 8601>>url:http://en.wikipedia.org/wiki/ISO_8601||rel="noreferrer" title="ISO8601 on Wikipedia"]]|(% style="width:61px" %) |(% style="width:877px" %)Date when the paymentorder will be executed (when end-customer will be debited) 181 +|(% style="width:337px" %)activePaymentOrder.amount|(% style="width:205px" %)decimal|(% style="width:208px" %) |(% style="width:61px" %) |(% style="width:877px" %)Amount that will be charged, this amount may be adjusted when the payment order is executed, if the "amount to pay" on the bill has decreased 182 +|(% style="width:215px" %) |(% style="width:114px" %) |(% style="width:161px" %) |(% style="width:61px" %) |(% style="width:877px" %) 183 + 184 +== Bills == 185 + 186 +The bills resources contains all the documents produced in the accounts billing cycle. 187 + 188 + 189 +==== List all bills of an account ==== 190 + 191 + 192 +{{code language="http" title="**Request**"}} 193 +GET /ledger/credit-account/v1/XXX/accounts/NNN/bills HTTP/1.1 194 +Host: - 195 +Authorization: Bearer <Token> 196 +Content-Type: application/json 197 + 198 +{{/code}} 199 + 200 + 201 +{{code language="http" title="**Response**"}} 202 +HTTP/1.1 200 OK 203 +Content-Type: application/json 204 + 205 +{ 206 + "@id": "/ledger/credit-account/v1/501/accounts/NNN/bills?status=open", 207 + "items" : [ 208 + { 209 + "@id": "/ledger/credit-account/v1/XXX/accounts/NNN/bills/reminder-123645", 210 + "dueDate": "2018-12-05", 211 + "billDate": "2018-11-15", 212 + "billNo": "124645", 213 + "billAmount": 240.00, 214 + "billType" : "reminder", 215 + "status": "open", 216 + "activePaymentDetails": { 217 + "minimumAmountToBePayed": 240.00, 218 + "bankAccountNo": "123", 219 + "bankAccountType": "BGSE", 220 + "bic": "123456", 221 + "iban": "SE12345678945631", 222 + "paymentReference": "5465164654663", 223 + "paymentOrdersExists": true, 224 + }, 225 + "document": "/ledger/credit-account/v1/XXX/accounts/NNN/bills/reminder-124645/document" 226 + }, 227 + { 228 + "@id": "/ledger/credit-account/v1/XXX/accounts/NNN/bills/reminder-123645", 229 + "dueDate": "2018-12-05", 230 + "billDate": "2018-11-15", 231 + "billNo": "124645", 232 + "billAmount": 240.00, 233 + "billType" : "bill", 234 + "status": "closed", 235 + "activePaymentDetails": null, 236 + "document": "/ledger/credit-account/v1/XXX/accounts/NNN/bills/reminder-124645/document" 237 + }, 238 + { 239 + "@id": "/ledger/credit-account/v1/XXX/accounts/NNN/bills/bill-123645", 240 + "dueDate": "2018-12-05", 241 + "billDate": "2018-11-15", 242 + "billNo": "124645", 243 + "billAmount": 240.00, 244 + "billType" : "bill", 245 + "status": "closed", 246 + "activePaymentDetails": null, 247 + "document": "/ledger/credit-account/v1/XXX/accounts/NNN/bills/reminder-124645/document" 248 + } 249 + ] 250 +} 251 +{{/code}} 252 + 253 +==== ==== 254 + 255 +==== Get specific bill ==== 256 + 257 + 258 +{{code language="http" title="**Request**"}} 259 +GET /ledger/credit-account/v1/XXX/accounts/NNN/bills/456 HTTP/1.1 260 +Host: - 261 +Authorization: Bearer <Token> 262 +Content-Type: application/json 263 + 264 +{{/code}} 265 + 266 + 267 +{{code language="http" title="**Response**"}} 268 +HTTP/1.1 200 OK 269 +Content-Type: application/json 270 + 271 +{ 272 + "@id": "/ledger/credit-account/v1/XXX/accounts/NNN/bills/reminder-123645", 273 + "dueDate": "2018-12-05", 274 + "billDate": "2018-11-15", 275 + "billNo": "124645", 276 + "billAmount": 240.00, 277 + "billType" : "reminder", 278 + "status": "open", 279 + "activePaymentDetails": { 280 + "minimumAmountToBePayed": 240.00, 281 + "bankAccountNo": "123", 282 + "bankAccountType": "BGSE", 283 + "bic": "123456", 284 + "iban": "SE12345678945631", 285 + "paymentReference": "5465164654663", 286 + "paymentOrdersExists": true, 287 + }, 288 + "document": "/ledger/credit-account/v1/XXX/accounts/NNN/bills/reminder-124645/document" 289 +} 290 +{{/code}} 291 + 292 +==== Bill resource properties ==== 293 + 294 +(% class="table-bordered table-striped" %) 295 +|=(% style="width: 337px;" %)Property|=(% style="width: 205px;" %)Data type|=(% style="width: 208px;" %)Format|=(% style="width: 621px;" %)Description 296 +|(% style="width:337px" %)@id|(% style="width:205px" %)string|(% style="width:208px" %)Uri|(% style="width:621px" %) 297 +|(% style="width:337px" %)dueDate|(% style="width:205px" %)date|(% style="width:208px" %)[[ISO 8601>>url:http://en.wikipedia.org/wiki/ISO_8601||rel="noreferrer" title="ISO8601 on Wikipedia"]]|(% style="width:621px" %) 298 +|(% style="width:337px" %)billDate|(% style="width:205px" %)date|(% style="width:208px" %) |(% style="width:621px" %)Date when bill was created 299 +|(% style="width:337px" %)billNo|(% style="width:205px" %)string|(% style="width:208px" %)Maxlength: 50|(% style="width:621px" %)The identifier of the bill 300 +|(% style="width:337px" %)billAmount|(% style="width:205px" %)decimal|(% style="width:208px" %) |(% style="width:621px" %)the amount that is stated on the actual bill/document 301 +|(% style="width:337px" %)billType|(% style="width:205px" %)string|(% style="width:208px" %)Maxlength: 25|(% style="width:621px" %)((( 302 +BillTypes: 303 + 304 +* Bill 305 +* Reminder1 306 +* Reminder2 307 +* Collection 308 +))) 309 +|(% style="width:337px" %)status|(% style="width:205px" %)string|(% style="width:208px" %) |(% style="width:621px" %)"open" / "closed" 310 +|(% style="width:337px" %)activePaymentDetails|(% style="width:205px" %)object|(% style="width:208px" %) |(% style="width:621px" %)only set if status of bill is "open" 311 +|(% style="width:337px" %)activePaymentDetails.minimumAmountToBePayed|(% style="width:205px" %)decimal|(% style="width:208px" %) |(% style="width:621px" %)The least amount to pay on the bill 312 +|(% style="width:337px" %)activePaymentDetails.bankAccountNo|(% style="width:205px" %)string|(% style="width:208px" %)Maxlength: 15|(% style="width:621px" %)bankaccount for payment 313 +|(% style="width:337px" %)activePaymentDetails.bankAccountType|(% style="width:205px" %)string|(% style="width:208px" %)Maxlength: 10|(% style="width:621px" %)BankAccountTypes:((( 314 +* BKSE (swedish bankaccount) 315 +* PKSE (swedish plusgiro) 316 +* BGSE (swedish bankgiro) 317 +* PGSE (swedish plusgiro OCR) 318 +))) 319 +|(% style="width:337px" %)activePaymentDetails.bic|(% style="width:205px" %)string|(% style="width:208px" %)Maxlength: 11|(% style="width:621px" %)Bank Identifier Code (BIC) 320 +|(% style="width:337px" %)activePaymentDetails.iban|(% style="width:205px" %)string|(% style="width:208px" %)Maxlength: 34|(% style="width:621px" %)International Bank Account Number (IBAN) 321 +|(% style="width:337px" %)activePaymentDetails.paymentReference|(% style="width:205px" %)string|(% style="width:208px" %)Maxlength: 50|(% style="width:621px" %)reference to specify on the payment 322 +|(% style="width:337px" %)activePaymentDetails.paymentOrdersExists|(% style="width:205px" %)bool|(% style="width:208px" %) |(% style="width:621px" %)if there is an active payment order to be executed related to this bill for "recurring payments". 323 +//More detailed information about the payment order can be found on the accounts resource// 324 +|(% style="width:337px" %)document|(% style="width:205px" %)string|(% style="width:208px" %)Url|(% style="width:621px" %)Url to download pdf document 325 + 326 +== Cards == 327 + 328 +==== Add card to account ==== 329 + 330 +Execute http post towards this resource to add a new card to the specified account 331 + 332 +{{code language="http" title="**Request**"}} 333 +POST /ledger/credit-account/v1/XXX/accounts/NNN/cards HTTP/1.1 334 +Host: - 335 +Authorization: Bearer <Token> 336 +Content-Type: application/json 337 + 338 +{ 339 + "token": "954c8699-b38f-47a2-b568-668b8837dad8", 340 + "PanTrunc": "85479*********648", 341 + "deleted" : false, 342 + "mainCard": true, 343 + "cardHolder" : { 344 + "number" : "123465", 345 + "name": "test testsson", 346 + "nationalConsumerIdentifier": { 347 + "value": "19101010-1010", 348 + "countryCode": "SE" 349 + } 350 + } 351 +} 352 +{{/code}} 353 + 354 +==== List cards on an account ==== 355 + 356 +{{code language="http" title="**Request**"}} 357 +GET /ledger/credit-account/v1/XXX/accounts/NNN/cards HTTP/1.1 358 +Host: - 359 +Authorization: Bearer <Token> 360 +Content-Type: application/json 361 + 362 + 363 +{{/code}} 364 + 365 + 366 +{{code language="http" title="**Response**"}} 367 +HTTP/1.1 200 OK 368 +Content-Type: application/json 369 + 370 +{ 371 + "operations": null, 372 + "items": [ 373 + { 374 + "token": "954c8699-b38f-47a2-b568-668b8837dad8", 375 + "PanTrunc": "85479*********648", 376 + "deleted" : false, 377 + "mainCard": true, 378 + "cardHolder" : { 379 + "number" : "123465", 380 + "name": "test testsson", 381 + "nationalConsumerIdentifier": { 382 + "value": "19101010-1010", 383 + "countryCode": "SE" 384 + } 385 + }, 386 + "@id": "/ledger/credit-account/v1/XXX/accounts/NNN/cards/741" 387 + }, 388 + { 389 + "token": "274c8699-b38f-47a2-b568-668b8837dat7", 390 + "PanTrunc": "78979*********321", 391 + "deleted" : false, 392 + "mainCard": false, 393 + "cardHolder" : { 394 + "number" : "987654", 395 + "name": "test testsson", 396 + "nationalConsumerIdentifier": { 397 + "value": "19101010-1010", 398 + "countryCode": "SE" 399 + } 400 + }, 401 + "@id": "/ledger/credit-account/v1/XXX/accounts/NNN/cards/274c8699-b38f-47a2-b568-668b8837dat7" 402 + } 403 + ], 404 + "@id": "/ledger/credit-account/v1/XXX/accounts/NNN/cards", 405 + "view": { 406 + "@id": "/ledger/credit-account/v1/XXX/accounts/NNN/cards?$top=2&$skip=0", 407 + "next": "/ledger/credit-account/v1/XXX/accounts/NNN/cards?$top=2&$skip=2" 408 + } 409 +} 410 +{{/code}} 411 + 412 +==== Get a specific card ==== 413 + 414 + 415 +{{code language="http" title="**Request**"}} 416 +GET /ledger/credit-account/v1/XXX/accounts/NNN/cards/954c8699-b38f-47a2-b568-668b8837dad8 HTTP/1.1 417 +Host: - 418 +Authorization: Bearer <Token> 419 +Content-Type: application/json 420 + 421 + 422 +{{/code}} 423 + 424 +{{code language="http" title="**Response**"}} 425 +HTTP/1.1 200 OK 426 +Content-Type: application/json 427 + 428 +{ 429 + "token": "954c8699-b38f-47a2-b568-668b8837dad8", 430 + "PanTrunc": "85479*********648", 431 + "deleted" : false, 432 + "mainCard": true, 433 + "cardHolder" : { 434 + "number" : "123465", 435 + "name": "test testsson", 436 + "nationalConsumerIdentifier": { 437 + "value": "19101010-1010", 438 + "countryCode": "SE" 439 + } 440 + }, 441 + "@id": "/ledger/credit-account/v1/XXX/accounts/NNN/cards/954c8699-b38f-47a2-b568-668b8837dad8", 442 + "parentHREF": "/ledger/credit-account/v1/XXX/accounts/NNN", 443 + "operation" : [ 444 + { 445 + "rel" : "partial-update", 446 + "method" : "patch", 447 + "href" : "/ledger/credit-account/v1/XXX/accounts/NNN/cards/954c8699-b38f-47a2-b568-668b8837dad8" 448 + } 449 + ] 450 +} 451 +{{/code}} 452 + 453 +==== Card resource properties ==== 454 + 455 +(% class="table-bordered table-striped" %) 456 +|=(% style="width: 337px;" %)Property|=(% style="width: 205px;" %)Data type|=(% style="width: 208px;" %)Format|=(% style="width: 62px;" %)Modify (patch)|=(% style="width: 1401px;" %)Description 457 +|(% style="width:337px" %)token|(% style="width:205px" %)string|(% style="width:208px" %) |(% style="width:62px" %) |(% style="width:1401px" %)token identifier of the card 458 +|(% style="width:337px" %)panTrunc|(% style="width:205px" %)string|(% style="width:208px" %) |(% style="width:62px" %) |(% style="width:1401px" %)truncated PAN 459 +|(% style="width:337px" %)deleted|(% style="width:205px" %)bool|(% style="width:208px" %) |(% style="background-color:palegreen; width:62px" %) |(% style="width:1401px" %)indicates wheter the card has been deleted 460 +|(% style="width:337px" %)mainCard|(% style="width:205px" %)bool|(% style="width:208px" %) |(% style="width:62px" %) |(% style="width:1401px" %)indicated whether this card is the main card of the account (cardholder is always owner of account) 461 +|(% style="width:337px" %)cardHolder.number|(% style="width:205px" %)string|(% style="width:208px" %) |(% style="width:62px" %) |(% style="width:1401px" %)Cardholder customernumber 462 +|(% style="width:337px" %)cardHolder.name|(% style="width:205px" %)string|(% style="width:208px" %) |(% style="width:62px" %) |(% style="width:1401px" %)Cardholder fullname 463 +|(% style="width:337px" %)cardHolder.nationalConsumerIdentifier.value|(% style="width:205px" %)string|(% style="width:208px" %)YYYYMMDD-NNNC|(% style="width:62px" %) |(% style="width:1401px" %) 464 +|(% style="width:337px" %)cardHolder.nationalConsumerIdentifier.countryCode|(% style="width:205px" %)string|(% style="width:208px" %)[[ISO 3166-1 alpha-2>>url:https://sv.wikipedia.org/wiki/ISO_3166]]|(% style="width:62px" %) |(% style="width:1401px" %) 465 + 466 +== Transactions == 467 + 468 +==== List transactions on an account ==== 469 + 470 +{{code language="http" title="**Request**"}} 471 +GET /ledger/credit-account/v1/XXX/accounts/NNN/transactions HTTP/1.1 472 +Host: - 473 +Authorization: Bearer <Token> 474 +Content-Type: application/json 475 + 476 + 477 +{{/code}} 478 + 479 + 480 +{{code language="http" title="**Response**"}} 481 +HTTP/1.1 200 OK 482 +Content-Type: application/json 483 + 484 +{ 485 + "operations": null, 486 + "items": [ 487 + { 488 + "type": "payment", 489 + "description": "", 490 + "amount": 200.00, 491 + "billed": false|true, 492 + "date": "2019-10-09", 493 + "reserveDate": null 494 + }, 495 + { 496 + "type": "purchase", 497 + "description": "testbutiken, köpref. 12345689", 498 + "amount": 200.00, 499 + "billed": false|true, 500 + "date": "2019-10-09", 501 + "reserveDate": "2019-10-05", 502 + }, 503 + { 504 + "type": "credit", 505 + "description": "", 506 + "amount": 200.00, 507 + "billed": false|true, 508 + "date": "2019-10-09", 509 + "reserveDate": "2019-10-05" 510 + } 511 + ], 512 + "@id": "/ledger/credit-account/v1/XXX/accounts/NNN/transactions?fromDate=2019-10-01", 513 + "view": { 514 + "@id": "/ledger/credit-account/v1/XXX/accounts/NNN/transactions?fromDate=2019-10-01&$top=2&$skip=0", 515 + "next": "/ledger/credit-account/v1/XXX/accounts/NNN/transactions?fromDate=2019-10-01&$top=2&$skip=2" 516 + } 517 +} 518 +{{/code}} 519 + 520 +==== Transaction resource properties ==== 521 + 522 +(% class="table-bordered table-striped" %) 523 +|=(% style="width: 337px;" %)Property|=(% style="width: 205px;" %)Data type|=(% style="width: 208px;" %)Format|=(% style="width: 621px;" %)Description 524 +|(% style="width:337px" %)type|(% style="width:205px" %)string|(% style="width:208px" %) |(% style="width:621px" %)((( 525 +Type of transaction 526 + 527 +* Payment 528 +* Purchase 529 +* Credit 530 +))) 531 +|(% style="width:337px" %)description|(% style="width:205px" %)string|(% style="width:208px" %) |(% style="width:621px" %)Description of the transaction, for purchases it usually includes "point of sale" and "receipt reference" 532 +|(% style="width:337px" %)amount|(% style="width:205px" %)decimal|(% style="width:208px" %) |(% style="width:621px" %) 533 +|(% style="width:337px" %)billed|(% style="width:205px" %)bool|(% style="width:208px" %) |(% style="width:621px" %)Indicates wheter a bill has been created after the transaction (ie. if the transaction is included in any bill or not) 534 +|(% style="width:337px" %)date|(% style="width:205px" %)date|(% style="width:208px" %) |(% style="width:621px" %)//Valuedate// 535 + 536 +== Reservations == 537 + 538 +==== List reservations in an account ==== 539 + 540 +{{code language="http" title="**Request**"}} 541 +GET /ledger/credit-account/v1/XXX/accounts/NNN/reservations HTTP/1.1 542 +Host: - 543 +Authorization: Bearer <Token> 544 +Content-Type: application/json 545 + 546 + 547 +{{/code}} 548 + 549 + 550 +{{code language="http" title="**Response**"}} 551 +HTTP/1.1 201 Created 552 +Content-Type: application/json 553 + 554 +{ 555 + "operations": null, 556 + "items": [ 557 + { 558 + "amount": 200.00, 559 + "description" : "", 560 + "date": "2019-10-05", 561 + }, 562 + { 563 + "amount": 450.00, 564 + "description" : "", 565 + "date": "2019-10-02", 566 + }, 567 + ], 568 + "@id": "/ledger/credit-account/v1/XXX/accounts/NNN/reservations", 569 +} 570 +{{/code}} 571 + 572 +==== Reservation resource properties ==== 573 + 574 +(% class="table-bordered table-striped" %) 575 +|=(% style="width: 337px;" %)Property|=(% style="width: 205px;" %)Data type|=(% style="width: 208px;" %)Format|=(% style="width: 621px;" %)Description 576 +|(% style="width:337px" %)amount|(% style="width:205px" %)decimal|(% style="width:208px" %) |(% style="width:621px" %) 577 +|(% style="width:337px" %)description|(% style="width:205px" %)string|(% style="width:208px" %) |(% style="width:621px" %)Description of the reservation, normally "point of sale". 578 +|(% style="width:337px" %)date|(% style="width:205px" %)date|(% style="width:208px" %) |(% style="width:621px" %)Date when the reservation occured 579 + 580 +== Recurring-payment-setting == 581 + 582 +(% class="wikigeneratedid" %) 583 +This resource contain information/settings related to how recurring payments should behave on this account. 584 + 585 +==== 586 +Get settings on an account ==== 587 + 588 + 589 +{{code language="http" title="**Request**"}} 590 +GET /ledger/credit-account/v1/XXX/accounts/NNN/recurring-payment-setting/ HTTP/1.1 591 +Host: - 592 +Authorization: Bearer <Token> 593 +Content-Type: application/json 594 +{{/code}} 595 + 596 + 597 +{{code language="http" title="**Response**"}} 598 +HTTP/1.1 200 OK 599 +Content-Type: application/json 600 + 601 +{ 602 + "@id" : "/ledger/credit-account/v1/XXX/accounts/NNN/recurring-payment-setting", 603 + "recurringPaymentMethod" : "autogiro", 604 + "recurringPaymentScope" : "fixedRecurring", 605 + "fixedRecurringAmount" : 1500.00, 606 + "parentHREF": "/ledger/credit-account/v1/XXX/accounts/NNN", 607 + "operation" : [ 608 + { 609 + "rel" : "partially-update-recurring-payment-consent", 610 + "method" : "patch", 611 + "href" : "/ledger/credit-account/v1/XXX/accounts/NNN/recurring-payment-consent" 612 + } 613 + ] 614 +} 615 +{{/code}} 616 + 617 +==== Update settings on an account ==== 618 + 619 +(% class="wikigeneratedid" %) 620 +Execute http patch towards this resource to change how recurring payments should behave on the specified account 621 + 622 +{{code language="http" title="**Request**"}} 623 +PATCH /ledger/credit-account/v1/XXX/accounts/NNN/recurring-payment-setting HTTP/1.1 624 +Host: - 625 +Authorization: Bearer <Token> 626 +Content-Type: application/json 627 + 628 +{ 629 + "recurringPaymentScope" : "billedAmount", 630 + "fixedRecurringAmount" : 0.00 631 +} 632 +{{/code}} 633 + 634 +==== Recurring-payment-setting resource properties ==== 635 + 636 +(% class="table-bordered table-striped" %) 637 +|=(% style="width: 337px;" %)Property|=(% style="width: 205px;" %)Data type|=(% style="width: 208px;" %)Format|=(% style="width: 58px;" %)Modify (patch)|=(% style="width: 1176px;" %)Description 638 +|(% style="width:337px" %)recurringPaymentMethod|(% style="width:205px" %)string|(% style="width:208px" %) |(% style="background-color:palegreen; width:58px" %) |(% style="width:1176px" %)recurringPaymentMethods:((( 639 +* autogiro 640 +))) 641 +|(% style="width:337px" %)recurringPaymentScope|(% style="width:205px" %)string|(% style="width:208px" %) |(% style="background-color:palegreen; width:58px" %) |(% style="width:1176px" %)((( 642 +recurringPaymentScopes: 643 + 644 +* fixedRecurring (Fixed amount to debit monthly) 645 +* totalDebt (Total credit-account debt will be debited) 646 +* billedAmount (Only the minimum amount to pay will be debited) 647 +* NotSet 648 +))) 649 +|(% style="width:337px" %)fixedRecurringAmount|(% style="width:205px" %)decimal|(% style="width:208px" %) |(% style="background-color:palegreen; width:58px" %) |(% style="width:1176px" %)amount to monthly debit end-customers bankaccount (Only valid if recurringPaymentScope is set to "fixedRecurring") 650 + 651 +== Active-payment-orders == 652 + 653 +(% class="wikigeneratedid" %) 654 +This resource corresponds to an active / scheduled payment order placed against the specific account, the end-customer will be debited at the given executeDate. 655 + 656 +==== 657 +Get active payment orders for an account ==== 658 + 659 + 660 +{{code language="http" title="**Request**"}} 661 +GET /ledger/credit-account/v1/XXX/accounts/NNN/active-payment-orders/ HTTP/1.1 662 +Host: - 663 +Authorization: Bearer <Token> 664 +Content-Type: application/json 665 +{{/code}} 666 + 667 + 668 +{{code language="http" title="**Response**"}} 669 +HTTP/1.1 200 OK 670 +Content-Type: application/json 671 + 672 +{ 673 + "operations": null, 674 + "items": [ 675 + { 676 + "paymentMethod": "autogiro", 677 + "executeDate": "2020-02-15", 678 + "amount": 200.00 679 + } 680 + ], 681 + "view": { 682 + "@id": "/ledger/credit-account/v1/XXX/accounts/NNN/active-payment-orders?$top=2&$skip=0", 683 + "next": "/ledger/credit-account/v1/XXX/accounts/NNN/active-payment-orders?$top=2&$skip=2" 684 + } 685 +} 686 +{{/code}} 687 + 688 +==== ==== 689 + 690 +==== Active-payment-orders resource properties ==== 691 + 692 +(% class="table-bordered table-striped" %) 693 +|=(% style="width: 337px;" %)Property|=(% style="width: 205px;" %)Data type|=(% style="width: 208px;" %)Format|=(% style="width: 58px;" %)Modify (patch)|=(% style="width: 1176px;" %)Description 694 +|(% style="width:337px" %)paymentMethod|(% style="width:205px" %)string|(% style="width:208px" %) |(% style="width:58px" %) |(% style="width:1176px" %)paymentMethods:((( 695 +* autogiro 696 +))) 697 +|(% style="width:337px" %)executeDate|(% style="width:205px" %)Date|(% style="width:208px" %) |(% style="width:58px" %) |(% style="width:1176px" %)((( 698 +The date when the payment order will be executed 699 +))) 700 +|(% style="width:337px" %)amount|(% style="width:205px" %)decimal|(% style="width:208px" %) |(% style="width:58px" %) |(% style="width:1176px" %)The amount to debit the owner of the consent 701 + 702 +=== Problems === 703 + 704 +If an error occur or any validation failed, a "problem" response will be returned. 705 +Below is a list of problems that can occur: 706 + 707 +**HttpStatus 401 Unauthorized** 708 + 709 +* Token expired 710 +* Token invalid 711 +* SellerNumber does not match token 712 +* CompanyNumber does not match token 713 + 714 +**HttpStatus 400 Error** 715 + 716 +* Validation: Argument required 717 +* Validation: Invalid value 718 + 719 +**HttpStatus 422 Unprocessable entity** 720 + 721 +* Authorization declined 722 + 723 +**HttpStatus 409 Conflict** 724 + 725 +* Invoice already authorized 726 +* Duplicate InvoiceNumber 727 +* Authorization is cancelled 728 +* Authorization already captured 729 +* Authorization has expired 730 +* Insufficient debited amount XXX 731 + 732 +**HttpStatus 501 NotImplemented** 733 + 734 +* CompanyNumber XXX not configured 735 +* SellerNumber XXX not configured at PayEx 736 +* CompanyNumber XXX missing configuration 737 + 738 +**HttpStatus 404 NotFound** 739 + 740 +* Authorization not found 741 + 742 +Below is an example of a problem that will be returned if buyer##.nationalConsumerIdentifier.value## is not valid in the authorization post request. 743 + 744 +{{code language="http" title="**Response**"}} 745 +HTTP/1.1 400 Error 746 +Content-Type: application/problem+json 747 + 748 +{ 749 + "Type": "http://[DNS]/ledger/invoice-purchase/problems/validation", 750 + "Title": "A validation error occurred", 751 + "Status": 400, 752 + "Instance": null, 753 + "Detail": "A validation error occurred. Please fix the problems mentioned in the 'problems' property below.", 754 + "Problems": [ 755 + { 756 + "buyer.nationalConsumerIdentifier.value": "Not a valid SE nationalConsumerIdentifier" 757 + } 758 + ] 759 +} 760 +{{/code}}
- 1578554263550-159.png
-
- Author
-
... ... @@ -1,0 +1,1 @@ 1 +xwiki:XWiki.dap - Size
-
... ... @@ -1,0 +1,1 @@ 1 +0 bytes - Content
- 1579213180493-564.png
-
- Author
-
... ... @@ -1,0 +1,1 @@ 1 +xwiki:XWiki.dap - Size
-
... ... @@ -1,0 +1,1 @@ 1 +0 bytes - Content
- 1579213237427-955.png
-
- Author
-
... ... @@ -1,0 +1,1 @@ 1 +xwiki:XWiki.dap - Size
-
... ... @@ -1,0 +1,1 @@ 1 +0 bytes - Content
- 1579213343157-343.png
-
- Author
-
... ... @@ -1,0 +1,1 @@ 1 +xwiki:XWiki.dap - Size
-
... ... @@ -1,0 +1,1 @@ 1 +0 bytes - Content
- 1581025117966-675.png
-
- Author
-
... ... @@ -1,0 +1,1 @@ 1 +xwiki:XWiki.dap - Size
-
... ... @@ -1,0 +1,1 @@ 1 +0 bytes - Content