post-reserves-RESERVE_PUB-open.rst (5348B)
1 .. http:post:: /reserves/$RESERVE_PUB/open 2 3 Request keeping a reserve open for invoicing. 4 5 **Request:** 6 7 The request body must be a `ReserveOpenRequest` object. 8 9 **Response:** 10 11 :http:statuscode:`200 OK`: 12 The exchange responds with a `ReserveOpenResponse` object. 13 :http:statuscode:`400 Bad Request`: 14 The request timestamp has excessive clock skew. 15 This response comes with a standard `ErrorDetail` response with 16 a code of ``TALER_EC_EXCHANGE_GENERIC_CLOCK_SKEW``. 17 :http:statuscode:`402 Payment Required`: 18 The exchange responds with a `ReserveOpenFailure` object when 19 the payment offered is insufficient for the requested operation. 20 :http:statuscode:`403 Forbidden`: 21 The *TALER_SIGNATURE_WALLET_RESERVE_OPEN* signature is invalid. 22 This response comes with a standard `ErrorDetail` response with 23 a code of ``TALER_EC_EXCHANGE_RESERVES_OPEN_BAD_SIGNATURE``. 24 :http:statuscode:`404 Not found`: 25 The reserve key does not belong to a reserve known to the exchange. 26 This response comes with a standard `ErrorDetail` response with 27 a code of ``TALER_EC_EXCHANGE_GENERIC_RESERVE_UNKNOWN``. 28 :http:statuscode:`409 Conflict`: 29 The balance of the reserve or of a coin was insufficient. 30 Which case it is can be decided by looking at the error code 31 (``TALER_EC_EXCHANGE_GENERIC_INSUFFICIENT_FUNDS`` or 32 ``TALER_EC_EXCHANGE_GENERIC_COIN_CONFLICTING_DENOMINATION_KEY`` or 33 ``TALER_EC_EXCHANGE_GENERIC_COIN_CONFLICTING_AGE_HASH`` or 34 ``TALER_EC_EXCHANGE_RESERVES_OPEN_INSUFFICIENT_FUNDS``). 35 The specific fields of the response depend on the error code 36 and include the signatures (and what was signed over) proving the 37 conflict. 38 The response is a `WithdrawError` object, a `DepositDoubleSpendError`, 39 a `CoinDenominationConflictError` or a `CoinAgeCommitmentConflictError` 40 depending on the error type. 41 :http:statuscode:`413 Request entity too large`: 42 The uploaded body is to long, it exceeds the size limit. 43 Returned with an error code of 44 ``TALER_EC_GENERIC_UPLOAD_EXCEEDS_LIMIT``. 45 :http:statuscode:`500 Internal Server Error`: 46 The exchange encountered an internal error. 47 This response comes with a standard `ErrorDetail` response. 48 Possible error codes include 49 ``TALER_EC_EXCHANGE_GENERIC_KEYS_MISSING``, 50 ``TALER_EC_EXCHANGE_GENERIC_BAD_CONFIGURATION``, 51 ``TALER_EC_GENERIC_DB_FETCH_FAILED``, 52 ``TALER_EC_GENERIC_DB_STORE_FAILED``, or 53 ``TALER_EC_GENERIC_FAILED_COMPUTE_AMOUNT``. 54 55 **Details:** 56 57 .. ts:def:: ReserveOpenRequest 58 59 interface ReserveOpenRequest { 60 // Signature of purpose 61 // ``TALER_SIGNATURE_WALLET_RESERVE_OPEN`` over 62 // a `TALER_ReserveOpenPS`. 63 reserve_sig: EddsaSignature; 64 65 // Array of payments made towards the cost of the 66 // operation. 67 payments: OpenPaymentDetail[]; 68 69 // Amount to be paid from the reserve for this 70 // operation. 71 reserve_payment: Amount; 72 73 // Time when the client made the request. 74 // Timestamp must be reasonably close to the time of 75 // the exchange, otherwise the exchange may reject 76 // the request (with a status code of 400). 77 request_timestamp: Timestamp; 78 79 // Desired new expiration time for the reserve. 80 // If the reserve would expire before this time, 81 // the exchange will charge account fees (and 82 // possibly KYC fees) until the expiration time 83 // exceeds this timestamp. Note that the exchange 84 // will refuse requests (with a status code of 400) 85 // if the time is so far in the future that the 86 // fees are not yet known (see /keys). 87 reserve_expiration: Timestamp; 88 89 // Desired open purse limit. Can be used to pay the 90 // annual account fee more than once to get a larger 91 // purse limit. 92 purse_limit: Integer; 93 94 } 95 96 .. ts:def:: ReserveOpenResponse 97 98 interface ReserveOpenResponse { 99 // Transaction cost for extending the expiration time. 100 // Excludes KYC fees. 101 open_cost: Amount; 102 103 // Current expiration time for the reserve. 104 reserve_expiration: Timestamp; 105 } 106 107 .. ts:def:: ReserveOpenFailure 108 109 interface ReserveOpenFailure { 110 // Transaction cost that should have been paid 111 // to extending the reserve as requested. 112 // Excludes KYC fees. 113 open_cost: Amount; 114 115 // Remaining expiration time for the reserve. 116 reserve_expiration: Timestamp; 117 } 118 119 .. ts:def:: OpenPaymentDetail 120 121 interface OpenPaymentDetail { 122 123 // Contribution of this coin to the overall amount. 124 // Can be a fraciton of the coin's total value. 125 amount: Amount; 126 127 // Hash of denomination RSA key with which the coin is signed. 128 denom_pub_hash: HashCode; 129 130 // Exchange's unblinded RSA signature of the coin. 131 ub_sig: DenominationSignature; 132 133 // Age commitment for the coin, if the denomination is age-restricted. 134 age_commitment?: AgeCommitment; 135 136 // Signature over `TALER_ReserveOpenDepositSignaturePS` 137 // of purpose ``TALER_SIGNATURE_WALLET_RESERVE_OPEN_DEPOSIT`` 138 // made by the customer with the 139 // `coin's private key <coin-priv>`. 140 coin_sig: EddsaSignature; 141 142 // Public key of the coin being used to pay for 143 // opening the reserve. 144 coin_pub: EddsaPublicKey; 145 146 }