get-private-orders.rst (4322B)
1 .. http:get:: [/instances/$INSTANCE]/private/orders 2 3 Returns known orders up to some point in the past. 4 5 **Required permission:** ``orders-read`` 6 7 **Request:** 8 9 *Accept*: 10 The client may specify the desired MIME-type for the result. 11 Supported are the usual "application/json", but also 12 "application/vnd.ms-excel", "text/csv" and "application/pdf". 13 14 :query paid: *Optional*. If set to yes, only return paid orders, if no only unpaid orders. Do not give (or use "all") to see all orders regardless of payment status. 15 :query refunded: *Optional*. If set to yes, only return refunded orders, if no only unrefunded orders. Do not give (or use "all") to see all orders regardless of refund status. 16 :query wired: *Optional*. If set to yes, only return wired orders, if no only orders with missing wire transfers. Do not give (or use "all") to see all orders regardless of wire transfer status. 17 :query delta: *Optional*. takes value of the form ``N (-N)``, so that at most ``N`` values strictly older (younger) than ``start`` and ``date_s`` are returned. Defaults to ``-20`` to return the last 20 entries (before ``start`` and/or ``date_s``). Deprecated in protocol **v12**. Use *limit* instead. 18 :query limit: *Optional*. At most return the given number of results. Negative for descending by row ID, positive for ascending by row ID. Default is ``20``. Since protocol **v12**. 19 :query date_s: *Optional.* Non-negative date in seconds after the UNIX Epoc. Only return orders created after the specified timestamp. 20 :query max_age: *Optional.* Relative time. Only return orders younger than the specified age. Only applicable if *delta* is positive. If both *max_age* and *date_s* are given, the larger of the two applies. Since protocol **v27**. 21 :query start: *Optional*. Row number threshold, see ``limit`` for its interpretation. Defaults to ``INT64_MAX``, namely the biggest row id possible in the database. Deprecated in protocol **v12**. Use *offset* instead. 22 :query offset: *Optional*. Starting ``row_id`` for an iteration. Since protocol **v12**. 23 :query timeout_ms: *Optional*. Timeout in milliseconds to wait for additional orders if the answer would otherwise be negative (long polling). Only useful if ``limit`` is positive. Note that the merchant MAY still return a response that contains fewer than ``limit`` orders. 24 :query session_id: *Optional*. Since protocol **v6**. Filters by session ID. 25 :query fulfillment_url: *Optional*. Since protocol **v6**. Filters by fulfillment URL. 26 :query summary_filter: *Optional*. Only returns orders where the summary contains the given text as a substring. Matching is case-insensitive. Since protocol **v23**. 27 28 **Response:** 29 30 :http:statuscode:`200 OK`: 31 The response is an `OrderHistory`. 32 33 **Details:** 34 35 .. ts:def:: OrderHistory 36 37 interface OrderHistory { 38 // Timestamp-sorted array of all orders matching the query. 39 // The order of the sorting depends on the sign of ``limit``. 40 orders : OrderHistoryEntry[]; 41 } 42 43 44 .. ts:def:: OrderHistoryEntry 45 46 interface OrderHistoryEntry { 47 48 // Order ID of the transaction related to this entry. 49 order_id: string; 50 51 // Row ID of the order in the database. 52 row_id: Integer; 53 54 // When the order was created. 55 timestamp: Timestamp; 56 57 // The amount of money the order is for. If the contract 58 // has multiple choices and the user has not yet made a choice, 59 // we return the amount of the first choice. 60 amount: Amount; 61 62 // The total amount of refunds granted by the merchant. 63 // Includes refunds that the wallet did not yet pick up. 64 // Only available if the order was paid. 65 // Since **v24**. 66 refund_amount: Amount; 67 68 // The amount of refunds the customer's wallet did not yet 69 // pick up. Only available if the order was paid. 70 // Since **v24**. 71 pending_refund_amount: Amount; 72 73 // The summary of the order. 74 summary: string; 75 76 // Whether some part of the order is refundable, 77 // that is the refund deadline has not yet expired 78 // and the total amount refunded so far is below 79 // the value of the original transaction. 80 refundable: boolean; 81 82 // Whether the order has been paid or not. 83 paid: boolean; 84 }