summaryrefslogtreecommitdiff
path: root/manpages/libeufin-cli.1.rst
blob: 0d1750e3341397b71850bfbb91736fe0e68b9624 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
libeufin-cli(1)
###############

.. only:: html

   Name
   ====

   **libeufin-cli** - Interact with LibEuFin Sandbox and Nexus


Synopsis
========

**libeufin-cli**
[**-h** | **--help**]
[**--version**]
COMMAND [ARGS...]

Commands: accounts, connections, facades, permissions, sandbox, users


Description
===========

**libeufin-cli** is the user interface program to interact
with **libeufin-sandbox** and **libeufin-nexus** when they are
operating as HTTP servers, listening on localhost ports.
Normally, you invoke them with their respective ``serve`` commands,
and in a separate shell, use **libeufin-cli** to send requests
and receive responses from them.

The interaction model is as follows:

- (Optionally) Start the sandbox.

- Start the nexus.

- Use **libeufin-cli** to interact with them.
  You can manage users and permissions, bank accounts, "facades",
  transactions, and connections between the various systems.

For **libeufin-cli** to be able to communicate with **libeufin-sandbox**,
the following environment variables need to be set:

``LIBEUFIN_SANDBOX_USERNAME``
  This should normally be ``admin``.

``LIBEUFIN_SANDBOX_PASSWORD``
  This is the same password chosen when the sandbox was started.

``LIBEUFIN_SANDBOX_URL``
  This is ``http://localhost:PORT/``, where ``PORT`` is the
  same port chosen when the sandbox was started.
  This URL can also be specified with the ``--sandbox-url URL``
  option to the ``sandbox`` command (see below).

For **libeufin-cli** to be able to communicate with **libeufin-nexus**,
the following environment variables need to be set:

``LIBEUFIN_NEXUS_USERNAME``
  This is the same username chosen by the nexus ``superuser`` command.

``LIBEUFIN_NEXUS_PASSWORD``
  This is the same username chosen by the nexus ``superuser`` command.

``LIBEUFIN_NEXUS_URL``
  This is ``http://localhost:PORT/``, where ``PORT`` is the
  same port chosen when the nexus was started.

Of the six commands, the ``sandbox`` command talks to the sandbox,
while the other five commands talk to the nexus.
The following sections describe each command and their subcommands in detail.


sandbox
-------

The ``libeufin-cli sandbox`` command is for managing the sandbox process
started by ``libeufin-sandbox serve``.
It takes one option, ``--sandbox-url URL``, to be specified before
the subcommands and their arguments.
This URL can also be specified with the ``LIBEUFIN_SANDBOX_URL``
environment variable (see above).

The following subcommands are available: bankaccount, check, demobank,
ebicsbankaccount, ebicshost, ebicssubscriber.

The first command to use is ``check``,
followed by ``ebicshost``, ``ebicssubscriber``,
and ``ebicsbankaccount``, to configure the basic system.

You can then use the ``bankaccount`` command to generate (simulated)
transaction traffic.

After that, the ``demobank`` command and its subcommands
provide the same access to the API that Nexus itself uses.
You normally do not need to use those commands directly.


sandbox check
-------------

The ``check`` command attempts a simple aliveness check by
contacting the sandbox and displaying its returned message.
If all goes well, you should see something like:

.. code-block:: console

  $ libeufin-cli sandbox check
  Hello, this is the Sandbox


sandbox ebicshost
-----------------

The ``ebicshost`` command manages EBICS hosts.
It has two subcommands: create and list.

sandbox ebicshost create
^^^^^^^^^^^^^^^^^^^^^^^^

The ``ebicshost create`` command creates a EBICS host.
It takes one option, ``--host-id ID``, where ``ID`` is used to
identify that host for all future commands.

sandbox ebicshost list
^^^^^^^^^^^^^^^^^^^^^^

The ``ebicshost list`` command lists the hosts in the system.

For example:

.. code-block:: console

  $ libeufin-cli sandbox ebicshost create --host-id testhost
  $ libeufin-cli sandbox ebicshost list
  {
    "ebicsHosts" : [ "testhost" ]
  }

Here, the ``ID`` is ``testhost``.


sandbox ebicssubscriber
-----------------------

The ``ebicssubscriber`` command manages EBICS subscribers.
It has two subcommands: create and list.

sandbox ebicssubscriber create
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

The ``ebicssubscriber create`` command creates a EBICS subscriber.
It takes three options, all of which are required:

::

  --host-id TEXT     Ebics host ID
  --partner-id TEXT  Ebics partner ID
  --user-id TEXT     Ebics user ID

The host ID should be the same one specified in ``ebicshost create``
(see above).

For example:

.. code-block:: console

  $ libeufin-cli sandbox ebicssubscriber create \
      --host-id testhost \
      --partner-id partner01 \
      --user-id user01

Note that ``testhost`` is the same as in the ``ebicshost create``
example (see above).

sandbox ebicssubscriber list
^^^^^^^^^^^^^^^^^^^^^^^^^^^^

The ``ebicssubscriber list`` command lists the EBICS subscribers
in the system.

For example:

.. code-block:: console

  $ libeufin-cli sandbox ebicssubscriber list
  {
    "subscribers" : [ {
      "hostID" : "testhost",
      "partnerID" : "partner01",
      "userID" : "user01",
      "systemID" : null,
      "demobankAccountLabel" : "not associated yet"
    } ]
  }

Note that the output reflects the subscriber created in
the ``ebicssubscriber create`` example (see above).


sandbox ebicsbankaccount
------------------------

The ``ebicsbankaccount`` command manages EBICS bank accounts.
It has one subcommand: create.
(To list accounts, see ``sandbox bankaccount`` below.)

sandbox ebicsbankaccount
^^^^^^^^^^^^^^^^^^^^^^^^

The ``ebicsbankaccount create`` command takes several options, all required:

::

  --iban TEXT              IBAN
  --bic TEXT               BIC
  --person-name TEXT       bank account owner name
  --account-name TEXT      label of this bank account
  --ebics-user-id TEXT     user ID of the Ebics subscriber
  --ebics-host-id TEXT     host ID of the Ebics subscriber
  --ebics-partner-id TEXT  partner ID of the Ebics subscriber

At this time, although the ``--person-name`` option is required,
the sandbox does not remember the option value.
(When queried, it displays "Bank account owner's name" instead.
See ``sandbox bankaccount`` below.)
For the sandbox, the important value is the ``--account-name`` option.

For example:

.. code-block:: console

  $ libeufin-cli sandbox ebicsbankaccount create \
      --iban DE18500105172929531888 \
      --bic INGDDEFFXXX \
      --person-name "Jane Normal" \
      --account-name testacct01 \
      --ebics-host-id testhost \
      --ebics-user-id user01 \
      --ebics-partner-id partner01

Note that ``testhost`` is the same as in the ``ebicshost create``
example, and that ``user01`` and ``partner01`` are the same as in the
``ebicssubscriber create`` example (see above).


sandbox bankaccount
-------------------

The ``bankaccount`` command manages bank accounts.
It has several subcommands: list, generate-transactions,
simulate-incoming-transaction, transactions.

sandbox bankaccount list
^^^^^^^^^^^^^^^^^^^^^^^^

The ``bankaccount list`` command lists the bank accounts in the system.

For example:

.. code-block:: console

  $ libeufin-cli sandbox bankaccount list
  [ {
    "label" : "bank",
    "name" : "Bank account owner's name",
    "iban" : "DE370758",
    "bic" : "SANDBOXX"
  }, {
    "label" : "testacct01",
    "name" : "Bank account owner's name",
    "iban" : "DE18500105172929531888",
    "bic" : "INGDDEFFXXX"
  } ]

Note that ``testacct01``, ``DE18500105172929531888``, and ``INGDDEFFXXX``
are the same as specified in the ``ebicsbankaccount create`` example
(see above).

sandbox bankaccount generate-transactions
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

The remaining ``bankaccount`` commands deal with transactions
to and from the bank accounts.

The ``bankaccount generate-transactions`` command generates
test transactions.
It takes one arg, the account label.

For example:

.. code-block:: console

  $ libeufin-cli sandbox bankaccount generate-transactions testacct01

Note that ``testacct01`` is the account label shown in the ``bankaccount
list`` example (see above).

sandbox bankaccount simulate-incoming-transaction
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

The ``bankaccount simulate-incoming-transaction`` books an
incoming payment in the sandbox.
It takes one arg, the account label, and several options.

::

  --debtor-iban TEXT  IBAN sending the payment
  --debtor-bic TEXT   BIC sending the payment
  --debtor-name TEXT  name of the person who is sending the payment
  --amount TEXT       amount, no currency
  --subject TEXT      payment subject

For example:

.. code-block:: console

  $ libeufin-cli sandbox bankaccount simulate-incoming-transaction
      testacct01 \
      --debtor-iban DE06500105174526623718 \
      --debtor-bic INGDDEFFXXX \
      --debtor-name "Joe Foo" \
      --subject "Hello World" \
      --amount 10.50

Note that ``testacct01`` is the same as in previous examples (see above),
and that ``10.50`` is in ``X.Y`` format.

sandbox bankaccount transactions
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

The ``bankaccount transactions`` command lists transactions.
It takes one arg, the account label.

For example:

.. code-block:: console

  $ libeufin-cli sandbox bankaccount transactions testacct01
  {
    "payments" : [ {
      "accountLabel" : "testacct01",
      "creditorIban" : "DE18500105172929531888",
      "creditorBic" : "INGDDEFFXXX",
      "creditorName" : "Creditor Name",
      "debtorIban" : "DE64500105178797276788",
      "debtorBic" : "DEUTDEBB101",
      "debtorName" : "Max Mustermann",
      "amount" : "5",
      "currency" : "EUR",
      "subject" : "sample transaction DILWBJHL",
      "date" : "Wed, 26 Jan 2022 09:03:44 GMT",
      "creditDebitIndicator" : "credit",
      "accountServicerReference" : "DILWBJHL",
      "paymentInformationId" : null
    }, {
      "accountLabel" : "testacct01",
      "creditorIban" : "DE64500105178797276788",
      "creditorBic" : "DEUTDEBB101",
      "creditorName" : "Max Mustermann",
      "debtorIban" : "DE18500105172929531888",
      "debtorBic" : "INGDDEFFXXX",
      "debtorName" : "Debitor Name",
      "amount" : "12",
      "currency" : "EUR",
      "subject" : "sample transaction N7JSY17B",
      "date" : "Wed, 26 Jan 2022 09:03:44 GMT",
      "creditDebitIndicator" : "debit",
      "accountServicerReference" : "N7JSY17B",
      "paymentInformationId" : null
    }, {
      "accountLabel" : "testacct01",
      "creditorIban" : "DE18500105172929531888",
      "creditorBic" : "INGDDEFFXXX",
      "creditorName" : "Creditor Name",
      "debtorIban" : "DE06500105174526623718",
      "debtorBic" : "INGDDEFFXXX",
      "debtorName" : "Joe Foo",
      "amount" : "10.50",
      "currency" : "EUR",
      "subject" : "Hello World",
      "date" : "Wed, 26 Jan 2022 09:04:31 GMT",
      "creditDebitIndicator" : "credit",
      "accountServicerReference" : "sandbox-6UI2J3636J9EESXO",
      "paymentInformationId" : null
    } ]
  }

Note that ``testacct01`` is the same as in previous examples (see above),
and that the generated transactions from previous examples are listed,
as well.


sandbox demobank
----------------

The ``demobank`` command provides an interface to the Access API,
which includes three commands: register, info, new-transaction.
There is also a fourth ``demobank`` command, new-ebicssubscriber,
that does not use the Access API.

For all ``demobank`` commands, the sandbox URL *must* specify which
*one* bank the command applies to in the base URL.
Note that this URL cannot be used with other sandbox commands.
In other words:

``--sandbox-url http://localhost:5016/demobanks/default``
  This base URL can be used for commands:

  - sandbox demobank register
  - sandbox demobank info
  - sandbox demobank new-ebicssubscriber
  - sandbox demobank new-transaction

  It specifies the ``default`` demobank.

``--sandbox-url http://localhost:5016``
  This base URL can be used for all other sandbox commands.

In the following examples, the base URL will be explicitly shown with
the ``--sandbox-url`` option for the ``demobank`` commands.

sandbox demobank register
^^^^^^^^^^^^^^^^^^^^^^^^^

The ``demobank register`` command registers a new bank account.
Note that the username will be both the username to login at
the bank and the bank account label.
It takes the username and password from the
``LIBEUFIN_SANDBOX_USERNAME`` and ``LIBEUFIN_SANDBOX_PASSWORD``
environment variables.
Th username *need not be* ``admin``.

For example:

.. code-block:: console

  $ export LIBEUFIN_SANDBOX_USERNAME=jrluser
  $ export LIBEUFIN_SANDBOX_PASSWORD=easy
  $ libeufin-cli sandbox \
      --sandbox-url http://localhost:5016/demobanks/default \
      demobank register

sandbox demobank info
^^^^^^^^^^^^^^^^^^^^^

The ``demobank info`` command returns basic information on a bank account.
It takes option ``--bank-account NAME``.

For example:

.. code-block:: console

  $ libeufin-cli sandbox \
      --sandbox-url http://localhost:5016/demobanks/default \
      demobank info --bank-account jrluser
  {
    "balance" : {
      "amount" : "EUR:100",
      "credit_debit_indicator" : "credit"
    },
    "paytoUri" : "payto://iban/SANDBOXX/DE948559?receiver-name=admin"
  }

Note that ``jrluser`` is the same username / bank account name
as in the ``register`` example (see above).

sandbox demobank new-ebicssubscriber
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

The ``demobank new-ebicssubscriber`` command associates a new Ebics
subscriber to an existing bank account.
It takes several options, all required:

::

  --host-id TEXT       Ebics host ID
  --partner-id TEXT    Ebics partner ID
  --user-id TEXT       Ebics user ID
  --bank-account TEXT  Label of the bank account to associate
                       with this Ebics subscriber

For example:

.. code-block: console

  $ libeufin-cli sandbox \
      --sandbox-url http://localhost:5016/demobanks/default \
      demobank new-ebicssubscriber \
      --host-id testhost \
      --partner-id partner01 \
      --user-id user02 \
      --bank-account jrluser

Note that ``testhost`` is the same as in the ``ebicshost create``
example, and that ``partner01`` is the same as in the
``ebicssubscriber create`` example (see above).
The ``user02`` is new.
The ``--bank-account jrluser`` is the same as in the
``info`` example (see above).
You can see the effect of the ``new-ebicssubscriber`` command
with the ``bankaccount list`` command.

sandbox demobank new-transaction
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

The ``demobank new-transaction`` command initiates a new transaction.
It takes several options, all required:

::

  --bank-account TEXT        Label of the bank account to be
                             debited for the transaction
  --payto-with-subject TEXT  Payto address including the
                             subject as a query parameter
  --amount CUR:X.Y           Amount to transfer

For example:

.. code-block:: console

  $ libeufin-cli sandbox \
      --sandbox-url http://localhost:5016/demobanks/default \
      demobank new-transaction \
      --bank-account jrluser \
      --payto-with-subject 'payto://FIXME/?message=1kg+coffee' \
      --amount EUR:10.50
  FIXME: Any output?

Note that ``--bank-account jrluser`` is the same as in the
``info`` and ``new-ebicssubscriber`` command examples (see above).


users
-----

WRITEME

users self
^^^^^^^^^^

WRITEME

users list
^^^^^^^^^^

WRITEME

users create
^^^^^^^^^^^^

WRITEME

users change-password
^^^^^^^^^^^^^^^^^^^^^

WRITEME


permissions
-----------

WRITEME

permissions revoke
^^^^^^^^^^^^^^^^^^

WRITEME

permissions list
^^^^^^^^^^^^^^^^

WRITEME

permissions grant
^^^^^^^^^^^^^^^^^

WRITEME


accounts
--------

WRITEME

accounts transactions
^^^^^^^^^^^^^^^^^^^^^

WRITEME

accounts task-status
^^^^^^^^^^^^^^^^^^^^

WRITEME

accounts task-schedule
^^^^^^^^^^^^^^^^^^^^^^

WRITEME

accounts task-delete
^^^^^^^^^^^^^^^^^^^^

WRITEME

accounts submit-payment
^^^^^^^^^^^^^^^^^^^^^^^

WRITEME

accounts show-payment
^^^^^^^^^^^^^^^^^^^^^

WRITEME

accounts show
^^^^^^^^^^^^^

WRITEME

accounts prepare-payment
^^^^^^^^^^^^^^^^^^^^^^^^

WRITEME

accounts list-tasks
^^^^^^^^^^^^^^^^^^^

WRITEME

accounts list-payments
^^^^^^^^^^^^^^^^^^^^^^

WRITEME

accounts fetch-transactions
^^^^^^^^^^^^^^^^^^^^^^^^^^^

WRITEME

accounts delete-payment
^^^^^^^^^^^^^^^^^^^^^^^

WRITEME


connections
-----------

WRITEME

connections download-bank-accounts
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

WRITEME

connections delete-connection
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

WRITEME

connections connect
^^^^^^^^^^^^^^^^^^^

WRITEME


facades
-------

WRITEME

facades new-taler-wire-gateway-facade
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

WRITEME

facades new-anastasis-facade
^^^^^^^^^^^^^^^^^^^^^^^^^^^^

WRITEME

facades list
^^^^^^^^^^^^

WRITEME


See Also
========

.. TODO: libeufin-sandbox(1), libeufin-cli(1).


Bugs
====

Report bugs by using https://bugs.taler.net or by sending electronic
mail to <taler@gnu.org>.