List your purchases
What you have bought on Cru, by order line, newest first, with each order’s status, invoice and units.
Query parameters
ALL OPTIONAL| PARAMETER | DESCRIPTION |
|---|---|
| lwinstring · CSV · ≤ 20 | Only these wines: up to 20 comma-separated 18-digit LWIN18 codes. Anything else is refused with VALIDATION_INVALID_VALUE. |
| statusstring · CSV | Only order lines with a unit in any of these states, comma-separated, in any case: in_portfolio, for_sale, sold, in_transit or delivered, as units[].status gives them. A line with no units stored with Cru matches none. Anything else is refused with VALIDATION_UNSUPPORTED_VALUE. |
| sortstring | What to order by: traded_at, the date of the order, the only choice. Default: traded_at |
| directionstring | desc for newest first, or asc for oldest first. Default: desc |
| limitinteger · 1–250 | Number of purchases to return. A larger value is refused with VALIDATION_INVALID_VALUE, not reduced. Default: 50 |
| offsetinteger · ≥ 0 | Number of purchases to skip. Default: 0 |
GET /trades is gone, and returns NOT_FOUND / 404. What you bought is GET /trades/purchases, in data.purchases, and what you sold GET /trades/sales, in data.sales. Neither has side, as a field or a parameter: sending side returns VALIDATION_UNKNOWN_PARAMETER / 400. Both take sort and direction, and a status filter of their own; sales also filter by deliverable_warehouse_code.
A purchase is what GET /trades called a buy, without side. After traded_at it now has order_status, order_url, invoice_number, invoice_url and units, the units of it stored with Cru.
order_url and invoice_url are pages on the Cru site the order was placed on, for the customer signed in there: an API key or access token does not open them. Show them to the customer rather than fetching them.
Response fields
200 OK · pageddata.purchases, newest first unless direction is asc. price and total are in each purchase’s own currency. meta.pagination counts order lines.
Each item in purchases[]
lwin18string
The 18-digit LWIN: wine, vintage and pack together. Match on all 18 digits.
wine_namestring | null
Cru’s name for the wine.
vintageinteger | null
The vintage year. 1000 means non-vintage.
pack_sizestring | null
Pack format, for example 6x75cl.
quantityinteger
Units in this order line, less any cancelled or refunded.
pricenumber
What you paid per unit.
totalnumber
price × quantity.
currencystring
The order’s currency, which price and total are in as they were paid: never converted.
referencestring
The Cru order number, which each line of the order shows. A purchase has no id of its own.
traded_atdatetime
When the order was placed, RFC 3339 UTC.
order_statusstring | null
The order’s status, as Cru’s site labels it, such as “Paid and Processing”.
order_urlstring
The order’s page on Cru Markets, on the site it was placed on. It opens for the customer signed in to Cru, not with an API key or token.
invoice_numberstring | null
The order’s first invoice. null until the order is invoiced.
invoice_urlstring | null
That invoice as a PDF, on the Cru site the order was placed on. Like order_url, it opens only for the customer signed in to Cru. null until the order is invoiced.
unitsarray<object>
Each unit of this line stored with Cru, one per bottle or case, lowest cru_id first. [] when none of it is.
Each item in units[]
cru_idinteger | null
The unit’s Cru ID.
warehouse_refstring | null
Its reference at the warehouse: the Warehouse ID on Cru’s site.
deliverable_warehouse_codestring | null
The Cru warehouse it is in: UK_DRAK, HK_KERRY, SG_TOLL, FR_DARTESS, US_NAPA.
condition_statusstring | null
The unit’s condition status: verified (Verified), client_reserves (Client Reserve) or apd (As per description).
statusstring
Where it is now, as the status filter takes it: in_portfolio, still in your portfolio and not listed; for_sale, listed; sold; in_transit; or delivered, taken out of Cru’s storage.
Errors
An lwin that is not 18-digit LWIN18 codes, or more than 20 of them, returns VALIDATION_INVALID_VALUE / 422. A status other than in_portfolio, for_sale, sold, in_transit or delivered, a sort other than traded_at, or a direction other than desc or asc returns VALIDATION_UNSUPPORTED_VALUE / 422. Missing or invalid credentials return AUTH_INVALID_CREDENTIALS / 401. A credential without trades:read gets AUTH_INSUFFICIENT_SCOPE / 403. View all error codes →