Wiki source code of ../credit-account
Last modified by Helge Dahl on 2020/02/06 17:55
![]() |
3.1 | 1 | (% class="jumbotron" %) |
2 | ((( | ||
3 | (% class="container" %) | ||
4 | ((( | ||
5 | Integrate to **PayEx Credit Account API ** | ||
6 | ))) | ||
7 | ))) | ||
8 | |||
![]() |
57.1 | 9 | (% class="box errormessage" %) |
10 | ((( | ||
11 | Todo: Saknar operation för att hitta konton som tillhör en person/ett personnummer | ||
12 | ))) | ||
13 | |||
![]() |
85.1 | 14 | (% id="HChangelog" %) |
15 | = Changelog = | ||
16 | |||
17 | 2020-01-31 | ||
18 | renamed resource "recurring-payment-consent" to "recurring-payment-setting" (not implemented in API yet) | ||
19 | |||
![]() |
73.1 | 20 | (% class="lead" %) |
21 | This api is used to retrieve information and to change properties related to the customer's credit account. | ||
![]() |
88.1 | 22 | (% contenteditable="false" tabindex="-1" %)[[image:1579213343157-343.png||data-widget="image" height="325" width="346"]] |
![]() |
57.1 | 23 | |
![]() |
75.2 | 24 | (% id="HRoutesegments" %) |
![]() |
78.1 | 25 | == Introduction == |
![]() |
75.2 | 26 | |
27 | Each resource in the API corresponds to its own route. All routes are structured according to a specific standard, explained below | ||
28 | 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. | ||
29 | //api.payex.com/ledger/**{Subdomain}**/v1/**{LedgerNumber}**/resource1/**{resource1Id}**/resource2/**{resource2Id}**/resource3/**{resource3Id}**// | ||
30 | |||
![]() |
77.1 | 31 | (% class="table-bordered table-striped" %) |
32 | |=(% style="width: 604px;" %)Route segment|=(% style="width: 2790px;" %)Description | ||
33 | |(% style="width:604px" %)Subdomain|(% style="width:2790px" %)In this part of the API it will be credit-account | ||
34 | |(% style="width:604px" %)LedgerNumber|(% style="width:2790px" %)The ledger identifier/number at PayEx | ||
35 | |(% style="width:604px" %)resource1Id|(% style="width:2790px" %)Identifier of resource1 | ||
36 | |(% style="width:604px" %)resource2Id|(% style="width:2790px" %)identifier of resource2, subresource to resource1 | ||
37 | |(% style="width:604px" %)resource3Id|(% style="width:2790px" %)identifier of resource3, subresource to resource2 | ||
![]() |
75.2 | 38 | |
39 | (% class="wikigeneratedid" %) | ||
![]() |
76.1 | 40 | Routes that occurs in examples of this documentation will use the following identifiers |
![]() |
75.2 | 41 | |
![]() |
77.1 | 42 | (% class="table-bordered table-striped" %) |
![]() |
76.1 | 43 | |=(% style="width: 488px;" %)Resource|=(% style="width: 2271px;" %)Identifier |
![]() |
75.2 | 44 | |(% style="width:488px" %)LedgerNumber|(% style="width:2271px" %)XXX |
45 | |(% style="width:488px" %)Accounts|(% style="width:2271px" %)NNN | ||
![]() |
76.1 | 46 | |(% style="width:488px" %)Bills|(% style="width:2271px" %)reminder-123 |
47 | bill-456 | ||
48 | |(% style="width:488px" %)Cards|(% style="width:2271px" %)954c8699-b38f-47a2-b568-668b8837dad8 | ||
49 | 274c8699-b38f-47a2-b568-668b8837dat7 | ||
![]() |
75.2 | 50 | |
![]() |
3.1 | 51 | == Accounts == |
52 | |||
![]() |
64.2 | 53 | 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. |
54 | 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. | ||
55 | The following operations is supported | ||
![]() |
50.2 | 56 | |
![]() |
64.2 | 57 | * Change the account credit limit |
58 | * Add extra cards | ||
59 | * Request cancellation of account | ||
60 | * Turn on/off charity donation | ||
![]() |
74.1 | 61 | * Set behaviour of recurring payments |
![]() |
64.2 | 62 | |
![]() |
56.1 | 63 | === Requesting details of a specific account === |
64 | |||
![]() |
88.1 | 65 | (% contenteditable="false" tabindex="-1" %) |
66 | ((( | ||
![]() |
89.1 | 67 | {{code language="http" title="**Request**"}} |
![]() |
90.1 | 68 | GET /ledger/credit-account/v1/XXX/accounts/NNN HTTP/1.1 Host: - Authorization: Bearer <Token> Content-Type: application/json |
![]() |
89.1 | 69 | {{/code}} |
![]() |
88.1 | 70 | ))) |
![]() |
50.2 | 71 | |
![]() |
88.1 | 72 | (% contenteditable="false" tabindex="-1" %) |
73 | ((( | ||
![]() |
89.1 | 74 | {{code language="http" title="**Response**"}} |
![]() |
90.1 | 75 | HTTP/1.1 200 OK Content-Type: application/json { "@id": "/ledger/credit-account/v1/XXX/accounts/NNN", "accountNo": "1234567", "startDate": "2018-05-21", "description": null, "accountProfileType": "accountType1 | accountType2 | accountType3 etc.", "accountAlias" : "accountAlias1 | accountAlias2 etc.", "customerNo" : "123789654", "status" : "open | pending-close | closed", "creditLimit": 2000.00, "totalBalance" : -1900.0, "reservedAmount": 50.0, "availableAmount": 50.0, "openBill" : "/ledger/credit-account/v1/XXX/accounts/NNN/bills/reminder-456", "charityDonation": true, "interestRate": { "debtInterest" : 10.00, "penaltyInterest": 15.00 }, "bankPayment": { "bankAccountNo": "123", "bankAccountType": "BGSE", "bic": "123456", "iban": "SE12345678945631", "paymentReference": "54867165675646" }, "activePaymentOrders": "/ledger/credit-account/v1/XXX/accounts/NNN/active-payment-orders", "recurringPaymentConsent": "/ledger/credit-account/v1/XXX/accounts/NNN/recurring-payment-setting", "cards": "/ledger/credit-account/v1/XXX/accounts/123456/cards", "transactions": "/ledger/credit-account/v1/XXX/accounts/NNN/transactions", "currency": "sek", "bills": "/ledger/credit-account/v1/XXX/accounts/NNN/bills", "customer": "/ledger/customers/v1/XXX/customer/123456", "operation" : [ { "rel" : "add-card-info", "method" : "post", "href" : "/ledger/credit-account/v1/XXX/accounts/NNN/cards" }, { "rel" : "request-close-account", "method" : "post", "href" : "/ledger/credit-account/v1/XXX/accounts/NNN/request-close-account" }, { "rel" : "apply-for-raised-credit-limit", "method" : "post", "href" : "/ledger/credit-account-onboardings/v1/XXX/accounts/NNN/apply-for-raised-credit-limit" }, { "rel" : "partial-update", "method" : "patch", "href" : "/ledger/credit-account-onboardings/v1/XXX/accounts/NNN" } ] } |
![]() |
89.1 | 76 | {{/code}} |
![]() |
88.1 | 77 | ))) |
![]() |
3.1 | 78 | |
![]() |
12.2 | 79 | **Resource properties** |
![]() |
3.1 | 80 | |
![]() |
15.1 | 81 | (% class="table-bordered table-striped" %) |
![]() |
60.2 | 82 | |=(% style="width: 215px;" %)Property|=(% style="width: 114px;" %)Data type|=(% style="width: 161px;" %)Format|=(% style="width: 61px;" %)Modify (patch)|=(% style="width: 877px;" %)Description |
83 | |(% style="width:215px" %)@id |(% style="width:114px" %)string|(% style="width:161px" %)Maxlength: |(% style="width:61px" %) |(% style="width:877px" %)Uri of the specific account | ||
84 | |(% style="width:215px" %)accountNo |(% style="width:114px" %)string|(% style="width:161px" %)Maxlength: 50|(% style="width:61px" %) |(% style="width:877px" %)The identifier of the account | ||
85 | |(% 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 | ||
86 | |(% 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 | ||
87 | |(% 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// | ||
88 | |(% 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// | ||
89 | |(% 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) | ||
90 | |(% style="width:215px" %)status |(% style="width:114px" %)string|(% style="width:161px" %)Maxlength: 25|(% style="width:61px" %) |(% style="width:877px" %)Status of the account((( | ||
![]() |
33.1 | 91 | * **pending-close**: the customer has requested the account to be closed, the account will be closed when possible. |
92 | * **open**: the account is open and active | ||
93 | * **closed**: the account has been closed | ||
94 | ))) | ||
![]() |
60.2 | 95 | |(% 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 |
96 | |(% 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.) | ||
97 | |(% 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) | ||
98 | |(% 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) | ||
![]() |
87.2 | 99 | |(% style="width:215px" %)openBill|(% style="width:114px" %)string|(% style="width:161px" %)Uri|(% style="width:61px" %) |(% style="width:877px" %) |
![]() |
60.2 | 100 | |(% 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 |
101 | |(% style="width:215px" %)interestRate.debtInterest|(% style="width:114px" %)decimal|(% style="width:161px" %)Percentage|(% style="width:61px" %) |(% style="width:877px" %)yearly debt interestrate | ||
102 | |(% style="width:215px" %)interestRate.penaltyInterest|(% style="width:114px" %)decimal|(% style="width:161px" %)Percentage|(% style="width:61px" %) |(% style="width:877px" %)yearly penalty interestrate | ||
103 | |(% style="width:215px" %)offer |(% style="width:114px" %)string|(% style="width:161px" %)Uri|(% style="width:61px" %) |(% style="width:877px" %) | ||
104 | |(% style="width:215px" %)recurringPaymentConsent|(% style="width:114px" %)string|(% style="width:161px" %)Uri|(% style="width:61px" %) |(% style="width:877px" %) | ||
105 | |(% style="width:215px" %)cards |(% style="width:114px" %)string|(% style="width:161px" %)Uri|(% style="width:61px" %) |(% style="width:877px" %) | ||
106 | |(% style="width:215px" %)transactions |(% style="width:114px" %)string|(% style="width:161px" %)Uri|(% style="width:61px" %) |(% style="width:877px" %) | ||
107 | |(% 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" %) | ||
108 | |(% style="width:215px" %)bills |(% style="width:114px" %)string|(% style="width:161px" %)Uri|(% style="width:61px" %) |(% style="width:877px" %) | ||
109 | |(% style="width:215px" %)customer |(% style="width:114px" %)string|(% style="width:161px" %)Uri|(% style="width:61px" %) |(% style="width:877px" %) | ||
110 | |(% style="width:337px" %)activePaymentOrder.paymentMethod|(% style="width:205px" %)string|(% style="width:208px" %)Maxlength: 15|(% style="width:61px" %)((( | ||
111 | |||
112 | )))|(% style="width:877px" %)((( | ||
113 | PaymentTypes: | ||
![]() |
12.2 | 114 | |
![]() |
60.2 | 115 | * AUTOGIRO |
116 | ))) | ||
117 | |(% 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) | ||
118 | |(% 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 | ||
119 | |(% style="width:215px" %) |(% style="width:114px" %) |(% style="width:161px" %) |(% style="width:61px" %) |(% style="width:877px" %) | ||
120 | |||
![]() |
31.1 | 121 | === Bills === |
![]() |
24.1 | 122 | |
![]() |
56.1 | 123 | The bills resources contains all the documents produced in the accounts billing cycle. |
![]() |
30.1 | 124 | |
![]() |
56.1 | 125 | ==== Requesting list of bills belonging to a specific account ==== |
![]() |
29.1 | 126 | |
![]() |
88.1 | 127 | (% contenteditable="false" tabindex="-1" %) |
128 | ((( | ||
![]() |
89.1 | 129 | {{code language="http" title="**Request**"}} |
![]() |
90.1 | 130 | GET /ledger/credit-account/v1/XXX/accounts/NNN/bills HTTP/1.1 Host: - Authorization: Bearer <Token> Content-Type: application/json |
![]() |
89.1 | 131 | {{/code}} |
![]() |
88.1 | 132 | ))) |
![]() |
3.2 | 133 | |
![]() |
88.1 | 134 | (% contenteditable="false" tabindex="-1" %) |
135 | ((( | ||
![]() |
89.1 | 136 | {{code language="http" title="**Response**"}} |
![]() |
90.1 | 137 | HTTP/1.1 200 OK Content-Type: application/json { "@id": "/ledger/credit-account/v1/501/accounts/NNN/bills?status=open", "items" : [ { "@id": "/ledger/credit-account/v1/XXX/accounts/NNN/bills/reminder-123645", "dueDate": "2018-12-05", "billDate": "2018-11-15", "billNo": "124645", "billAmount": 240.00, "billType" : "reminder", "status": "open", "activePaymentDetails": { "minimumAmountToBePayed": 240.00, "bankAccountNo": "123", "bankAccountType": "BGSE", "bic": "123456", "iban": "SE12345678945631", "paymentReference": "5465164654663", "paymentOrdersExists": true, }, "document": "/ledger/credit-account/v1/XXX/accounts/NNN/bills/reminder-124645/document" }, { "@id": "/ledger/credit-account/v1/XXX/accounts/NNN/bills/reminder-123645", "dueDate": "2018-12-05", "billDate": "2018-11-15", "billNo": "124645", "billAmount": 240.00, "billType" : "bill", "status": "closed", "activePaymentDetails": null, "document": "/ledger/credit-account/v1/XXX/accounts/NNN/bills/reminder-124645/document" }, { "@id": "/ledger/credit-account/v1/XXX/accounts/NNN/bills/bill-123645", "dueDate": "2018-12-05", "billDate": "2018-11-15", "billNo": "124645", "billAmount": 240.00, "billType" : "bill", "status": "closed", "activePaymentDetails": null, "document": "/ledger/credit-account/v1/XXX/accounts/NNN/bills/reminder-124645/document" } ] } |
![]() |
89.1 | 138 | {{/code}} |
![]() |
88.1 | 139 | ))) |
![]() |
3.1 | 140 | |
![]() |
56.1 | 141 | ==== ==== |
![]() |
3.1 | 142 | |
![]() |
56.1 | 143 | ==== Requesting details of a specific bill ==== |
![]() |
3.3 | 144 | |
![]() |
88.1 | 145 | (% contenteditable="false" tabindex="-1" %) |
146 | ((( | ||
![]() |
89.1 | 147 | {{code language="http" title="**Request**"}} |
![]() |
90.1 | 148 | GET /ledger/credit-account/v1/XXX/accounts/NNN/bills/456 HTTP/1.1 Host: - Authorization: Bearer <Token> Content-Type: application/json |
![]() |
89.1 | 149 | {{/code}} |
![]() |
88.1 | 150 | ))) |
![]() |
3.1 | 151 | |
![]() |
88.1 | 152 | (% contenteditable="false" tabindex="-1" %) |
153 | ((( | ||
![]() |
89.1 | 154 | {{code language="http" title="**Response**"}} |
![]() |
90.1 | 155 | HTTP/1.1 200 OK Content-Type: application/json { "@id": "/ledger/credit-account/v1/XXX/accounts/NNN/bills/reminder-123645", "dueDate": "2018-12-05", "billDate": "2018-11-15", "billNo": "124645", "billAmount": 240.00, "billType" : "reminder", "status": "open", "activePaymentDetails": { "minimumAmountToBePayed": 240.00, "bankAccountNo": "123", "bankAccountType": "BGSE", "bic": "123456", "iban": "SE12345678945631", "paymentReference": "5465164654663", "paymentOrdersExists": true, }, "document": "/ledger/credit-account/v1/XXX/accounts/NNN/bills/reminder-124645/document" } |
![]() |
89.1 | 156 | {{/code}} |
![]() |
88.1 | 157 | ))) |
![]() |
3.1 | 158 | |
![]() |
12.2 | 159 | == == |
160 | |||
![]() |
14.1 | 161 | (% class="table-bordered table-striped" %) |
![]() |
26.1 | 162 | |=(% style="width: 337px;" %)Property|=(% style="width: 205px;" %)Data type|=(% style="width: 208px;" %)Format|=(% style="width: 621px;" %)Description |
![]() |
43.1 | 163 | |(% style="width:337px" %)@id|(% style="width:205px" %)string|(% style="width:208px" %)Uri|(% style="width:621px" %) |
![]() |
36.2 | 164 | |(% 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" %) |
![]() |
64.3 | 165 | |(% style="width:337px" %)billDate|(% style="width:205px" %)date|(% style="width:208px" %) |(% style="width:621px" %)Date when bill was created |
![]() |
33.5 | 166 | |(% style="width:337px" %)billNo|(% style="width:205px" %)string|(% style="width:208px" %)Maxlength: 50|(% style="width:621px" %)The identifier of the bill |
![]() |
59.1 | 167 | |(% style="width:337px" %)billAmount|(% style="width:205px" %)decimal|(% style="width:208px" %) |(% style="width:621px" %)the amount that is stated on the actual bill/document |
![]() |
33.6 | 168 | |(% style="width:337px" %)billType|(% style="width:205px" %)string|(% style="width:208px" %)Maxlength: 25|(% style="width:621px" %)((( |
169 | BillTypes: | ||
170 | |||
171 | * Bill | ||
172 | * Reminder1 | ||
173 | * Reminder2 | ||
174 | * Collection | ||
175 | ))) | ||
![]() |
60.2 | 176 | |(% style="width:337px" %)status|(% style="width:205px" %)string|(% style="width:208px" %) |(% style="width:621px" %)"open" / "closed" |
177 | |(% style="width:337px" %)activePaymentDetails|(% style="width:205px" %)object|(% style="width:208px" %) |(% style="width:621px" %)only set if status of bill is "open" | ||
![]() |
64.3 | 178 | |(% style="width:337px" %)activePaymentDetails.minimumAmountToBePayed|(% style="width:205px" %)decimal|(% style="width:208px" %) |(% style="width:621px" %)The least amount to pay on the bill |
179 | |(% style="width:337px" %)activePaymentDetails.bankAccountNo|(% style="width:205px" %)string|(% style="width:208px" %)Maxlength: 15|(% style="width:621px" %)bankaccount for payment | ||
![]() |
60.2 | 180 | |(% style="width:337px" %)activePaymentDetails.bankAccountType|(% style="width:205px" %)string|(% style="width:208px" %)Maxlength: 10|(% style="width:621px" %)BankAccountTypes:((( |
![]() |
33.6 | 181 | * BKSE (swedish bankaccount) |
182 | * PKSE (swedish plusgiro) | ||
183 | * BGSE (swedish bankgiro) | ||
184 | * PGSE (swedish plusgiro OCR) | ||
185 | ))) | ||
![]() |
64.3 | 186 | |(% style="width:337px" %)activePaymentDetails.bic|(% style="width:205px" %)string|(% style="width:208px" %)Maxlength: 11|(% style="width:621px" %)Bank Identifier Code (BIC) |
187 | |(% style="width:337px" %)activePaymentDetails.iban|(% style="width:205px" %)string|(% style="width:208px" %)Maxlength: 34|(% style="width:621px" %)International Bank Account Number (IBAN) | ||
188 | |(% style="width:337px" %)activePaymentDetails.paymentReference|(% style="width:205px" %)string|(% style="width:208px" %)Maxlength: 50|(% style="width:621px" %)reference to specify on the payment | ||
189 | |(% 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". | ||
190 | //More detailed information about the payment order can be found on the accounts resource// | ||
191 | |(% style="width:337px" %)document|(% style="width:205px" %)string|(% style="width:208px" %)Url|(% style="width:621px" %)Url to download pdf document | ||
![]() |
33.8 | 192 | |
![]() |
31.1 | 193 | === === |
![]() |
3.1 | 194 | |
![]() |
83.1 | 195 | === recurring-payment-setting === |
![]() |
56.1 | 196 | |
![]() |
80.1 | 197 | (% class="wikigeneratedid" %) |
![]() |
64.3 | 198 | This resource contain information/settings related to how recurring payments should behave on this account. |
![]() |
56.1 | 199 | |
![]() |
80.1 | 200 | ===== |
201 | Requesting the resource ===== | ||
202 | |||
![]() |
88.1 | 203 | (% contenteditable="false" tabindex="-1" %) |
204 | ((( | ||
![]() |
89.1 | 205 | {{code language="http" title="**Request**"}} |
![]() |
90.1 | 206 | GET /ledger/credit-account/v1/XXX/accounts/NNN/recurring-payment-setting/ HTTP/1.1 Host: - Authorization: Bearer <Token> Content-Type: application/json |
![]() |
89.1 | 207 | {{/code}} |
![]() |
88.1 | 208 | ))) |
![]() |
48.1 | 209 | |
![]() |
88.1 | 210 | (% contenteditable="false" tabindex="-1" %) |
211 | ((( | ||
![]() |
89.1 | 212 | {{code language="http" title="**Response**"}} |
![]() |
90.1 | 213 | HTTP/1.1 200 OK Content-Type: application/json { "@id" : "/ledger/credit-account/v1/XXX/accounts/NNN/recurring-payment-setting", "recurringPaymentMethod" : "autogiro", "recurringPaymentScope" : "fixedRecurring", "fixedRecurringAmount" : 1500.00, "parentHREF": "/ledger/credit-account/v1/XXX/accounts/NNN", "operation" : [ { "rel" : "partially-update-recurring-payment-consent", "method" : "patch", "href" : "/ledger/credit-account/v1/XXX/accounts/NNN/recurring-payment-consent" } ] } |
![]() |
89.1 | 214 | {{/code}} |
![]() |
88.1 | 215 | ))) |
![]() |
48.1 | 216 | |
![]() |
80.1 | 217 | ===== Update settings ===== |
![]() |
48.1 | 218 | |
![]() |
80.1 | 219 | (% class="wikigeneratedid" %) |
220 | Execute http patch towards this resource to change how recurring payments should behave on the specified account | ||
221 | |||
![]() |
88.1 | 222 | (% contenteditable="false" tabindex="-1" %) |
223 | ((( | ||
![]() |
89.1 | 224 | {{code language="http" title="**Request**"}} |
![]() |
90.1 | 225 | PATCH /ledger/credit-account/v1/XXX/accounts/NNN/recurring-payment-setting HTTP/1.1 Host: - Authorization: Bearer <Token> Content-Type: application/json { "recurringPaymentScope" : "billedAmount", "fixedRecurringAmount" : 0.00 } |
![]() |
89.1 | 226 | {{/code}} |
![]() |
88.1 | 227 | ))) |
![]() |
80.1 | 228 | |
![]() |
14.1 | 229 | (% class="table-bordered table-striped" %) |
![]() |
44.1 | 230 | |=(% style="width: 337px;" %)Property|=(% style="width: 205px;" %)Data type|=(% style="width: 208px;" %)Format|=(% style="width: 58px;" %)Modify (patch)|=(% style="width: 1176px;" %)Description |
![]() |
64.2 | 231 | |(% style="width:337px" %)recurringPaymentMethod|(% style="width:205px" %)string|(% style="width:208px" %) |(% style="background-color:palegreen; width:58px" %) |(% style="width:1176px" %)recurringPaymentMethods:((( |
232 | * autogiro | ||
233 | ))) | ||
234 | |(% style="width:337px" %)recurringPaymentScope|(% style="width:205px" %)string|(% style="width:208px" %) |(% style="background-color:palegreen; width:58px" %) |(% style="width:1176px" %)((( | ||
235 | recurringPaymentScopes: | ||
![]() |
33.8 | 236 | |
![]() |
64.2 | 237 | * fixedRecurring (Fixed amount to debit monthly) |
![]() |
33.8 | 238 | * totalDebt (Total credit-account debt will be debited) |
239 | * billedAmount (Only the minimum amount to pay will be debited) | ||
240 | ))) | ||
![]() |
64.2 | 241 | |(% style="width:337px" %)fixedRecurringAmount|(% 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") |
![]() |
12.2 | 242 | |
![]() |
31.1 | 243 | === Cards === |
![]() |
3.1 | 244 | |
![]() |
80.1 | 245 | ==== Post ==== |
![]() |
3.1 | 246 | |
![]() |
80.1 | 247 | Execute http post towards this resource to add a new card to the specified account |
248 | |||
![]() |
88.1 | 249 | (% contenteditable="false" tabindex="-1" %) |
250 | ((( | ||
![]() |
89.1 | 251 | {{code language="http" title="**Request**"}} |
![]() |
90.1 | 252 | POST /ledger/credit-account/v1/XXX/accounts/NNN/cards HTTP/1.1 Host: - Authorization: Bearer <Token> Content-Type: application/json { "token": "954c8699-b38f-47a2-b568-668b8837dad8", "PanTrunc": "85479*********648", "deleted" : false, "mainCard": true, "cardHolder" : { "number" : "123465", "name": "test testsson", "nationalConsumerIdentifier": { "value": "19101010-1010", "countryCode": "SE" } } } |
![]() |
89.1 | 253 | {{/code}} |
![]() |
88.1 | 254 | ))) |
![]() |
4.1 | 255 | |
![]() |
79.1 | 256 | ==== List cards ==== |
257 | |||
![]() |
88.1 | 258 | (% contenteditable="false" tabindex="-1" %) |
259 | ((( | ||
![]() |
89.1 | 260 | {{code language="http" title="**Request**"}} |
![]() |
90.1 | 261 | GET /ledger/credit-account/v1/XXX/accounts/NNN/cards HTTP/1.1 Host: - Authorization: Bearer <Token> Content-Type: application/json |
![]() |
89.1 | 262 | {{/code}} |
![]() |
88.1 | 263 | ))) |
![]() |
79.1 | 264 | |
![]() |
88.1 | 265 | (% contenteditable="false" tabindex="-1" %) |
266 | ((( | ||
![]() |
89.1 | 267 | {{code language="http" title="**Response**"}} |
![]() |
90.1 | 268 | HTTP/1.1 200 OK Content-Type: application/json { "operations": null, "items": [ { "token": "954c8699-b38f-47a2-b568-668b8837dad8", "PanTrunc": "85479*********648", "deleted" : false, "mainCard": true, "cardHolder" : { "number" : "123465", "name": "test testsson", "nationalConsumerIdentifier": { "value": "19101010-1010", "countryCode": "SE" } }, "@id": "/ledger/credit-account/v1/XXX/accounts/NNN/cards/741" }, { "token": "274c8699-b38f-47a2-b568-668b8837dat7", "PanTrunc": "78979*********321", "deleted" : false, "mainCard": false, "cardHolder" : { "number" : "987654", "name": "test testsson", "nationalConsumerIdentifier": { "value": "19101010-1010", "countryCode": "SE" } }, "@id": "/ledger/credit-account/v1/XXX/accounts/NNN/cards/274c8699-b38f-47a2-b568-668b8837dat7" } ], "@id": "/ledger/credit-account/v1/XXX/accounts/NNN/cards", "view": { "@id": "/ledger/credit-account/v1/XXX/accounts/NNN/cards?$top=2&$skip=0", "next": "/ledger/credit-account/v1/XXX/accounts/NNN/cards?$top=2&$skip=2" } } |
![]() |
89.1 | 269 | {{/code}} |
![]() |
88.1 | 270 | ))) |
![]() |
3.1 | 271 | |
![]() |
46.1 | 272 | ==== Get ==== |
![]() |
4.1 | 273 | |
![]() |
88.1 | 274 | (% contenteditable="false" tabindex="-1" %) |
275 | ((( | ||
![]() |
89.1 | 276 | {{code language="http" title="**Response**"}} |
![]() |
90.1 | 277 | HTTP/1.1 200 OK Content-Type: application/json { "token": "954c8699-b38f-47a2-b568-668b8837dad8", "PanTrunc": "85479*********648", "deleted" : false, "mainCard": true, "cardHolder" : { "number" : "123465", "name": "test testsson", "nationalConsumerIdentifier": { "value": "19101010-1010", "countryCode": "SE" } }, "@id": "/ledger/credit-account/v1/XXX/accounts/NNN/cards/954c8699-b38f-47a2-b568-668b8837dad8", "parentHREF": "/ledger/credit-account/v1/XXX/accounts/NNN", "operation" : [ { "rel" : "partial-update", "method" : "patch", "href" : "/ledger/credit-account/v1/XXX/accounts/NNN/cards/954c8699-b38f-47a2-b568-668b8837dad8" } ] } |
![]() |
89.1 | 278 | {{/code}} |
![]() |
88.1 | 279 | ))) |
![]() |
3.1 | 280 | |
![]() |
14.1 | 281 | (% class="table-bordered table-striped" %) |
![]() |
45.1 | 282 | |=(% style="width: 337px;" %)Property|=(% style="width: 205px;" %)Data type|=(% style="width: 208px;" %)Format|=(% style="width: 62px;" %)Modify (patch)|=(% style="width: 1401px;" %)Description |
283 | |(% style="width:337px" %)token|(% style="width:205px" %)string|(% style="width:208px" %) |(% style="width:62px" %) |(% style="width:1401px" %)token identifier of the card | ||
284 | |(% style="width:337px" %)panTrunc|(% style="width:205px" %)string|(% style="width:208px" %) |(% style="width:62px" %) |(% style="width:1401px" %)truncated PAN | ||
![]() |
64.3 | 285 | |(% 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 |
![]() |
45.1 | 286 | |(% 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) |
287 | |(% style="width:337px" %)cardHolder.number|(% style="width:205px" %)string|(% style="width:208px" %) |(% style="width:62px" %) |(% style="width:1401px" %)Cardholder customernumber | ||
288 | |(% style="width:337px" %)cardHolder.name|(% style="width:205px" %)string|(% style="width:208px" %) |(% style="width:62px" %) |(% style="width:1401px" %)Cardholder fullname | ||
289 | |(% style="width:337px" %)cardHolder.nationalConsumerIdentifier.value|(% style="width:205px" %)string|(% style="width:208px" %)YYYYMMDD-NNNC|(% style="width:62px" %) |(% style="width:1401px" %) | ||
290 | |(% 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" %) | ||
![]() |
12.2 | 291 | |
![]() |
31.1 | 292 | === Transactions === |
![]() |
3.1 | 293 | |
![]() |
88.1 | 294 | (% contenteditable="false" tabindex="-1" %) |
295 | ((( | ||
![]() |
89.1 | 296 | {{code language="http" title="**Request**"}} |
![]() |
90.1 | 297 | GET /ledger/credit-account/v1/XXX/accounts/NNN/transactions HTTP/1.1 Host: - Authorization: Bearer <Token> Content-Type: application/json |
![]() |
89.1 | 298 | {{/code}} |
![]() |
88.1 | 299 | ))) |
![]() |
7.1 | 300 | |
![]() |
88.1 | 301 | (% contenteditable="false" tabindex="-1" %) |
302 | ((( | ||
![]() |
89.1 | 303 | {{code language="http" title="**Response**"}} |
![]() |
90.1 | 304 | HTTP/1.1 200 OK Content-Type: application/json { "operations": null, "items": [ { "type": "payment", "description": "", "amount": 200.00, "billed": false|true, "date": "2019-10-09", "reserveDate": null }, { "type": "purchase", "description": "testbutiken, köpref. 12345689", "amount": 200.00, "billed": false|true, "date": "2019-10-09", "reserveDate": "2019-10-05", }, { "type": "credit", "description": "", "amount": 200.00, "billed": false|true, "date": "2019-10-09", "reserveDate": "2019-10-05" } ], "@id": "/ledger/credit-account/v1/XXX/accounts/NNN/transactions?fromDate=2019-10-01", "view": { "@id": "/ledger/credit-account/v1/XXX/accounts/NNN/transactions?fromDate=2019-10-01&$top=2&$skip=0", "next": "/ledger/credit-account/v1/XXX/accounts/NNN/transactions?fromDate=2019-10-01&$top=2&$skip=2" } } |
![]() |
89.1 | 305 | {{/code}} |
![]() |
88.1 | 306 | ))) |
![]() |
7.1 | 307 | |
![]() |
16.1 | 308 | (% class="table-bordered table-striped" %) |
![]() |
26.1 | 309 | |=(% style="width: 337px;" %)Property|=(% style="width: 205px;" %)Data type|=(% style="width: 208px;" %)Format|=(% style="width: 621px;" %)Description |
![]() |
64.3 | 310 | |(% style="width:337px" %)type|(% style="width:205px" %)string|(% style="width:208px" %) |(% style="width:621px" %)((( |
311 | Type of transaction | ||
312 | |||
313 | * Payment | ||
314 | * Purchase | ||
315 | * Credit | ||
316 | ))) | ||
317 | |(% 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" | ||
![]() |
26.1 | 318 | |(% style="width:337px" %)amount|(% style="width:205px" %)decimal|(% style="width:208px" %) |(% style="width:621px" %) |
![]() |
33.12 | 319 | |(% style="width:337px" %)billed|(% style="width:205px" %)bool|(% style="width:208px" %) |(% style="width:621px" %)Indicates wheter a bill has been created after the transaction (ie. if the transaction is included in any bill or not) |
![]() |
64.3 | 320 | |(% style="width:337px" %)date|(% style="width:205px" %)date|(% style="width:208px" %) |(% style="width:621px" %)//Valuedate// |
![]() |
12.2 | 321 | |
![]() |
31.1 | 322 | === Reservations === |
![]() |
7.1 | 323 | |
![]() |
88.1 | 324 | (% contenteditable="false" tabindex="-1" %) |
325 | ((( | ||
![]() |
89.1 | 326 | {{code language="http" title="**Request**"}} |
![]() |
90.1 | 327 | GET /ledger/credit-account/v1/XXX/accounts/NNN/reservations HTTP/1.1 Host: - Authorization: Bearer <Token> Content-Type: application/json |
![]() |
89.1 | 328 | {{/code}} |
![]() |
88.1 | 329 | ))) |
![]() |
7.1 | 330 | |
![]() |
88.1 | 331 | (% contenteditable="false" tabindex="-1" %) |
332 | ((( | ||
![]() |
89.1 | 333 | {{code language="http" title="**Response**"}} |
![]() |
90.1 | 334 | HTTP/1.1 201 Created Content-Type: application/json { "operations": null, "items": [ { "amount": 200.00, "description" : "", "date": "2019-10-05", }, { "amount": 450.00, "description" : "", "date": "2019-10-02", }, ], "@id": "/ledger/credit-account/v1/XXX/accounts/NNN/reservations", } |
![]() |
89.1 | 335 | {{/code}} |
![]() |
88.1 | 336 | ))) |
![]() |
7.1 | 337 | |
![]() |
14.1 | 338 | (% class="table-bordered table-striped" %) |
![]() |
26.1 | 339 | |=(% style="width: 337px;" %)Property|=(% style="width: 205px;" %)Data type|=(% style="width: 208px;" %)Format|=(% style="width: 621px;" %)Description |
340 | |(% style="width:337px" %)amount|(% style="width:205px" %)decimal|(% style="width:208px" %) |(% style="width:621px" %) | ||
![]() |
65.1 | 341 | |(% style="width:337px" %)description|(% style="width:205px" %)string|(% style="width:208px" %) |(% style="width:621px" %)Description of the reservation, normally "point of sale". |
342 | |(% style="width:337px" %)date|(% style="width:205px" %)date|(% style="width:208px" %) |(% style="width:621px" %)Date when the reservation occured | ||
![]() |
26.1 | 343 | Problems |
344 | If an error occur or any validation failed, a "problem" response will be returned. | ||
345 | Below is a list of problems that can occur: | ||
346 | **HttpStatus 401 Unauthorized** | ||
![]() |
3.1 | 347 | |
![]() |
26.1 | 348 | * Token expired |
349 | * Token invalid | ||
350 | * SellerNumber does not match token | ||
351 | * CompanyNumber does not match token | ||
352 | **HttpStatus 400 Error** | ||
353 | * Validation: Argument required | ||
354 | * Validation: Invalid value | ||
355 | **HttpStatus 422 Unprocessable entity** | ||
356 | * Authorization declined | ||
357 | **HttpStatus 409 Conflict** | ||
358 | * Invoice already authorized | ||
359 | * Duplicate InvoiceNumber | ||
360 | * Authorization is cancelled | ||
361 | * Authorization already captured | ||
362 | * Authorization has expired | ||
363 | * Insufficient debited amount XXX | ||
364 | **HttpStatus 501 NotImplemented** | ||
365 | * CompanyNumber XXX not configured | ||
366 | * SellerNumber XXX not configured at PayEx | ||
367 | * CompanyNumber XXX missing configuration | ||
368 | **HttpStatus 404 NotFound** | ||
369 | * Authorization not found | ||
![]() |
90.1 | 370 | Below is an example of a problem that will be returned if buyer##.nationalConsumerIdentifier.value## is not valid in the authorization post request.(% contenteditable="false" tabindex="-1" %) |
![]() |
88.1 | 371 | ((( |
![]() |
89.1 | 372 | {{code language="http" title="**Response**"}} |
![]() |
90.1 | 373 | HTTP/1.1 400 Error Content-Type: application/problem+json { "Type": "http://[DNS]/ledger/invoice-purchase/problems/validation", "Title": "A validation error occurred", "Status": 400, "Instance": null, "Detail": "A validation error occurred. Please fix the problems mentioned in the 'problems' property below.", "Problems": [ { "buyer.nationalConsumerIdentifier.value": "Not a valid SE nationalConsumerIdentifier" } ] } |
![]() |
89.1 | 374 | {{/code}} |
![]() |
88.1 | 375 | ))) |