Changes for page ../credit-account

Last modified by David Persson on 2022/08/11 10:52
From empty
To version 145.1
edited by David Persson
on 2020/09/25 09:15
Change comment: There is no comment for this version

Summary

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