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