taler-docs

Documentation for GNU Taler components, APIs and protocols
Log | Files | Refs | README | LICENSE

post-reserves-RESERVE_PUB-close.rst (2434B)


      1 .. http:post:: /reserves/$RESERVE_PUB/close
      2 
      3   Force immediate closure of a reserve. Does not actually
      4   delete the reserve or the KYC data, but merely forces
      5   the reserve's current balance to be wired back to the
      6   account where it originated from, or another account of
      7   the user's choosing if they performed the required KYC
      8   check and designated another target account.
      9 
     10   **Request:**
     11 
     12   The request body must be a `ReserveCloseRequest` object.
     13 
     14   **Response:**
     15 
     16   :http:statuscode:`200 OK`:
     17     The exchange responds with a `ReserveCloseResponse` object.
     18   :http:statuscode:`403 Forbidden`:
     19     The *TALER_SIGNATURE_WALLET_RESERVE_CLOSE* signature is invalid.
     20     This response comes with a standard `ErrorDetail` response.
     21   :http:statuscode:`404 Not found`:
     22     The reserve key does not belong to a reserve known to the exchange.
     23   :http:statuscode:`409 Conflict`:
     24     No target account was given, and the exchange does not know an
     25     origin account for this reserve.
     26   :http:statuscode:`451 Unavailable For Legal Reasons`:
     27     This account has not yet passed the KYC checks, hence wiring
     28     funds to a non-origin account is not allowed.
     29     The client must pass KYC checks before the reserve can be opened.
     30     The response will be an `LegitimizationNeededResponse` object.
     31 
     32   **Details:**
     33 
     34   .. ts:def:: ReserveCloseRequest
     35 
     36     interface ReserveCloseRequest {
     37       // Signature of purpose
     38       // ``TALER_SIGNATURE_WALLET_RESERVE_CLOSE`` over
     39       // a `TALER_ReserveCloseRequestSignaturePS`.
     40       reserve_sig: EddsaSignature;
     41 
     42       // Time when the client made the request.
     43       // Timestamp must be reasonably close to the time of
     44       // the exchange, otherwise the exchange may reject
     45       // the request (with a status code of 400).
     46       request_timestamp: Timestamp;
     47 
     48       // Full payto://-URI of the account the reserve balance is to be
     49       // wired to.  Must be of the form: 'payto://$METHOD' for a
     50       // wire method supported by this exchange (if the
     51       // method is not supported, this is a bad request (400)).
     52       // If not given, the reserve's origin account
     53       // will be used. If no origin account is known for the
     54       // reserve and not given, this is a conflict (409).
     55       payto_uri?: string;
     56 
     57     }
     58 
     59   .. ts:def:: ReserveCloseResponse
     60 
     61     interface ReserveCloseResponse {
     62 
     63       // Actual amount that will be wired (excludes closing fee).
     64       wire_amount: Amount;
     65 
     66     }