From 3fba4892a5f4bdd032e86eabf13ce6ac04f1e649 Mon Sep 17 00:00:00 2001 From: Marcello Stanisci Date: Fri, 9 Dec 2016 11:20:28 +0100 Subject: Changin URIs to /map/in /map/out --- api-merchant.rst | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/api-merchant.rst b/api-merchant.rst index bfa8bf12..96cbc146 100644 --- a/api-merchant.rst +++ b/api-merchant.rst @@ -380,7 +380,7 @@ The following API are made available by the merchant's `backend` to the merchant } -.. http:post:: /map +.. http:post:: /map/in Store a pair formed by a plain contract and its hashcode into the database. @@ -393,6 +393,9 @@ The following API are made available by the merchant's `backend` to the merchant :status 200 OK: The data has been successfully stored. + :status 422 Unprocessable Entity: + The hashcode provided by the frontend does not match the contract. + .. _MapRequest: .. _tsref-type-MapRequest: .. code-block:: tsref @@ -402,10 +405,28 @@ The following API are made available by the merchant's `backend` to the merchant // Plain contract to be stored contract: Contract; - // contract's hashcode + // contract's hashcode. We require this value from the frontend + // as an additional check on data integrity. h_contract: HashCode; } + +.. http:get:: /map/out + + Retrieve a contract, given its hashcode. + + **Request** + + :query h_contract: hashcode of the contract to retrieve. + + **Response** + + :status 200 OK: + The body contains a `contract`_ corresponding to `h_contract`. + + :status 404 Not Found: + There is no contract corresponding to `h_contract` into the database. + .. http:get:: /history Returns transactions up to some point in the past -- cgit v1.2.3