post-reserves-RESERVE_PUB-open.rst (5208B)
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_RESERVES_OPEN_INSUFFICIENT_FUNDS``). 34 The specific fields of the response depend on the error code 35 and include the signatures (and what was signed over) proving the 36 conflict. 37 The response is `WithdrawError` object or a `DepositDoubleSpendError` 38 depending on the error type. 39 :http:statuscode:`413 Request entity too large`: 40 The uploaded body is to long, it exceeds the size limit. 41 Returned with an error code of 42 ``TALER_EC_GENERIC_UPLOAD_EXCEEDS_LIMIT``. 43 :http:statuscode:`500 Internal Server Error`: 44 The exchange encountered an internal error. 45 This response comes with a standard `ErrorDetail` response. 46 Possible error codes include 47 ``TALER_EC_EXCHANGE_GENERIC_KEYS_MISSING``, 48 ``TALER_EC_EXCHANGE_GENERIC_BAD_CONFIGURATION``, 49 ``TALER_EC_GENERIC_DB_FETCH_FAILED``, 50 ``TALER_EC_GENERIC_DB_STORE_FAILED``, or 51 ``TALER_EC_GENERIC_FAILED_COMPUTE_AMOUNT``. 52 53 **Details:** 54 55 .. ts:def:: ReserveOpenRequest 56 57 interface ReserveOpenRequest { 58 // Signature of purpose 59 // ``TALER_SIGNATURE_WALLET_RESERVE_OPEN`` over 60 // a `TALER_ReserveOpenPS`. 61 reserve_sig: EddsaSignature; 62 63 // Array of payments made towards the cost of the 64 // operation. 65 payments: OpenPaymentDetail[]; 66 67 // Amount to be paid from the reserve for this 68 // operation. 69 reserve_payment: Amount; 70 71 // Time when the client made the request. 72 // Timestamp must be reasonably close to the time of 73 // the exchange, otherwise the exchange may reject 74 // the request (with a status code of 400). 75 request_timestamp: Timestamp; 76 77 // Desired new expiration time for the reserve. 78 // If the reserve would expire before this time, 79 // the exchange will charge account fees (and 80 // possibly KYC fees) until the expiration time 81 // exceeds this timestamp. Note that the exchange 82 // will refuse requests (with a status code of 400) 83 // if the time is so far in the future that the 84 // fees are not yet known (see /keys). 85 reserve_expiration: Timestamp; 86 87 // Desired open purse limit. Can be used to pay the 88 // annual account fee more than once to get a larger 89 // purse limit. 90 purse_limit: Integer; 91 92 } 93 94 .. ts:def:: ReserveOpenResponse 95 96 interface ReserveOpenResponse { 97 // Transaction cost for extending the expiration time. 98 // Excludes KYC fees. 99 open_cost: Amount; 100 101 // Current expiration time for the reserve. 102 reserve_expiration: Timestamp; 103 } 104 105 .. ts:def:: ReserveOpenFailure 106 107 interface ReserveOpenFailure { 108 // Transaction cost that should have been paid 109 // to extending the reserve as requested. 110 // Excludes KYC fees. 111 open_cost: Amount; 112 113 // Remaining expiration time for the reserve. 114 reserve_expiration: Timestamp; 115 } 116 117 .. ts:def:: OpenPaymentDetail 118 119 interface OpenPaymentDetail { 120 121 // Contribution of this coin to the overall amount. 122 // Can be a fraciton of the coin's total value. 123 amount: Amount; 124 125 // Hash of denomination RSA key with which the coin is signed. 126 denom_pub_hash: HashCode; 127 128 // Exchange's unblinded RSA signature of the coin. 129 ub_sig: DenominationSignature; 130 131 // Age commitment for the coin, if the denomination is age-restricted. 132 age_commitment?: AgeCommitment; 133 134 // Signature over `TALER_ReserveOpenDepositSignaturePS` 135 // of purpose ``TALER_SIGNATURE_WALLET_RESERVE_OPEN_DEPOSIT`` 136 // made by the customer with the 137 // `coin's private key <coin-priv>`. 138 coin_sig: EddsaSignature; 139 140 // Public key of the coin being used to pay for 141 // opening the reserve. 142 coin_pub: EddsaPublicKey; 143 144 }