Changes for page account
Last modified by David Persson on 2024/02/21 07:42
From empty
To version 28.1
edited by David Persson
on 2022/03/15 17:01
on 2022/03/15 17:01
Change comment: There is no comment for this version
Summary
-
Page properties (6 modified, 0 added, 0 removed)
-
Attachments (0 modified, 1 added, 0 removed)
Details
- Page properties
-
- Title
-
... ... @@ -1,0 +1,1 @@ 1 +../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,929 @@ 1 +(% class="jumbotron" %) 2 +((( 3 +(% class="container" %) 4 +((( 5 +Integrate to **PayEx Account API ** 6 +))) 7 +))) 8 + 9 +=== Changelog === 10 + 11 +2021-10-26? 12 +Moved from the previous Credit Account API 13 + 14 +(% id="HRoutesegments" %) 15 +== Introduction == 16 + 17 +(% class="lead" %) 18 +This api is used to retrieve information and to change properties related to the customer's account. 19 + 20 +[[image:Account.API diagram.jpeg||alt="Account.API.png"]] 21 + 22 + 23 +Each resource in the API corresponds to its own route. All routes are structured according to a specific standard, explained below 24 + 25 +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. 26 +//api.payex.com/ledger/**{Subdomain}**/v1/**{LedgerNumber}**/resource1/**{resource1Id}**/resource2/**{resource2Id}**/resource3/**{resource3Id}**// 27 + 28 +(% class="table-bordered table-striped" %) 29 +|=(% style="width: 604px;" %)Route segment|=(% style="width: 2790px;" %)Description 30 +|(% style="width:604px" %)Subdomain|(% style="width:2790px" %)In this part of the API it will be account 31 +|(% style="width:604px" %)LedgerNumber|(% style="width:2790px" %)The ledger identifier/number at PayEx 32 +|(% style="width:604px" %)resource1Id|(% style="width:2790px" %)Identifier of resource1 33 +|(% style="width:604px" %)resource2Id|(% style="width:2790px" %)identifier of resource2, subresource to resource1 34 +|(% style="width:604px" %)resource3Id|(% style="width:2790px" %)identifier of resource3, subresource to resource2 35 + 36 +(% class="wikigeneratedid" %) 37 +Routes that occurs in examples of this documentation will use the following identifiers 38 + 39 +(% class="table-bordered table-striped" %) 40 +|=(% style="width: 488px;" %)Resource|=(% style="width: 2271px;" %)Identifier 41 +|(% style="width:488px" %)LedgerNumber|(% style="width:2271px" %)XXX 42 +|(% style="width:488px" %)Accounts|(% style="width:2271px" %)NNN 43 +|(% style="width:488px" %)Bills|(% style="width:2271px" %)reminder-123 44 +bill-456 45 +|(% style="width:488px" %)Cards|(% style="width:2271px" %)954c8699-b38f-47a2-b568-668b8837dad8 46 +274c8699-b38f-47a2-b568-668b8837dat7 47 + 48 +== Accounts == 49 + 50 +The **accounts** resource is located under **ledger/account/v1/ **api**. **The accounts- and its sub-resources are used to create, read and modify information related to a account. 51 +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. 52 + 53 +The following operations is supported 54 + 55 +* Change the account credit limit 56 +* Add extra cards 57 +* Request cancellation of account 58 +* Turn on/off charity donation 59 +* Set behaviour of recurring payments 60 + 61 +==== Get a specific account ==== 62 + 63 +==== ==== 64 + 65 +{{code language="http" title="**Request**"}} 66 +GET /ledger/account/v1/XXX/accounts/NNN HTTP/1.1 67 +Host: - 68 +Authorization: Bearer <Token> 69 +Content-Type: application/json 70 +{{/code}} 71 + 72 + 73 +{{code language="http" title="**Response**"}} 74 +HTTP/1.1 200 OK 75 +Content-Type: application/json 76 + 77 +{ 78 + "@id": "/ledger/account/v1/XXX/accounts/NNN", 79 + "accountNo": "1234567", 80 + "startDate": "2018-05-21", 81 + "description": null, 82 + "accountProfileType": "accountType1 | accountType2 | accountType3 etc.", 83 + "accountAlias" : "accountAlias1 | accountAlias2 etc.", 84 + "customerNo" : "123789654", 85 + "status" : "Open | PendingClose | Closed", 86 + "creditLimit": 2000.00, 87 + "totalBalance" : -1900.0, 88 + "reservedAmount": 50.0, 89 + "availableAmount": 3850.0, 90 + "maxPaymentAmount": 51900.0, 91 + "openBill" : "/ledger/account/v1/XXX/accounts/NNN/bills/reminder-456", 92 + "charityDonation": true, 93 + "interestRate": { 94 + "debtInterest" : 10.00, 95 + "penaltyInterest": 15.00 96 + }, 97 + "bankPayment": { 98 + "bankAccountNo": "123", 99 + "bankAccountType": "BGSE", 100 + "bic": "123456", 101 + "iban": "SE12345678945631", 102 + "paymentReference": "54867165675646" 103 + }, 104 + "activePaymentOrders": "/ledger/account/v1/XXX/accounts/NNN/active-payment-orders", 105 + "recurringPaymentConfiguration": "/ledger/account/v1/XXX/accounts/NNN/recurring-payment-configuration", 106 + "cards": "/ledger/account/v1/XXX/accounts/123456/cards", 107 + "transactions": "/ledger/account/v1/XXX/accounts/NNN/transactions", 108 + "currency": "sek", 109 + "bills": "/ledger/account/v1/XXX/accounts/NNN/bills", 110 + "customer": "/ledger/customers/v1/XXX/customer/123456", 111 + "operation" : [ 112 + { 113 + "rel" : "add-card-info", 114 + "method" : "post", 115 + "href" : "/ledger/account/v1/XXX/accounts/NNN/cards" 116 + }, 117 + { 118 + "rel" : "request-close-account", 119 + "method" : "post", 120 + "href" : "/ledger/account/v1/XXX/accounts/NNN/request-close-account" 121 + }, 122 + { 123 + "rel" : "apply-for-raised-credit-limit", 124 + "method" : "post", 125 + "href" : "/ledger/account-onboardings/v1/XXX/accounts/NNN/apply-for-raised-credit-limit" 126 + }, 127 + { 128 + "rel" : "partial-update", 129 + "method" : "patch", 130 + "href" : "/ledger/account-onboardings/v1/XXX/accounts/NNN" 131 + } 132 + ] 133 +} 134 +{{/code}} 135 + 136 +==== Change charitydonation ==== 137 + 138 +{{code language="http" title="**Request**"}} 139 +PATCH /ledger/account/v1/XXX/accounts/NNN HTTP/1.1 140 +Host: - 141 +Authorization: Bearer <Token> 142 +Content-Type: application/json 143 + 144 +{ 145 + "charityDonation": false 146 +} 147 +{{/code}} 148 + 149 + 150 +{{code language="http" title="**Response**"}} 151 +HTTP/1.1 204 NO CONTENT 152 +Content-Type: application/json 153 + 154 +{{/code}} 155 + 156 +==== Lower the creditlimit ==== 157 + 158 +The creditlimit can only be lowered through this patch API call. Increasing of the creditlimit requires signing and has not been implemented yet. 159 + 160 +{{code language="http" title="**Request**"}} 161 +PATCH /ledger/account/v1/XXX/accounts/NNN HTTP/1.1 162 +Host: - 163 +Authorization: Bearer <Token> 164 +Content-Type: application/json 165 + 166 +{ 167 + "creditLimit": 2000.00 168 +} 169 +{{/code}} 170 + 171 + 172 +{{code language="http" title="**Response**"}} 173 +HTTP/1.1 204 NO CONTENT 174 +Content-Type: application/json 175 + 176 +{{/code}} 177 + 178 +==== Account resource properties ==== 179 + 180 +(% class="table-bordered table-striped" %) 181 +|=(% style="width: 215px;" %)Property|=(% style="width: 114px;" %)Data type|=(% style="width: 161px;" %)Format|=(% style="width: 61px;" %)Modify (patch)|=(% style="width: 877px;" %)Description 182 +|(% style="width:215px" %)@id |(% style="width:114px" %)string|(% style="width:161px" %)Maxlength: |(% style="width:61px" %) |(% style="width:877px" %)Uri of the specific account 183 +|(% style="width:215px" %)accountNo |(% style="width:114px" %)string|(% style="width:161px" %)Maxlength: 50|(% style="width:61px" %) |(% style="width:877px" %)The identifier of the account 184 +|(% 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 185 +|(% 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 186 +|(% 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// 187 +|(% 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// 188 +|(% 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) 189 +|(% style="width:215px" %)status |(% style="width:114px" %)string|(% style="width:161px" %)Maxlength: 25|(% style="width:61px" %) |(% style="width:877px" %)Status of the account((( 190 +* **PendingClose**: the customer has requested the account to be closed, the account will be closed when possible. 191 +* **Open**: the account is open and active 192 +* **Closed**: the account has been closed 193 +))) 194 +|(% 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. This value can only be 0 or positive. 195 +|(% 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.). This value can be either positive or negative. Negative means it is a surplus and positive means it is a debt. 196 +|(% 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). This value can only be positive. 197 +|(% 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). This value can only be positive. 198 +|(% style="width:215px" %)maxPaymentAmount|(% style="width:114px" %)decimal|(% style="width:161px" %) |(% style="width:61px" %) |(% style="width:877px" %)The largest amount possible to deposit on the account at this moment. 199 +|(% style="width:215px" %)openBill|(% style="width:114px" %)string|(% style="width:161px" %)Uri|(% style="width:61px" %) |(% style="width:877px" %) 200 +|(% 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 201 +|(% style="width:215px" %)interestRate.debtInterest|(% style="width:114px" %)decimal|(% style="width:161px" %)Percentage|(% style="width:61px" %) |(% style="width:877px" %)yearly debt interestrate 202 +|(% style="width:215px" %)interestRate.penaltyInterest|(% style="width:114px" %)decimal|(% style="width:161px" %)Percentage|(% style="width:61px" %) |(% style="width:877px" %)yearly penalty interestrate 203 +|(% style="width:215px" %)bankPayment|(% style="width:114px" %)object|(% style="width:161px" %) |(% style="width:61px" %) |(% style="width:877px" %)Details on how to make a bank payment to the account 204 +|(% style="width:215px" %) bankAccountNo|(% style="width:114px" %)string|(% style="width:161px" %) |(% style="width:61px" %) |(% style="width:877px" %)Bank account number for payments against the current account 205 +|(% style="width:215px" %) bankAccountType|(% style="width:114px" %)string|(% style="width:161px" %) |(% style="width:61px" %) |(% style="width:877px" %)((( 206 +Type of bank account 207 + 208 +* BGSE 209 +* PGSE 210 +* BKNO 211 +))) 212 +|(% style="width:215px" %) bic|(% style="width:114px" %)string|(% style="width:161px" %) |(% style="width:61px" %) |(% style="width:877px" %)BIC/SWIFT (Business Identifier Code) 213 +|(% style="width:215px" %) iban|(% style="width:114px" %)string|(% style="width:161px" %) |(% style="width:61px" %) |(% style="width:877px" %)IBAN (International Bank Account Number) 214 +|(% style="width:215px" %) paymentReference|(% style="width:114px" %)string|(% style="width:161px" %) |(% style="width:61px" %) |(% style="width:877px" %)Payment reference of the current account 215 +|(% style="width:215px" %)recurringPaymentConsent|(% style="width:114px" %)string|(% style="width:161px" %)Uri|(% style="width:61px" %) |(% style="width:877px" %) 216 +|(% style="width:215px" %)cards |(% style="width:114px" %)string|(% style="width:161px" %)Uri|(% style="width:61px" %) |(% style="width:877px" %) 217 +|(% style="width:215px" %)transactions |(% style="width:114px" %)string|(% style="width:161px" %)Uri|(% style="width:61px" %) |(% style="width:877px" %) 218 +|(% 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" %) 219 +|(% style="width:215px" %)bills |(% style="width:114px" %)string|(% style="width:161px" %)Uri|(% style="width:61px" %) |(% style="width:877px" %) 220 +|(% style="width:215px" %)customer |(% style="width:114px" %)string|(% style="width:161px" %)Uri|(% style="width:61px" %) |(% style="width:877px" %) 221 +|(% style="width:337px" %)activePaymentOrder.paymentMethod|(% style="width:205px" %)string|(% style="width:208px" %)Maxlength: 15|(% style="width:61px" %)((( 222 + 223 +)))|(% style="width:877px" %)((( 224 +PaymentTypes: 225 + 226 +* AUTOGIRO 227 +))) 228 +|(% 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) 229 +|(% 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 230 +|(% style="width:215px" %) |(% style="width:114px" %) |(% style="width:161px" %) |(% style="width:61px" %) |(% style="width:877px" %) 231 + 232 +---- 233 + 234 +==== Register-psp-payment ==== 235 + 236 +Method: POST 237 +Execution of this operation will result in an attempt to deposit the amount on the given account. 238 + 239 +(% class="box infomessage" %) 240 +((( 241 +Access to this operation is not normally granted, unless otherwise agreed. 242 +))) 243 + 244 +{{code language="http" title="**Request**"}} 245 +POST /ledger/account/v1/XXX/accounts/NNN/register-psp-payment HTTP/1.1 246 +Host: - 247 +Authorization: Bearer <Token> 248 +Content-Type: application/json 249 + 250 +{ 251 + "Amount": 2000.00, 252 + "PaymentDate": "2021-01-01", 253 + "sourcePspPaymentTransactionId": "123456789" 254 +} 255 +{{/code}} 256 + 257 + 258 +{{code language="http" title="**Response**"}} 259 +HTTP/1.1 204 NO CONTENT 260 +Content-Type: application/json 261 + 262 +{{/code}} 263 + 264 +===== Register-psp-payment resource properties ===== 265 + 266 +(% class="table-bordered table-striped" %) 267 +|=(% style="width: 161px;" %)Property|=(% style="width: 121px;" %)Data type|=(% style="width: 195px;" %)Format|=(% style="width: 1309px;" %)Description 268 +|(% style="width:161px" %)Amount|(% style="width:121px" %)Decimal|(% style="width:195px" %) |(% style="width:1309px" %)Amount to deposit on account, max value is found on the account resource in the property "MaxPaymentAmount". 269 +|(% style="width:161px" %)PaymentDate|(% style="width:121px" %)Date|(% style="width:195px" %)[[ISO 8601>>url:http://en.wikipedia.org/wiki/ISO_8601||rel="noreferrer" title="ISO8601 on Wikipedia"]]|(% style="width:1309px" %)Date of the actual payment 270 +|(% style="width:161px" %)sourcePspPaymentTransactionId|(% style="width:121px" %)String|(% style="width:195px" %)Maxlength: 50|(% style="width:1309px" %)Unique identifier for the payment 271 + 272 +---- 273 + 274 +== Bills == 275 + 276 +The bills resources contains all the documents produced in the accounts billing cycle. 277 + 278 + 279 +==== List all bills of an account ==== 280 + 281 + 282 +{{code language="http" title="**Request**"}} 283 +GET /ledger/account/v1/XXX/accounts/NNN/bills HTTP/1.1 284 +Host: - 285 +Authorization: Bearer <Token> 286 +Content-Type: application/json 287 + 288 +{{/code}} 289 + 290 + 291 +{{code language="http" title="**Response**"}} 292 +HTTP/1.1 200 OK 293 +Content-Type: application/json 294 + 295 +{ 296 + "@id": "/ledger/account/v1/501/accounts/NNN/bills?status=open", 297 + "items" : [ 298 + { 299 + "@id": "/ledger/account/v1/XXX/accounts/NNN/bills/reminder-123645", 300 + "dueDate": "2018-12-05", 301 + "billDate": "2018-11-15", 302 + "billNo": "124645", 303 + "billAmount": 240.00, 304 + "billType" : "reminder", 305 + "status": "open", 306 + "activePaymentDetails": { 307 + "minimumAmountToBePayed": 240.00, 308 + "bankAccountNo": "123", 309 + "bankAccountType": "BGSE", 310 + "bic": "123456", 311 + "iban": "SE12345678945631", 312 + "paymentReference": "5465164654663", 313 + "paymentOrdersExists": true, 314 + }, 315 + "document": "/ledger/account/v1/XXX/accounts/NNN/bills/reminder-124645/document" 316 + }, 317 + { 318 + "@id": "/ledger/account/v1/XXX/accounts/NNN/bills/reminder-123645", 319 + "dueDate": "2018-12-05", 320 + "billDate": "2018-11-15", 321 + "billNo": "124645", 322 + "billAmount": 240.00, 323 + "billType" : "bill", 324 + "status": "closed", 325 + "activePaymentDetails": null, 326 + "document": "/ledger/account/v1/XXX/accounts/NNN/bills/reminder-124645/document" 327 + }, 328 + { 329 + "@id": "/ledger/account/v1/XXX/accounts/NNN/bills/bill-123645", 330 + "dueDate": "2018-12-05", 331 + "billDate": "2018-11-15", 332 + "billNo": "124645", 333 + "billAmount": 240.00, 334 + "billType" : "bill", 335 + "status": "closed", 336 + "activePaymentDetails": null, 337 + "document": "/ledger/account/v1/XXX/accounts/NNN/bills/reminder-124645/document" 338 + } 339 + ] 340 +} 341 +{{/code}} 342 + 343 +==== ==== 344 + 345 +==== Get specific bill ==== 346 + 347 + 348 +{{code language="http" title="**Request**"}} 349 +GET /ledger/account/v1/XXX/accounts/NNN/bills/456 HTTP/1.1 350 +Host: - 351 +Authorization: Bearer <Token> 352 +Content-Type: application/json 353 + 354 +{{/code}} 355 + 356 + 357 +{{code language="http" title="**Response**"}} 358 +HTTP/1.1 200 OK 359 +Content-Type: application/json 360 + 361 +{ 362 + "@id": "/ledger/account/v1/XXX/accounts/NNN/bills/reminder-123645", 363 + "dueDate": "2018-12-05", 364 + "billDate": "2018-11-15", 365 + "billNo": "124645", 366 + "billAmount": 240.00, 367 + "billType" : "reminder", 368 + "status": "open", 369 + "activePaymentDetails": { 370 + "minimumAmountToBePayed": 240.00, 371 + "bankAccountNo": "123", 372 + "bankAccountType": "BGSE", 373 + "bic": "123456", 374 + "iban": "SE12345678945631", 375 + "paymentReference": "5465164654663", 376 + "paymentOrdersExists": true, 377 + }, 378 + "document": "/ledger/account/v1/XXX/accounts/NNN/bills/reminder-124645/document" 379 +} 380 +{{/code}} 381 + 382 +==== Bill resource properties ==== 383 + 384 +(% class="table-bordered table-striped" %) 385 +|=(% style="width: 337px;" %)Property|=(% style="width: 205px;" %)Data type|=(% style="width: 208px;" %)Format|=(% style="width: 621px;" %)Description 386 +|(% style="width:337px" %)@id|(% style="width:205px" %)string|(% style="width:208px" %)Uri|(% style="width:621px" %) 387 +|(% 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" %) 388 +|(% style="width:337px" %)billDate|(% style="width:205px" %)date|(% style="width:208px" %) |(% style="width:621px" %)Date when bill was created 389 +|(% style="width:337px" %)billNo|(% style="width:205px" %)string|(% style="width:208px" %)Maxlength: 50|(% style="width:621px" %)The identifier of the bill 390 +|(% style="width:337px" %)billAmount|(% style="width:205px" %)decimal|(% style="width:208px" %) |(% style="width:621px" %)the amount that is stated on the actual bill/document 391 +|(% style="width:337px" %)billType|(% style="width:205px" %)string|(% style="width:208px" %)Maxlength: 25|(% style="width:621px" %)((( 392 +BillTypes: 393 + 394 +* Bill 395 +* Reminder1 396 +* Reminder2 397 +* Collection 398 +))) 399 +|(% style="width:337px" %)status|(% style="width:205px" %)string|(% style="width:208px" %) |(% style="width:621px" %)"open" / "closed" 400 +|(% style="width:337px" %)activePaymentDetails|(% style="width:205px" %)object|(% style="width:208px" %) |(% style="width:621px" %)only set if status of bill is "open" 401 +|(% style="width:337px" %)activePaymentDetails.minimumAmountToBePayed|(% style="width:205px" %)decimal|(% style="width:208px" %) |(% style="width:621px" %)The least amount to pay on the bill 402 +|(% style="width:337px" %)activePaymentDetails.bankAccountNo|(% style="width:205px" %)string|(% style="width:208px" %)Maxlength: 15|(% style="width:621px" %)bankaccount for payment 403 +|(% style="width:337px" %)activePaymentDetails.bankAccountType|(% style="width:205px" %)string|(% style="width:208px" %)Maxlength: 10|(% style="width:621px" %)BankAccountTypes:((( 404 +* BKSE (swedish bankaccount) 405 +* PKSE (swedish plusgiro) 406 +* BGSE (swedish bankgiro) 407 +* PGSE (swedish plusgiro OCR) 408 +))) 409 +|(% style="width:337px" %)activePaymentDetails.bic|(% style="width:205px" %)string|(% style="width:208px" %)Maxlength: 11|(% style="width:621px" %)Bank Identifier Code (BIC) 410 +|(% style="width:337px" %)activePaymentDetails.iban|(% style="width:205px" %)string|(% style="width:208px" %)Maxlength: 34|(% style="width:621px" %)International Bank Account Number (IBAN) 411 +|(% style="width:337px" %)activePaymentDetails.paymentReference|(% style="width:205px" %)string|(% style="width:208px" %)Maxlength: 50|(% style="width:621px" %)reference to specify on the payment 412 +|(% 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". 413 +//More detailed information about the payment order can be found on the accounts resource// 414 +|(% style="width:337px" %)document|(% style="width:205px" %)string|(% style="width:208px" %)Url|(% style="width:621px" %)Url to download pdf document 415 + 416 +== Cards == 417 + 418 +==== Add card to account ==== 419 + 420 +Execute http post towards this resource to add a new card to the specified account 421 + 422 +{{code language="http" title="**Request**"}} 423 +POST /ledger/account/v1/XXX/accounts/NNN/cards HTTP/1.1 424 +Host: - 425 +Authorization: Bearer <Token> 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 +} 442 +{{/code}} 443 + 444 +==== Add replacement card ==== 445 + 446 +This operation is used to replace an existing card, and is therefore executed on the card to be replaced. The contract of the postbody is the same as POST towards the cards resource. 447 + 448 +{{code language="http" title="**Request**"}} 449 +POST /ledger/account/v1/XXX/accounts/NNN/cards/954c8699-b38f-47a2-b568-668b8837dad8/add-replacement-card HTTP/1.1 450 +Host: - 451 +Authorization: Bearer <Token> 452 +Content-Type: application/json 453 + 454 +{ 455 + "token": "954c8699-b38f-47a2-b568-668b8837dad8", 456 + "PanTrunc": "85479*********648", 457 + "deleted" : false, 458 + "mainCard": true, 459 + "cardHolder" : { 460 + "number" : "123465", 461 + "name": "test testsson", 462 + "nationalConsumerIdentifier": { 463 + "value": "19101010-1010", 464 + "countryCode": "SE" 465 + } 466 + } 467 +} 468 +{{/code}} 469 + 470 +==== List cards on an account ==== 471 + 472 +{{code language="http" title="**Request**"}} 473 +GET /ledger/account/v1/XXX/accounts/NNN/cards HTTP/1.1 474 +Host: - 475 +Authorization: Bearer <Token> 476 +Content-Type: application/json 477 + 478 + 479 +{{/code}} 480 + 481 + 482 +{{code language="http" title="**Response**"}} 483 +HTTP/1.1 200 OK 484 +Content-Type: application/json 485 + 486 +{ 487 + "operations": null, 488 + "items": [ 489 + { 490 + "token": "954c8699-b38f-47a2-b568-668b8837dad8", 491 + "PanTrunc": "85479*********648", 492 + "deleted" : false, 493 + "mainCard": true, 494 + "cardHolder" : { 495 + "number" : "123465", 496 + "name": "test testsson", 497 + "nationalConsumerIdentifier": { 498 + "value": "19101010-1010", 499 + "countryCode": "SE" 500 + } 501 + }, 502 + "@id": "/ledger/account/v1/XXX/accounts/NNN/cards/741" 503 + }, 504 + { 505 + "token": "274c8699-b38f-47a2-b568-668b8837dat7", 506 + "PanTrunc": "78979*********321", 507 + "deleted" : false, 508 + "mainCard": false, 509 + "cardHolder" : { 510 + "number" : "987654", 511 + "name": "test testsson", 512 + "nationalConsumerIdentifier": { 513 + "value": "19101010-1010", 514 + "countryCode": "SE" 515 + } 516 + }, 517 + "@id": "/ledger/account/v1/XXX/accounts/NNN/cards/274c8699-b38f-47a2-b568-668b8837dat7" 518 + } 519 + ], 520 + "@id": "/ledger/account/v1/XXX/accounts/NNN/cards", 521 + "view": { 522 + "@id": "/ledger/account/v1/XXX/accounts/NNN/cards?$top=2&$skip=0", 523 + "next": "/ledger/account/v1/XXX/accounts/NNN/cards?$top=2&$skip=2" 524 + } 525 +} 526 +{{/code}} 527 + 528 +==== Get a specific card ==== 529 + 530 + 531 +{{code language="http" title="**Request**"}} 532 +GET /ledger/account/v1/XXX/accounts/NNN/cards/954c8699-b38f-47a2-b568-668b8837dad8 HTTP/1.1 533 +Host: - 534 +Authorization: Bearer <Token> 535 +Content-Type: application/json 536 + 537 + 538 +{{/code}} 539 + 540 +{{code language="http" title="**Response**"}} 541 +HTTP/1.1 200 OK 542 +Content-Type: application/json 543 + 544 +{ 545 + "token": "954c8699-b38f-47a2-b568-668b8837dad8", 546 + "PanTrunc": "85479*********648", 547 + "deleted" : false, 548 + "mainCard": true, 549 + "cardHolder" : { 550 + "number" : "123465", 551 + "name": "test testsson", 552 + "nationalConsumerIdentifier": { 553 + "value": "19101010-1010", 554 + "countryCode": "SE" 555 + } 556 + }, 557 + "@id": "/ledger/account/v1/XXX/accounts/NNN/cards/954c8699-b38f-47a2-b568-668b8837dad8", 558 + "parentHREF": "/ledger/account/v1/XXX/accounts/NNN", 559 + "operation" : [ 560 + { 561 + "rel" : "partial-update", 562 + "method" : "patch", 563 + "href" : "/ledger/account/v1/XXX/accounts/NNN/cards/954c8699-b38f-47a2-b568-668b8837dad8" 564 + }, 565 + { 566 + "rel": "add-replacement-card", 567 + "href": "/ledger/account/v1/XXX/accounts/NNN/cards/5823a2d9-34d2-4bc4-8b6d-1e27f4511363/add-replacement-card", 568 + "method": "POST" 569 + } 570 + ] 571 +} 572 +{{/code}} 573 + 574 +==== Card resource properties ==== 575 + 576 +(% class="table-bordered table-striped" %) 577 +|=(% style="width: 337px;" %)Property|=(% style="width: 205px;" %)Data type|=(% style="width: 208px;" %)Format|=(% style="width: 62px;" %)Modify (patch)|=(% style="width: 1401px;" %)Description 578 +|(% style="width:337px" %)token|(% style="width:205px" %)string|(% style="width:208px" %) |(% style="width:62px" %) |(% style="width:1401px" %)token identifier of the card 579 +|(% style="width:337px" %)panTrunc|(% style="width:205px" %)string|(% style="width:208px" %) |(% style="width:62px" %) |(% style="width:1401px" %)truncated PAN 580 +|(% 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 581 +|(% 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) 582 +|(% style="width:337px" %)cardHolder.number|(% style="width:205px" %)string|(% style="width:208px" %) |(% style="width:62px" %) |(% style="width:1401px" %)Cardholder customernumber 583 +|(% style="width:337px" %)cardHolder.name|(% style="width:205px" %)string|(% style="width:208px" %) |(% style="width:62px" %) |(% style="width:1401px" %)Cardholder fullname 584 +|(% style="width:337px" %)cardHolder.nationalConsumerIdentifier.value|(% style="width:205px" %)string|(% style="width:208px" %)YYYYMMDD-NNNC|(% style="width:62px" %) |(% style="width:1401px" %) 585 +|(% 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" %) 586 + 587 +== Transactions == 588 + 589 +==== List transactions on an account ==== 590 + 591 +You can filter transactions by date in two different ways. Either filtering can be done by date range or by listing transactions by month. 592 + 593 +**Date range example** 594 + 595 +{{code language="http" title="**Request**"}} 596 +GET /ledger/account/v1/XXX/accounts/NNN/transactions?fromDate=2020-02-10&todate=2020-06-01 HTTP/1.1 597 +Host: - 598 +Authorization: Bearer <Token> 599 +Content-Type: application/json 600 + 601 + 602 +{{/code}} 603 + 604 +**Monthly example** 605 + 606 +{{code language="http" title="**Request**"}} 607 +GET /ledger/account/v1/XXX/accounts/NNN/transactions?month=2020-04 HTTP/1.1 608 +Host: - 609 +Authorization: Bearer <Token> 610 +Content-Type: application/json 611 + 612 + 613 +{{/code}} 614 + 615 +**Standard (default last 30 days) ** 616 + 617 +{{code language="http" title="**Request**"}} 618 +GET /ledger/account/v1/XXX/accounts/NNN/transactions HTTP/1.1 619 +Host: - 620 +Authorization: Bearer <Token> 621 +Content-Type: application/json 622 + 623 + 624 +{{/code}} 625 + 626 + 627 +{{code language="http" title="**Response**"}} 628 +HTTP/1.1 200 OK 629 +Content-Type: application/json 630 + 631 +{ 632 + "operations": null, 633 + "items": [ 634 + { 635 + "type": "payment", 636 + "description": "", 637 + "amount": 200.00, 638 + "initiatedFromPointOfSale": false, 639 + "date": "2019-10-09" 640 + }, 641 + { 642 + "type": "purchase", 643 + "description": "testbutiken, köpref. 12345689", 644 + "amount": 200.00, 645 + "initiatedFromPointOfSale": true, 646 + "date": "2019-10-09" 647 + }, 648 + { 649 + "type": "credit", 650 + "description": "", 651 + "amount": 200.00, 652 + "initiatedFromPointOfSale": true, 653 + "date": "2019-10-09" 654 + } 655 + ], 656 + "@id": "/ledger/account/v1/XXX/accounts/NNN/transactions" 657 +} 658 +{{/code}} 659 + 660 +==== Transaction resource properties ==== 661 + 662 +(% class="table-bordered table-striped" %) 663 +|=(% style="width: 337px;" %)Property|=(% style="width: 205px;" %)Data type|=(% style="width: 208px;" %)Format|=(% style="width: 621px;" %)Description 664 +|(% style="width:337px" %)type|(% style="width:205px" %)string|(% style="width:208px" %) |(% style="width:621px" %)((( 665 +Type of transaction 666 + 667 +* Payment 668 +* Purchase 669 +* Credit 670 +* AdministrationFee 671 +* BillingFee 672 +* CollectionFee 673 +* Deduction 674 +* Disbursement 675 +* DisbursementReturned 676 +* Interest 677 +* LateFee 678 +* ReminderFee 679 +* MigratedBalance// (Amount of the initially migrated balance on the account)// 680 +))) 681 +|(% 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" 682 +|(% style="width:337px" %)amount|(% style="width:205px" %)decimal|(% style="width:208px" %) |(% style="width:621px" %)This value can be either positive or negative. Negative means decreasing debt or increasing surplus. Positive transactions increases debt or decreases surplus. 683 +|(% style="width:337px" %)initiatedFromPointOfSale|(% style="width:205px" %)bool|(% style="width:208px" %) |(% style="width:621px" %)Indicates whether the transaction was initiated from point of sale, or else it is a "ledger" transaction that was initiated internally in the ledgersystem. 684 +|(% style="width:337px" %)date|(% style="width:205px" %)date|(% style="width:208px" %) |(% style="width:621px" %)Date when the transaction was initiated (Authorization date) 685 + 686 +== Reservations == 687 + 688 +==== List reservations in an account ==== 689 + 690 +{{code language="http" title="**Request**"}} 691 +GET /ledger/account/v1/XXX/accounts/NNN/reservations HTTP/1.1 692 +Host: - 693 +Authorization: Bearer <Token> 694 +Content-Type: application/json 695 + 696 + 697 +{{/code}} 698 + 699 + 700 +{{code language="http" title="**Response**"}} 701 +HTTP/1.1 201 Created 702 +Content-Type: application/json 703 + 704 +{ 705 + "operations": null, 706 + "items": [ 707 + { 708 + "amount": 200.00, 709 + "description" : "", 710 + "date": "2019-10-05", 711 + }, 712 + { 713 + "amount": 450.00, 714 + "description" : "", 715 + "date": "2019-10-02", 716 + }, 717 + ], 718 + "@id": "/ledger/account/v1/XXX/accounts/NNN/reservations", 719 +} 720 +{{/code}} 721 + 722 +==== Reservation resource properties ==== 723 + 724 +(% class="table-bordered table-striped" %) 725 +|=(% style="width: 337px;" %)Property|=(% style="width: 205px;" %)Data type|=(% style="width: 208px;" %)Format|=(% style="width: 621px;" %)Description 726 +|(% style="width:337px" %)amount|(% style="width:205px" %)decimal|(% style="width:208px" %) |(% style="width:621px" %) 727 +|(% style="width:337px" %)description|(% style="width:205px" %)string|(% style="width:208px" %) |(% style="width:621px" %)Description of the reservation, normally "point of sale". 728 +|(% style="width:337px" %)date|(% style="width:205px" %)date|(% style="width:208px" %) |(% style="width:621px" %)Date when the reservation occured 729 + 730 +== Recurring-payment-configuration == 731 + 732 +(% class="wikigeneratedid" %) 733 +This resource contain information/settings related to how recurring payments should behave on this account. 734 + 735 +==== 736 +Get settings on an account ==== 737 + 738 + 739 +{{code language="http" title="**Request**"}} 740 +GET /ledger/account/v1/XXX/accounts/NNN/recurring-payment-configuration/ HTTP/1.1 741 +Host: - 742 +Authorization: Bearer <Token> 743 +Content-Type: application/json 744 +{{/code}} 745 + 746 + 747 +{{code language="http" title="**Response**"}} 748 +HTTP/1.1 200 OK 749 +Content-Type: application/json 750 + 751 +{ 752 + "@id" : "/ledger/account/v1/XXX/accounts/NNN/recurring-payment-configurations", 753 + "paymentMethod" : "autogiro", 754 + "paymentScope" : "fixedRecurring", 755 + "fixedAmount" : 1500.00, 756 + "parentHREF": "/ledger/account/v1/XXX/accounts/NNN", 757 + "operation" : [ 758 + { 759 + "rel" : "partially-update-recurring-payment-consent", 760 + "method" : "patch", 761 + "href" : "/ledger/account/v1/XXX/accounts/NNN/recurring-payment-consent" 762 + } 763 + ] 764 +} 765 +{{/code}} 766 + 767 +==== Create settings on an account ==== 768 + 769 +(% class="wikigeneratedid" %) 770 +Execute http **POST **towards this resource to create recurring payments configuration for specified account. 771 + 772 +{{code language="http" title="**Request**"}} 773 +POST /ledger/account/v1/XXX/accounts/NNN/recurring-payment-configuration HTTP/1.1 774 +Host: - 775 +Authorization: Bearer <Token> 776 +Content-Type: application/json 777 + 778 +{ 779 + "paymentMethod" : "autogiro", 780 + "paymentScope" : "billedAmount", 781 + "fixedAmount" : 0.00 782 +} 783 +{{/code}} 784 + 785 +==== 786 +Update settings on an account ==== 787 + 788 +(% class="wikigeneratedid" %) 789 +Execute http **PATCH** towards this resource to update the recurring payment configuration 790 + 791 +{{code language="http" title="**Request**"}} 792 +PATCH /ledger/account/v1/XXX/accounts/NNN/recurring-payment-configuration HTTP/1.1 793 +Host: - 794 +Authorization: Bearer <Token> 795 +Content-Type: application/json 796 + 797 +{ 798 + "paymentScope" : "billedAmount", 799 + "fixedAmount" : 0.00 800 +} 801 +{{/code}} 802 + 803 +==== Delete settings on an account ==== 804 + 805 +(% class="wikigeneratedid" %) 806 +Execute http **DELETE **to delete the recurring payment settings for the specified account. By deleting the settings, the account will not use the consent registered on the customer for recurring payments. 807 + 808 +{{code language="http" title="**Request**"}} 809 +DELETE /ledger/account/v1/XXX/accounts/NNN/recurring-payment-configuration HTTP/1.1 810 +Host: - 811 +Authorization: Bearer <Token> 812 +Content-Type: application/json 813 + 814 +{} 815 +{{/code}} 816 + 817 +==== Recurring-payment-configuration resource properties ==== 818 + 819 +(% class="table-bordered table-striped" %) 820 +|=(% style="width: 337px;" %)Property|=(% style="width: 205px;" %)Data type|=(% style="width: 208px;" %)Format|=(% style="width: 58px;" %)Modify (patch)|=(% style="width: 1176px;" %)Description 821 +|(% style="width:337px" %)paymentMethod|(% style="width:205px" %)string|(% style="width:208px" %) |(% style="background-color:palegreen; width:58px" %) |(% style="width:1176px" %)paymentMethods:((( 822 +* autogiro 823 +))) 824 +|(% style="width:337px" %)paymentScope|(% style="width:205px" %)string|(% style="width:208px" %) |(% style="background-color:palegreen; width:58px" %) |(% style="width:1176px" %)((( 825 +paymentScopes: 826 + 827 +* fixedRecurring (Fixed amount to debit monthly) 828 +* totalDebt (Total account debt / used credit will be debited each month) 829 +* billedAmount (Only the //"minimum amount to pay"// will be debited each month) 830 +))) 831 +|(% style="width:337px" %)fixedAmount|(% 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") 832 + 833 +== Active-payment-orders == 834 + 835 +(% class="wikigeneratedid" %) 836 +This resource corresponds to an active / scheduled payment order placed against the specific account, the end-customer will be debited at the given executeDate. 837 + 838 +==== 839 +Get active payment orders for an account ==== 840 + 841 + 842 +{{code language="http" title="**Request**"}} 843 +GET /ledger/account/v1/XXX/accounts/NNN/active-payment-orders/ HTTP/1.1 844 +Host: - 845 +Authorization: Bearer <Token> 846 +Content-Type: application/json 847 +{{/code}} 848 + 849 + 850 +{{code language="http" title="**Response**"}} 851 +HTTP/1.1 200 OK 852 +Content-Type: application/json 853 + 854 +{ 855 + "operations": null, 856 + "items": [ 857 + { 858 + "paymentMethod": "autogiro", 859 + "executeDate": "2020-02-15", 860 + "amount": 200.00 861 + } 862 + ], 863 + "view": { 864 + "@id": "/ledger/account/v1/XXX/accounts/NNN/active-payment-orders?$top=2&$skip=0", 865 + "next": "/ledger/account/v1/XXX/accounts/NNN/active-payment-orders?$top=2&$skip=2" 866 + } 867 +} 868 +{{/code}} 869 + 870 +==== ==== 871 + 872 +==== Active-payment-orders resource properties ==== 873 + 874 +(% class="table-bordered table-striped" %) 875 +|=(% style="width: 337px;" %)Property|=(% style="width: 205px;" %)Data type|=(% style="width: 208px;" %)Format|=(% style="width: 58px;" %)Modify (patch)|=(% style="width: 1176px;" %)Description 876 +|(% style="width:337px" %)paymentMethod|(% style="width:205px" %)string|(% style="width:208px" %) |(% style="width:58px" %) |(% style="width:1176px" %)paymentMethods:((( 877 +* autogiro 878 +))) 879 +|(% style="width:337px" %)executeDate|(% style="width:205px" %)Date|(% style="width:208px" %) |(% style="width:58px" %) |(% style="width:1176px" %)((( 880 +The date when the payment order will be executed 881 +))) 882 +|(% 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 883 + 884 +=== === 885 + 886 +== Problems == 887 + 888 +All errors from the api are returned in the form of "problems" (response body), except for the http status code itself. 889 +The problem object contain more detailed info on what the error is. The "type" property can be used to programmatically interpret the error as it contains a code definition of the problem. 890 +Other properties can be useful for logging and subsequent troubleshooting. Some problems are extended with additional parameters so it may be a good idea to log response body as raw data to include these. 891 + 892 +Problems of type validation does contain an additional list ("Problems") that describes exactly which parameter that failed the validation 893 + 894 +=== Example === 895 + 896 +{{code language="http" title="**Response**"}} 897 +HTTP/1.1 400 Error 898 +Content-Type: application/problem+json 899 + 900 +{ 901 + "Type" : "ledger.account.validation", 902 + "Title" : "A validation error occurred", 903 + "Status" : 400, 904 + "Instance" : "215d4206-ca35-4f43-85ad-169c8f6d4ec1", 905 + "Detail" : "A validation error occurred. Please fix the problems mentioned in the 'problems' property below.", 906 + "Problems" : [ 907 + { 908 + "amount" : "Expected value between [0,01]-[79228162514264337593543950335] actual [0]" 909 + } 910 + ] 911 +} 912 +{{/code}} 913 + 914 +=== Problem types === 915 + 916 +(% class="box infomessage" %) 917 +((( 918 +Note, each problem typecode is preceded by "ledger.account." in this API, e.g. the error "validation" in the table below will appear as typecode "ledger.account.validation". 919 +))) 920 + 921 +(% class="table-bordered table-striped" %) 922 +|=(% style="width: 537px;" %)Problem type (code)|=(% style="width: 172px;" %)Httpstatus|=(% style="width: 796px;" %)Description 923 +|(% 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 924 +|(% style="width:537px" %)customer-does-not-exists|(% style="width:172px" %)404|(% style="width:796px" %)can occur if customernumber is part of the querystring towards account resource 925 +|(% style="width:537px" %)card-not-found|(% style="width:172px" %)404|(% style="width:796px" %) 926 +|(% style="width:537px" %)duplicate-card-token|(% style="width:172px" %)409|(% style="width:796px" %) 927 +|(% style="width:537px" %)card-update-failed|(% style="width:172px" %)422|(% style="width:796px" %) 928 +|(% style="width:537px" %)account-not-found|(% style="width:172px" %)404|(% style="width:796px" %) 929 +|(% style="width:537px" %)invalid-reg-no|(% style="width:172px" %)400|(% style="width:796px" %)
- Account.API diagram.jpeg
-
- Author
-
... ... @@ -1,0 +1,1 @@ 1 +xwiki:XWiki.rae - Size
-
... ... @@ -1,0 +1,1 @@ 1 +0 bytes - Content