summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorms <ms@taler.net>2021-10-13 15:44:37 +0200
committerms <ms@taler.net>2021-10-13 15:45:35 +0200
commit8dfb40658a42190751af6b480635683228fc103b (patch)
tree8c144958111a057a437bed170350c7f8856ec169
parentef1e5ceef6232c283b51ccc33d2431bb8cd9b253 (diff)
downloaddocs-8dfb40658a42190751af6b480635683228fc103b.tar.gz
docs-8dfb40658a42190751af6b480635683228fc103b.tar.bz2
docs-8dfb40658a42190751af6b480635683228fc103b.zip
Sandbox API.
Drafting endpoints for future versions.
-rw-r--r--libeufin/api-sandbox.rst109
1 files changed, 107 insertions, 2 deletions
diff --git a/libeufin/api-sandbox.rst b/libeufin/api-sandbox.rst
index 40456f15..2d385df4 100644
--- a/libeufin/api-sandbox.rst
+++ b/libeufin/api-sandbox.rst
@@ -2,8 +2,32 @@
.. _sandbox-api:
-Sandbox API
-###########
+Resources.
+##########
+
+Sandbox serves the following resources:
+
+ - Demobanks.
+ - Bank accounts.
+ - Subscribers.
+ - Transactions.
+ - Customers.
+ - Reports.
+
+Such resources are subject to all CRUD operations through
+two main trunks: ``/admin`` and ``/demobanks``.
+
+the admin trunk has total rights on all of them, whereas the
+``/demobank`` can only reach as far as a bank customer is allowed
+to. For example, under the admin trunk will be possible to create
+and/or delete a new demobank (with its own configuration values),
+but that'll be forbidden under the demobank trunk.
+
+Hence typically, the admin trunk has all the accesses protected
+by a access token.
+
+Current Sandbox API
+###################
..
Current Sandbox endpoints.
@@ -276,3 +300,84 @@ Camt.
**Response**
The expected Camt.053 document.
+
+Future Sandbox API
+##################
+
+.. note::
+
+ ``POST``-ing to a endpoint with a trailing ``$id`` means
+ modification of a existing resource.
+
+Demobanks
+^^^^^^^^^
+
+Demobanks contain bank accounts, and are configurable.
+
+.. http:get:: /admin/demobanks
+.. http:get:: /admin/demobanks/$id
+.. http:post:: /admin/demobanks
+.. http:post:: /admin/demobanks/$id
+.. http:delete:: /admin/demobanks/$id
+
+Bank accounts.
+^^^^^^^^^^^^^^
+
+Bank accounts collect money of users and participate
+in transactions.
+
+.. http:get:: $base/bankaccounts
+.. http:get:: $base/bankaccounts/$id
+.. http:post:: $base/bankaccounts
+.. http:post:: $base/bankaccounts/$id
+.. http:delete:: $base/bankaccounts/$id
+
+Subscribers.
+^^^^^^^^^^^^
+
+Subscribers are (optional) customers identities for protocols
+other than the native one.
+
+.. http:get:: $base/subscribers
+.. http:get:: $base/subscribers/$id
+.. http:post:: $base/subscribers
+.. http:post:: $base/subscribers/$id
+.. http:delete:: $base/subscribers/$id
+
+Transactions.
+^^^^^^^^^^^^^
+
+Transactions are money movements between bank accounts.
+
+.. http:get:: $base/transactions
+.. http:get:: $base/transactions/$id
+.. http:post:: $base/transactions
+.. http:post:: $base/transactions/$id
+.. http:delete:: $base/transactions/$id
+
+.. note::
+ A "history" endpoint can be implemented by providing
+ some filtering parameters to the first GET call.
+
+Customers.
+^^^^^^^^^^
+
+Customers are persons with at least one bank account.
+
+.. http:get:: $base/customers
+.. http:get:: $base/customers/$id
+.. http:post:: $base/customers
+.. http:post:: $base/customers/$id
+.. http:delete:: $base/customers/$id
+
+Reports.
+^^^^^^^^
+
+Reports are persistent documents witnessing transactions.
+A typical example is a Camt.053 report.
+
+.. http:get:: $base/reports
+.. http:get:: $base/reports/$id
+.. http:post:: $base/reports
+.. http:post:: $base/reports/$id
+.. http:delete:: $base/reports/$id