taler-docs

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

get-contracts-CONTRACT_PUB.rst (1225B)


      1 .. http:get:: /contracts/$CONTRACT_PUB
      2 
      3   Obtain P2P contract associated with the given contract public key.
      4 
      5   **Response:**
      6 
      7   :http:statuscode:`200 Ok`:
      8     The contract is being returned using a `ExchangeContractResponse`.
      9   :http:statuscode:`400 Bad Request`:
     10     The ``$CONTRACT_PUB`` is malformed.
     11     This response comes with a standard `ErrorDetail` response with
     12     a code of ``TALER_EC_EXCHANGE_CONTRACTS_INVALID_CONTRACT_PUB``.
     13   :http:statuscode:`404 Not found`:
     14     The contract is unknown.
     15     This response comes with a standard `ErrorDetail` response with
     16     a code of ``TALER_EC_EXCHANGE_CONTRACTS_UNKNOWN``.
     17   :http:statuscode:`500 Internal Server Error`:
     18     The server experienced an internal error.
     19     This response comes with a standard `ErrorDetail` response with
     20     a code of ``TALER_EC_GENERIC_DB_FETCH_FAILED``.
     21 
     22   **Details:**
     23 
     24    .. ts:def:: ExchangeContractResponse
     25 
     26     interface ExchangeContractResponse {
     27 
     28       // Public key of the purse into which payments must be
     29       // made for this contract.
     30       purse_pub: PursePublicKey;
     31 
     32       // Signature over the contract
     33       econtract_sig: PurseContractSignature;
     34 
     35       // Encrypted contract.
     36       econtract: EncryptedContract;
     37     }