summaryrefslogtreecommitdiff
path: root/libeufin/api-sandbox.rst
blob: ee298d850c53128ab33f8d3feecd05ed3eb70828 (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
Sandbox API
###########


Entities
========

Bank Account
  ...

EBICS Host

EBICS Subscriber
  ...

EBICS Partner
  ...



HTTP API
========


.. http:post:: /ebicsweb

  Submit an EBICS request to the sandbox.


.. http:post:: /admin/customers

  Create a new customer.  A customer identifies a human that
  may own multiple bank accounts.

  When creating a customer, one EBICS subscriber is automatically
  created for the customer.

  In the future, we might add an API to create multiple additional subscribers for
  a customer.

  When creating a new customer, an ID will be assigned automatically.

  .. code-block:: tsref

    interface CustomerCreationRequest {
      // human-readable name for the customer
      name: string;
    }

.. http:get:: /admin/customers/:id

  Get information about a customer.

  .. ts:def:: CustomerInfo

    interface CustomerInfo {
      ebicsInfo?: CustomerEbicsInfo;
      finTsInfo?: CustomerFinTsInfo;
    }

  .. ts:def:: CustomerEbicsInfo

    interface CustomerEbicsInfo {
      ebicsHostId: string;
      ebicsParterId: string;
      ebicsUserId: string;

      // Info for the customer's "main subscriber"
      subscriberInitializationState: "NEW" | "PARTIALLY_INITIALIZED_INI" | "PARTIALLY_INITIALIZED_HIA" | "READY" | "INITIALIZED";
    }

  .. ts:def:: CustomerFinTsInfo
    
    // TODO

.. http:post:: /admin/customers/:id/ebics/keyletter

  Accept the information from the customer's ("virtual") INI-Letter and HIA-Letter
  and change the key's state as required.

  .. code-block:: tsref

    interface KeyLetterRequest {

      ini: {
        // The user ID that participates in a EBICS subscriber.
        userId: string;

        // The customer ID specific to the bank (therefore not
        // participating in a EBICS subscriber).
        customerId: string;

        // Human name of the user
        name: string;

        // As per specification, this value is:
        // "Date of processing of the corresponding EBICS order".  DD.MM.YYYY format.
        date: string;

        // As per specification, this value is:
        // "Time of processing of the corresponding EBICS order".  HH:MM:SS format.
        time: string;

        // Identification token of the bank.  Not required to obey to any particular standard.
        recipient: string;

        // Electronic signature version.  Admitted values: A005, A006.
        version: string;

        // Length in bits of the key exponent.
        public_exponent_length: number;
        // RSA key exponent in hexadecimaml notation.
        public_exponent: string;

        // Length in bits of the key modulus.
        public_modulus_length: number;
        // RSA key modulus in hexadecimaml notation.
        public_modulus: string;

        // RSA key hash.
        //
        // A005, A005 versions require hash type SHA-256.
        hash: string;
      }

      hia: {
        // The user ID that participates in a EBICS subscriber.
        userId: string;
  
        // The customer ID specific to the bank (therefore not
        // participating in a EBICS subscriber).
        customerId: string;
  
        // Human name of the user
        name: string;
  
        // As per specification, this value is:
        // "Date of processing of the corresponding EBICS order".  DD.MM.YYYY format.
        date: string;
  
        // As per specification, this value is:
        // "Time of processing of the corresponding EBICS order".  HH:MM:SS format.
        time: string;
  
        // Identification token of the bank.  Not required to obey to any particular standard.
        recipient: string;
  
        ////////////////////////////////////////////////////
        // Identification and Authentication key details. //
        ////////////////////////////////////////////////////
  
        // Identification and authentication signature version.
        // Admitted value: X002.
        ia_version: string;
  
        // length of the exponent, in bits.
        ia_public_exponent_length: number;
        // RSA key exponent in hexadecimaml notation.
        ia_public_exponent: string;
  
        // length of the modulus, in bits.
        ia_public_modulus_length: number;
        // RSA key modulus in hexadecimaml notation.
        ia_public_modulus: string;
  
        // SHA-256 hash of the identification and authentication key.
        ia_hash: string;
  
        /////////////////////////////
        // Encryption key details. //
        /////////////////////////////
  
        // Encryption version.  Admitted value: E002.
        enc_version: string;
  
        // length of the exponent, in bits.
        enc_public_exponent_length: number;
        // RSA key exponent in hexadecimaml notation.
        enc_public_exponent: string;
  
        // length of the modulus, in bits.
        enc_public_modulus_length: number;
        // RSA key modulus in hexadecimaml notation.
        enc_public_modulus: string;
  
        // SHA-256 hash of the encryption key.
        enc_hash: string;
      }
    }