Wiki source code of ../credit-account

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