Changes for page account

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