diff --git a/docs/source/interface.rst b/docs/source/interface.rst index d899f5451e189313737baeccaa11ff82fd9049db..5255a96f3f5aa259a5633c1bffb1f5c28bab85e6 100644 --- a/docs/source/interface.rst +++ b/docs/source/interface.rst @@ -32,7 +32,11 @@ If the voucher is not known then the response is **NOT FOUND**. For any voucher which has previously been submitted, the response is **OK** with an ``application/json`` content-type response body like:: - {"value": <string>, "created": <iso8601 timestamp>, "redeemed": <boolean>, "token-count": <number>, "version": 1} + { "value": <string> + , "created": <iso8601 timestamp> + , "state": <state object> + , "version": 1 + } The ``value`` property merely indicates the voucher which was requested. The ``created`` property indicates when the voucher was first added to the node. @@ -42,6 +46,39 @@ The ``token-count`` property gives the number of blinded token signatures the cl if it has been redeemed. If it has not been redeemed then it is ``null``. +The ``state`` property is an object that gives more details about the current state of the voucher. +The following values are possible:: + + { "name": "pending" + } + + { "name": "redeeming" + , "started": <iso8601 timestamp> + } + + { "name": "error" + , "started": <iso8601 timestamp> + , "error-at": <iso8601 timestamp> + , "next-try-at": <iso8601 timestamp> + , "error-details": <text> + } + + { "name": "unpaid" + , "started": <iso8601 timestamp> + , "error-at": <iso8601 timestamp> + } + + { "name": "double-spend" + , "started": <iso8601 timestamp> + , "error-at": <iso8601 timestamp> + } + + { "name": "redeemed" + , "started": <iso8601 timestamp> + , "finished": <iso8601 timestamp> + , "token-count": <number> + } + The ``version`` property indicates the semantic version of the data being returned. When properties are removed or the meaning of a property is changed, the value of the ``version`` property will be incremented.