Contents

POST /reserves/$RESERVE_PUB/close#

Force immediate closure of a reserve. Does not actually delete the reserve or the KYC data, but merely forces the reserve’s current balance to be wired back to the account where it originated from, or another account of the user’s choosing if they performed the required KYC check and designated another target account.

Request:

The request body must be a ReserveCloseRequest object.

Response:

200 OK:

The exchange responds with a ReserveCloseResponse object. Note that if the reserve balance is less than the closing fee, the server will just return an amount of zero and simply not wire any funds.

400 Bad Request:

The request timestamp has excessive clock skew. This response comes with a standard ErrorDetail response with a code of TALER_EC_EXCHANGE_GENERIC_CLOCK_SKEW.

403 Forbidden:

The TALER_SIGNATURE_WALLET_RESERVE_CLOSE signature is invalid. This response comes with a standard ErrorDetail response with a code of TALER_EC_EXCHANGE_RESERVES_CLOSE_BAD_SIGNATURE.

404 Not found:

The reserve key does not belong to a reserve known to the exchange. This response comes with a standard ErrorDetail response with a code of TALER_EC_EXCHANGE_GENERIC_RESERVE_UNKNOWN.

409 Conflict:

No target account was given, and the exchange does not know an origin account for this reserve. This response comes with a standard ErrorDetail response with a code of TALER_EC_EXCHANGE_RESERVES_CLOSE_NO_TARGET_ACCOUNT.

413 Request entity too large:

The uploaded body is to long, it exceeds the size limit. Returned with an error code of TALER_EC_GENERIC_UPLOAD_EXCEEDS_LIMIT.

451 Unavailable For Legal Reasons:

This account has not yet passed the KYC checks, hence wiring funds to a non-origin account is not allowed. The client must pass KYC checks before the reserve can be opened. The response will be an LegitimizationNeededResponse object.

500 Internal Server Error:

The server experienced an internal error. This response comes with a standard ErrorDetail response. Possible error codes include TALER_EC_GENERIC_DB_FETCH_FAILED, TALER_EC_GENERIC_INTERNAL_INVARIANT_FAILURE, or TALER_EC_EXCHANGE_WIRE_FEES_NOT_CONFIGURED.

Details:

interface ReserveCloseRequest {
  // Signature of purpose
  // TALER_SIGNATURE_WALLET_RESERVE_CLOSE over
  // a TALER_ReserveCloseRequestSignaturePS.
  reserve_sig: EddsaSignature;

  // Time when the client made the request.
  // Timestamp must be reasonably close to the time of
  // the exchange, otherwise the exchange may reject
  // the request (with a status code of 400).
  request_timestamp: Timestamp;

  // Full payto://-URI of the account the reserve balance is to be
  // wired to.  Must be of the form: 'payto://$METHOD' for a
  // wire method supported by this exchange (if the
  // method is not supported, this is a bad request (400)).
  // If not given, the reserve's origin account
  // will be used. If no origin account is known for the
  // reserve and not given, this is a conflict (409).
  payto_uri?: string;

}
interface ReserveCloseResponse {

  // Actual amount that will be wired (excludes closing fee).
  wire_amount: Amount;

}