Changes for page account

Last modified by David Persson on 2024/02/21 07:42
From empty
To version 1.1
edited by Rasmus Enekvist
on 2021/09/23 13:57
Change comment: There is no comment for this version

Summary

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