taler-docs

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

post-orders-ORDER_ID-claim.rst (1445B)


      1 .. http:post:: [/instances/$INSTANCE]/orders/$ORDER_ID/claim
      2 
      3   Wallet claims ownership (via nonce) over an order.  By claiming
      4   an order, the wallet obtains the full contract terms, and thereby
      5   implicitly also the hash of the contract terms it needs for the
      6   other ``public`` APIs to authenticate itself as the wallet that
      7   is indeed eligible to inspect this particular order's status.
      8 
      9   **Request:**
     10 
     11   The request must be a `ClaimRequest`.
     12 
     13   **Response:**
     14 
     15   :http:statuscode:`200 OK`:
     16     The client has successfully claimed the order.
     17     The response contains the :ref:`contract terms <contract-terms>`.
     18   :http:statuscode:`404 Not found`:
     19     The backend is unaware of the instance or order.
     20   :http:statuscode:`409 Conflict`:
     21     Someone else has already claimed the same order ID with a different nonce.
     22 
     23   **Details:**
     24 
     25   .. ts:def:: ClaimRequest
     26 
     27     interface ClaimRequest {
     28       // Nonce to identify the wallet that claimed the order.
     29       nonce: EddsaPublicKey;
     30 
     31       // Token that authorizes the wallet to claim the order.
     32       // *Optional* as the merchant may not have required it
     33       // (``create_token`` set to ``false`` in `PostOrderRequest`).
     34       token?: ClaimToken;
     35     }
     36 
     37   .. ts:def:: ClaimResponse
     38 
     39     interface ClaimResponse {
     40       // Contract terms of the claimed order
     41       contract_terms: ContractTerms;
     42 
     43       // Signature by the merchant over the contract terms.
     44       sig: EddsaSignature;
     45     }