From version 50.1
edited by David Persson
on 2020/01/08 16:45
To version 50.2
edited by Mikael Widström
on 2020/01/08 17:25
Change comment: There is no comment for this version

Summary

Details

Page properties
Author
... ... @@ -1,1 +1,1 @@
1 -xwiki:XWiki.dap
1 +xwiki:XWiki.mak
Content
... ... @@ -8,7 +8,34 @@
8 8  
9 9  == Accounts ==
10 10  
11 +The **accounts** resource located under **ledger/credit-account/v1/ **api**. **The accounts- and its sub-resources are used to created, read and modify information related to a credit-account.
11 11  
13 +The resources follows rest-full patterns including hyper-media links.
14 +
15 +//Basic resources uses the common HTTP patterns for GET, POST, PUT, PATCH, DELETE.//
16 +
17 +* Requests __**without**__ specific resource identifier - f.ex. /ledger/credit-account/v1/XXX/accounts
18 +** HTTP GET - Returns a list of resources
19 +** HTTP POST - Creates a new resource
20 +* Requests __**with**__ specific //__resource identifier__// - f.ex. /ledger/credit-account/v1/XXX/accounts///__1234568__//
21 +** HTTP GET - Returns a specific resource
22 +** HTTP PUT - Updates a specific resource
23 +** HTTP PATCH - Partially updates a specific resource
24 +** HTTP DELETE - Deletes a specific resource
25 +
26 +//Functions that cannot be mapped directly to resources are called "Operation Resources" they only support HTTP POST//.
27 +
28 +* Requests __**without**__ specific resource identifier operates on the list
29 +** HTTP POST - f.ex. /ledger/credit-account/v1/XXX/accounts/generate-summary - Generates a summary
30 +* Requests __**with**__ specific resource identifier operates on a resource
31 +** HTTP POST - f.ex. /ledger/credit-account/v1/XXX/accounts/1234568/initiates-termination - Starts termination of an account
32 +
33 +
34 +The resources follows hyper-media & backend-for-frontend principles to impose business rules and reduce duplication of business logic.
35 +
36 +
37 +
38 +
12 12  {{code language="http" title="**Request**"}}
13 13  GET /ledger/credit-account/v1/XXX/accounts HTTP/1.1
14 14  Host: -
... ... @@ -16,6 +16,8 @@
16 16  Content-Type: application/json
17 17  {{/code}}
18 18  
46 +
47 +
19 19  If the authorization post succeeds, or if a ##get## method is performed to retrieve an existing authorization, it should respond with something like the following:
20 20  
21 21  {{code language="http" title="**Response**"}}
... ... @@ -32,12 +32,12 @@
32 32   "customerNo" : "123789654",
33 33   "status" : "open | pending-close | closed",
34 34   "creditLimit": 2000.00,
35 - "totalBalance" : -1900.0,
64 + "balance" : -1900.0,
36 36   "reservedAmount": 50.0,
37 37   "availableAmount": 50.0,
38 38   "openBill" : {
39 39   "amountToBePayed" : 250.0,
40 - "@id" : "/ledger/credit-account/v1/501/accounts/123456/bills/963",
69 + "bill" : "/ledger/credit-account/v1/501/accounts/123456/bills/963",
41 41   "dueDate" : "2019-12-10",
42 42   "billType" : "Bill"
43 43   },
... ... @@ -106,11 +106,13 @@
106 106  * **closed**: the account has been closed
107 107  )))
108 108  |(% style="width:215px" %)creditLimit |(% style="width:114px" %)decimal|(% style="width:161px" %) |(% style="background-color:palegreen; width:112px" %) |(% style="width:1039px" %)The creditlimit of the account, support patch operation but only lower
109 -|(% style="width:215px" %)totalBalance|(% style="width:114px" %)decimal|(% style="width:161px" %) |(% style="width:112px" %) |(% style="width:1039px" %)**INTERN KOMMENTAR-** total aktuell summa av alla balanser på BillingAcc (Negtiv om skuld) **-INTERN KOMMENTAR**
138 +|(% style="width:215px" %)unpaidBilledAmount |(% style="width:114px" %)decimal|(% style="width:161px" %) |(% style="width:112px" %) |(% style="width:1039px" %)**INTERN KOMMENTAR-** total aktuell summa av alla balanser på BillingAcc (endast om negativ/skuld, annars 0) **-INTERN KOMMENTAR**
139 +|(% style="width:215px" %)debt |(% style="width:114px" %)decimal|(% style="width:161px" %) |(% style="width:112px" %) |(% style="width:1039px" %)**INTERN KOMMENTAR- **total aktuell summa av alla balanser (kapital/ränta/avgifter osv.) på BillingAcc + underliggande CredAccs, OM NEGATIV (skuld) **-INTERN KOMMENTAR**
140 +|(% style="width:215px" %)surplus |(% style="width:114px" %)decimal|(% style="width:161px" %) |(% style="width:112px" %) |(% style="width:1039px" %)**INTERN KOMMENTAR- **total aktuell summa av alla balanser (kapital/ränta/avgifter osv.) på BillingAcc + underliggande CredAccs, OM POSITIV (tillgodo) **-INTERN KOMMENTAR**
110 110  |(% style="width:215px" %)reservedAmount |(% style="width:114px" %)decimal|(% style="width:161px" %) |(% style="width:112px" %) |(% style="width:1039px" %)**INTERN KOMMENTAR- **Summerat belopp på alla utestående reservationer mot kontot (som är giltiga och ej captured) **-INTERN KOMMENTAR**
111 111  |(% style="width:215px" %)availableAmount |(% style="width:114px" %)decimal|(% style="width:161px" %) |(% style="width:112px" %) |(% style="width:1039px" %)**INTERN KOMMENTAR- **Tillgänglig kredit (kan ej räknas fram utifrån ovan belopp då avgifter kan ingå där, som inte påverkar tillgänglig kredit) **-INTERN KOMMENTAR**
112 -|(% style="width:215px" %)openBill.amountToBePayed|(% style="width:114px" %)decimal|(% style="width:161px" %) |(% style="width:112px" %) |(% style="width:1039px" %)The minimum amount to pay on the currently open bill
113 -|(% style="width:215px" %)openBill.@id|(% style="width:114px" %)string|(% style="width:161px" %)Uri|(% style="width:112px" %) |(% style="width:1039px" %)url to bill resource
143 +|(% style="width:215px" %)openBill.amount |(% style="width:114px" %)decimal|(% style="width:161px" %) |(% style="width:112px" %) |(% style="width:1039px" %)The minimum amount to pay on the currently open bill
144 +|(% style="width:215px" %)openBill.bill |(% style="width:114px" %)string|(% style="width:161px" %)Uri|(% style="width:112px" %) |(% style="width:1039px" %)
114 114  |(% style="width:215px" %)openBill.dueDate |(% 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:112px" %) |(% style="width:1039px" %)
115 115  |(% style="width:215px" %)openBill.billType |(% style="width:114px" %)string|(% style="width:161px" %)Maxlength: 25|(% style="width:112px" %) |(% style="width:1039px" %)(((
116 116  BillTypes:

Tips

You can click on the arrows next to the breadcrumb elements to quickly navigate to sibling and children pages.

Need help?

If you need help with XWiki you can contact: