From c028b2d151aaacb446035638379f565e8e5c30cd Mon Sep 17 00:00:00 2001 From: Jonathan Buchanan Date: Fri, 5 Jun 2020 13:29:09 -0400 Subject: spec for GET /tips --- core/api-merchant.rst | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) (limited to 'core') diff --git a/core/api-merchant.rst b/core/api-merchant.rst index 317480f3..3bde039d 100644 --- a/core/api-merchant.rst +++ b/core/api-merchant.rst @@ -1955,6 +1955,50 @@ Giving Customer Tips expiration: Timestamp; } + + +.. http:get:: /tips + + Return the list of all tips. + + **Request:** + + :query expired: *Optional*. If set to "yes", the response also includes + tips that have expired. Otherwise only unexpired tips are returned. + + **Response:** + + :status 200 OK: + The backend has successfully found the list of tips. The backend responds + with a `TipsResponse`. + + .. ts:def:: TipsResponse + + interface TipsResponse { + + // List of tips that are present in the backend. + tips: Tip[]; + } + + .. ts:def:: Tip + + interface Tip { + + // Unique identifier for the tip. + tip_id: HashCode; + + // Exchange from which the tip will be withdrawn. + exchange_url: string; + + // (remaining) amount of the tip (including fees). + tip_amount: Amount; + + // Timestamp indicating when the tip is set to expire (may be in the past). + expiration: Timestamp; + } + + + .. http:post:: /tips/$TIP_ID/pickup Handle request from wallet to pick up a tip. -- cgit v1.2.3