Changes for page ../credit-account
Last modified by David Persson on 2022/08/11 10:52
From empty
To version 12.1
edited by David Persson
on 2019/12/09 14:23
on 2019/12/09 14:23
Change comment: There is no comment for this version
Summary
-
Page properties (6 modified, 0 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,390 @@ 1 +(% class="jumbotron" %) 2 +((( 3 +(% class="container" %) 4 +((( 5 +Integrate to **PayEx Credit Account API ** 6 +))) 7 +))) 8 + 9 +== Accounts == 10 + 11 + 12 +{{code language="http" title="**Request**"}} 13 +GET /ledger/credit-account/v1/XXX/accounts HTTP/1.1 14 +Host: - 15 +Authorization: Bearer <Token> 16 +Content-Type: application/json 17 +{{/code}} 18 + 19 +If the authorization post succeeds, or if a ##get## method is performed to retrieve an existing authorization, it should respond with something like the following: 20 + 21 +{{code language="http" title="**Response**"}} 22 +HTTP/1.1 200 OK 23 +Content-Type: application/json 24 + 25 +{ 26 + "@id": "/ledger/credit-account/v1/501/accounts/123456", 27 + "accountNo": "1234567", 28 + "startDate": "2016-05-21", 29 + "description": null, 30 + "accountProfileType": "kontodebet | kontokredit | kontofaktura", //Nytt begrepp 31 + "accountAlias" : "kontokredit1 | matkonto1", 32 + "customerNo" : "123789654", 33 + "status" : "open | pending-close | closed", 34 + "creditLimit": 2000.00, // Kontots kreditlimit 35 + "unpaidBilledAmount" : 200.0, //total aktuell summa av alla balanser på BillingAcc (endast om negativ/skuld, annars 0) 36 + "debt": 2050.0, // total aktuell summa av alla balanser (kapital/ränta/avgifter osv.) på BillingAcc + underliggande CredAccs, OM NEGATIV (skuld) 37 + "surplus": 0.0, // total aktuell summa av alla balanser (kapital/ränta/avgifter osv.) på BillingAcc + underliggande CredAccs, OM POSITIV (tillgodo) 38 + "reservedAmount": 50.0, // Summerat belopp på alla utestående reservationer mot kontot (som är giltiga och ej captured) 39 + "availableAmount": 100.0, // Tillgänglig kredit (kan ej räknas fram utifrån ovan belopp då avgifter kan ingå där, som inte påverkar tillgänglig kredit) 40 + "openBill" : { 41 + "amount" : 250.0, 42 + "bill" : "/ledger/credit-account/v1/501/accounts/123456/bills/963", 43 + "dueDate" : "2019-10-10", 44 + "billType" : "Bill" 45 + }, 46 + "charityDonation": true, 47 + "interestRate": { 48 + "debtInterest" : 10.00, 49 + "penaltyInterest": 15.00 50 + }, 51 + "offer" : "", //nödvändig?? 52 + "directDebit": "/ledger/credit-account/v1/501/accounts/123456/direct-debit", 53 + "cards": "/ledger/credit-account/v1/501/accounts/123456/cards", 54 + "transactions": "/ledger/credit-account/v1/501/accounts/123456/transactions", 55 + "currency": "sek", 56 + "bills": "/ledger/credit-account/v1/501/accounts/123456/bills", 57 + "customer": "/ledger/customers/v1/501/customer/123456", 58 + "operation" : [ 59 + { 60 + "rel" : "add-card-info", 61 + "method" : "post", 62 + "href" : "/ledger/credit-account/v1/501/accounts/123456/cards" 63 + }, 64 + { 65 + "rel" : "request-close-account", // -> pending-close status (workitem för stängning) 66 + "method" : "post", 67 + "href" : "/ledger/credit-account/v1/501/accounts/123456/request-close-account" 68 + }, 69 + { 70 + "rel" : "apply-for-raised-credit-limit", 71 + "method" : "post", 72 + "href" : "/ledger/credit-account-onboardings/v1/501/accounts/123456/apply-for-raised-credit-limit" 73 + }, 74 + { 75 + "rel" : "lower-credit-limit", 76 + "method" : "patch", 77 + "href" : "/ledger/credit-account-onboardings/v1/501/accounts/123456" 78 + }, 79 + { 80 + "rel" : "change-charity-donation", 81 + "method" : "patch", 82 + "href" : "/ledger/credit-account-onboardings/v1/501/accounts/123456" 83 + } 84 + ] 85 +} 86 +{{/code}} 87 + 88 + 89 +== Bills == 90 + 91 +==== List bills ==== 92 + 93 +{{code language="http" title="**Request**"}} 94 +GET /ledger/credit-account/v1/XXX/accounts/123/bills HTTP/1.1 95 +Host: - 96 +Authorization: Bearer <Token> 97 +Content-Type: application/json 98 + 99 +{{/code}} 100 + 101 + 102 +{{code language="http" title="**Response**"}} 103 +HTTP/1.1 200 OK 104 +Content-Type: application/json 105 + 106 +{ 107 + "bills" : [ 108 + { "billDate" : "2018-09-01", "status" : "open", "billAmount" : 374.10, "@id" : "/ledger/credit-account/v1/501/accounts/123456/bills/963" }, 109 + { "billDate" : "2018-08-01", "status" : "closed", "billAmount" : 374.10, "@id" : "/ledger/credit-account/v1/501/accounts/123456/bills/852" }, 110 + { "billDate" : "2018-07-01", "status" : "closed", "billAmount" : 374.10, "@id" : "/ledger/credit-account/v1/501/accounts/123456/bills/741" } 111 + ] 112 +} 113 +{{/code}} 114 + 115 +==== Bill resource ==== 116 + 117 + 118 +{{code language="http" title="**Request**"}} 119 +GET /ledger/credit-account/v1/XXX/accounts/123/bills/456 HTTP/1.1 120 +Host: - 121 +Authorization: Bearer <Token> 122 +Content-Type: application/json 123 + 124 +{{/code}} 125 + 126 + 127 +{{code language="http" title="**Response**"}} 128 +HTTP/1.1 200 OK 129 +Content-Type: application/json 130 + 131 +{ 132 + "@id": "/ledger/credit-account/v1/501/accounts/123456/bills/963", 133 + "externalReference": "123456", 134 + "dueDate": "2018-12-05", 135 + "billNo": "124645", 136 + "amountToBePayed": 240.00, //kan inte denna heta bara "amount" egentligen? 137 + "billType" : "Bill", 138 + "bankPayment": { 139 + "bankAccountNo": "123", 140 + "bankAccountType": "BGSE", 141 + "bic": "123456", 142 + "iban": "SE12345678945631", 143 + "paymentReference": "1246fdsdf4687613" 144 + }, 145 + "activePaymentOrder": { 146 + "paymentType": "BGAGSE", 147 + "executionDate": "2019-01-01", 148 + "amount" : 200.0 //beroende på directdebittype så kan denna vara beräknad vid varje hämtning (utifrån ev. delbet) 149 + }, 150 + "pdf": "/ledger/credit-account/v1/501/accounts/123456/bills/963/pdf" //visar senaste ev. childbill? 151 +} 152 +{{/code}} 153 + 154 +== Direct-debit == 155 + 156 + 157 +{{code language="http" title="**Request**"}} 158 +POST /ledger/credit-account/v1/XXX/accounts/123/direct-debit HTTP/1.1 159 +Host: - 160 +Authorization: Bearer <Token> 161 +Content-Type: application/json 162 +{{/code}} 163 + 164 + 165 +{{code language="http" title="**Response**"}} 166 +HTTP/1.1 200 OK 167 +Content-Type: application/json 168 + 169 +{ 170 + "@id" : "/ledger/credit-account/v1/501/accounts/123456/direct-debit", 171 + "directDebitType" : "fixedRecurring | totalDebt | billedAmount | onDemand", 172 + "fixedRecurringAmount" : 1500.00, 173 + "parentHREF": "/ledger/credit-account/v1/501/accounts/123456" 174 +} 175 + 176 +{{/code}} 177 + 178 +== Cards == 179 + 180 + 181 +{{code language="http" title="**Request**"}} 182 +POST /ledger/credit-account/v1/XXX/accounts/123/cards HTTP/1.1 183 +Host: - 184 +Authorization: Bearer <Token> 185 +Content-Type: application/json 186 + 187 + 188 +{{/code}} 189 + 190 + 191 +{{code language="http" title="**Response**"}} 192 +HTTP/1.1 201 Created 193 +Content-Type: application/json 194 + 195 +{ 196 + "cards" : [ 197 + {"PanTrunc" : "85479**********648", "@id" : "/ledger/credit-account/v1/501/accounts/123456/cards/741"}, 198 + {"PanTrunc" : "12345**********456", "@id" : "/ledger/credit-account/v1/501/accounts/123456/cards/742"} 199 + ] 200 +} 201 +{{/code}} 202 + 203 +{{code language="http" title="**Request**"}} 204 +POST /ledger/credit-account/v1/XXX/accounts/123/cards/456 HTTP/1.1 205 +Host: - 206 +Authorization: Bearer <Token> 207 +Content-Type: application/json 208 + 209 + 210 +{{/code}} 211 + 212 + 213 +{{code language="http" title="**Response**"}} 214 +HTTP/1.1 201 Created 215 +Content-Type: application/json 216 + 217 +{ 218 + "token": "954c8699-b38f-47a2-b568-668b8837dad8", 219 + "PanTrunc": "85479*********648", 220 + "deleted" : false, 221 + "mainCard": true, 222 + "cardHolder" : { 223 + "number" : "123465", 224 + "name": "test testsson", 225 + "nationalConsumerIdentifier": { 226 + "value": "19101010-1010", 227 + "countryCode": "SE" 228 + } 229 + }, 230 + "@id": "/ledger/credit-account/v1/501/accounts/123456/cards/741", 231 + "parentHREF": "/ledger/credit-account/v1/501/accounts/123456", 232 + "operation" : [ 233 + { 234 + "rel" : "delete-card-info", 235 + "method" : "patch", 236 + "href" : "/ledger/credit-account/v1/501/accounts/123456/cards/741" 237 + } 238 + ] 239 +} 240 +{{/code}} 241 + 242 +== Transactions == 243 + 244 + 245 +{{code language="http" title="**Request**"}} 246 +POST /ledger/credit-account/v1/XXX/accounts/123/transactions HTTP/1.1 247 +Host: - 248 +Authorization: Bearer <Token> 249 +Content-Type: application/json 250 + 251 + 252 +{{/code}} 253 + 254 + 255 +{{code language="http" title="**Response**"}} 256 +HTTP/1.1 201 Created 257 +Content-Type: application/json 258 + 259 +{ 260 + "operations": null, 261 + "items": [ 262 + { 263 + "type": "payment", //transactionTypeGroup 264 + "description": "", 265 + "amount": 200.00, 266 + "billed": false|true, 267 + "date": "2019-10-09", //ValueDate 268 + "reserveDate": null 269 + }, 270 + { 271 + "type": "purchase", //transactionTypeGroup 272 + "description": "stora coop visby, k�pref. 12345689", 273 + "amount": 200.00, 274 + "billed": false|true, 275 + "date": "2019-10-09", //ValueDate 276 + "reserveDate": "2019-10-05", 277 + }, 278 + { 279 + "type": "credit", //transactionTypeGroup 280 + "description": "", 281 + "amount": 200.00, 282 + "billed": false|true, 283 + "date": "2019-10-09", //ValueDate 284 + "reserveDate": "2019-10-05" 285 + } 286 + ], 287 + "@id": "/ledger/credit-account/v1/501/accounts/123456/transactions?fromDate=2019-10-01", 288 + "view": { 289 + "@id": "/ledger/credit-account/v1/501/accounts/123456/transactions?fromDate=2019-10-01&$top=2&$skip=0", 290 + "next": "/ledger/credit-account/v1/501/accounts/123456/transactions?fromDate=2019-10-01&$top=2&$skip=2" 291 + } 292 +} 293 +{{/code}} 294 + 295 +== Reservations == 296 + 297 + 298 +{{code language="http" title="**Request**"}} 299 +POST /ledger/credit-account/v1/XXX/accounts/123/reservations HTTP/1.1 300 +Host: - 301 +Authorization: Bearer <Token> 302 +Content-Type: application/json 303 + 304 + 305 +{{/code}} 306 + 307 + 308 +{{code language="http" title="**Response**"}} 309 +HTTP/1.1 201 Created 310 +Content-Type: application/json 311 + 312 +{ 313 + "operations": null, 314 + "items": [ 315 + { 316 + "amount": 200.00, 317 + "description" : "", //ta med denna?? 318 + "date": "2019-10-05", 319 + }, 320 + { 321 + "amount": 450.00, 322 + "description" : "", //ta med denna?? 323 + "date": "2019-10-02", 324 + }, 325 + ], 326 + "@id": "/ledger/credit-account/v1/501/accounts/123456/reservations", 327 +} 328 +{{/code}} 329 + 330 + 331 + 332 +Problems 333 + 334 +If an error occur or any validation failed, a "problem" response will be returned. 335 +Below is a list of problems that can occur: 336 + 337 +**HttpStatus 401 Unauthorized** 338 + 339 +* Token expired 340 +* Token invalid 341 +* SellerNumber does not match token 342 +* CompanyNumber does not match token 343 + 344 +**HttpStatus 400 Error** 345 + 346 +* Validation: Argument required 347 +* Validation: Invalid value 348 + 349 +**HttpStatus 422 Unprocessable entity** 350 + 351 +* Authorization declined 352 + 353 +**HttpStatus 409 Conflict** 354 + 355 +* Invoice already authorized 356 +* Duplicate InvoiceNumber 357 +* Authorization is cancelled 358 +* Authorization already captured 359 +* Authorization has expired 360 +* Insufficient debited amount XXX 361 + 362 +**HttpStatus 501 NotImplemented** 363 + 364 +* CompanyNumber XXX not configured 365 +* SellerNumber XXX not configured at PayEx 366 +* CompanyNumber XXX missing configuration 367 + 368 +**HttpStatus 404 NotFound** 369 + 370 +* Authorization not found 371 + 372 +Below is an example of a problem that will be returned if buyer##.nationalConsumerIdentifier.value## is not valid in the authorization post request. 373 + 374 +{{code language="http" title="**Response**"}} 375 +HTTP/1.1 400 Error 376 +Content-Type: application/problem+json 377 + 378 +{ 379 + "Type": "http://[DNS]/ledger/invoice-purchase/problems/validation", 380 + "Title": "A validation error occurred", 381 + "Status": 400, 382 + "Instance": null, 383 + "Detail": "A validation error occurred. Please fix the problems mentioned in the 'problems' property below.", 384 + "Problems": [ 385 + { 386 + "buyer.nationalConsumerIdentifier.value": "Not a valid SE nationalConsumerIdentifier" 387 + } 388 + ] 389 +} 390 +{{/code}}