taler-docs

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

post-reserves-RESERVE_PUB-purse.rst (3767B)


      1 .. http:post:: /reserves/$RESERVE_PUB/purse
      2 
      3   Create purse for an account.  First step of a PULL payment.
      4 
      5   **Request:**
      6 
      7   The request body must be a `ReservePurseRequest` object.
      8 
      9   **Response:**
     10 
     11   :http:statuscode:`200 OK`:
     12     The operation succeeded, the exchange confirms that the
     13     purse was allocated.
     14     The response will include a `PurseCreateSuccessResponse` object.
     15   :http:statuscode:`402 Payment Required`:
     16     The account needs to contain more funding to create more purses.
     17     This response comes with a standard `ErrorDetail` response.
     18   :http:statuscode:`403 Forbidden`:
     19     Account or contract signature is invalid.
     20     This response comes with a standard `ErrorDetail` response.
     21   :http:statuscode:`404 Not found`:
     22     The purse creation operation failed as we could not find the reserve.
     23     This response comes with a standard `ErrorDetail` response.
     24   :http:statuscode:`409 Conflict`:
     25     The purse creation failed because a purse with
     26     the same public key but different meta data was
     27     created previously.  Which specific conflict it is
     28     can be decided by looking at the error code
     29     (``TALER_EC_EXCHANGE_PURSE_CREATE_CONFLICTING_META_DATA`` or
     30     ``TALER_EC_EXCHANGE_PURSE_DEPOSIT_CONFLICTING_META_DATA`` or
     31     ``TALER_EC_EXCHANGE_PURSE_ECONTRACT_CONFLICTING_META_DATA``).
     32     The specific fields of the response depend on the error code
     33     and include the signatures (and what was signed over) proving the
     34     conflict.
     35     The response will be a `PurseConflict` response
     36     (but not a `DepositDoubleSpendError`).
     37   :http:statuscode:`451 Unavailable For Legal Reasons`:
     38     This account has not yet passed the KYC checks.
     39     The client must pass KYC checks before proceeding with the merge.
     40     The response will be an `LegitimizationNeededResponse` object.
     41 
     42   **Details:**
     43 
     44   .. ts:def:: ReservePurseRequest
     45 
     46     interface ReservePurseRequest {
     47 
     48       // Minimum amount that must be credited to the reserve, that is
     49       // the total value of the purse minus the deposit fees.
     50       // If the deposit fees are lower, the contribution to the
     51       // reserve can be higher!
     52       purse_value: Amount;
     53 
     54       // Minimum age required for all coins deposited into the purse.
     55       min_age: Integer;
     56 
     57       // Purse fee the reserve owner is willing to pay
     58       // for the purse creation. Optional, if not present
     59       // the purse is to be created from the purse quota
     60       // of the reserve.
     61       purse_fee: Amount;
     62 
     63       // Optional encrypted contract, in case the buyer is
     64       // proposing the contract and thus establishing the
     65       // purse with the payment.
     66       econtract?: EncryptedContract;
     67 
     68       // EdDSA public key used to approve merges of this purse.
     69       merge_pub: EddsaPublicKey;
     70 
     71       // EdDSA signature of the purse private key affirming the merge
     72       // over a `TALER_PurseMergeSignaturePS`.
     73       // Must be of purpose ``TALER_SIGNATURE_PURSE_MERGE``.
     74       merge_sig: EddsaSignature;
     75 
     76       // EdDSA signature of the account/reserve affirming the merge.
     77       // Must be of purpose ``TALER_SIGNATURE_WALLET_ACCOUNT_MERGE``
     78       reserve_sig: EddsaSignature;
     79 
     80       // Purse public key.
     81       purse_pub: EddsaPublicKey;
     82 
     83       // EdDSA signature of the purse over
     84       // `TALER_PurseRequestSignaturePS` of
     85       // purpose ``TALER_SIGNATURE_PURSE_REQUEST``
     86       // confirming that the
     87       // above details hold for this purse.
     88       purse_sig: EddsaSignature;
     89 
     90       // SHA-512 hash of the contact of the purse.
     91       h_contract_terms: HashCode;
     92 
     93       // Client-side timestamp of when the merge request was made.
     94       merge_timestamp: Timestamp;
     95 
     96       // Indicative time by which the purse should expire
     97       // if it has not been paid.
     98       purse_expiration: Timestamp;
     99 
    100     }