const url = 'https://api.oletapp.com/your-store/v1/sales?limit=50&order=asc&include_deleted=false&status=completed';const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url 'https://api.oletapp.com/your-store/v1/sales?limit=50&order=asc&include_deleted=false&status=completed' \ --header 'Authorization: Bearer <token>'A delta-sync polling list: poll with the returned next_cursor to see only what changed.
Excludes open (parked) sales by default; status=open is refused. A refund is a sale carrying parent_sale_id. include_deleted is not applicable (sales are never deleted) and is refused if set.
Requires scope: sales:read
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Query Parameters
Section titled “Query Parameters”Opaque. Pass back the exact next_cursor value from a previous response; never construct one. A cursor that fails to decode is 400 VALIDATION_FAILED, in every order mode.
Opaque. Pass back the exact next_cursor value from a previous response; never construct one. A cursor that fails to decode is 400 VALIDATION_FAILED, in every order mode.
Defaults to every status except open (parked sales are register state, not returned by this API).
Defaults to every status except open (parked sales are register state, not returned by this API).
ISO-8601 datetime. Filters on completed_at.
ISO-8601 datetime. Filters on completed_at.
ISO-8601 datetime. Filters on completed_at.
ISO-8601 datetime. Filters on completed_at.
Filter to refunds of one original sale.
Filter to refunds of one original sale.
Responses
Section titled “Responses”List sales
object
object
object
Signed: positive for a surcharge, negative for a cash discount. Integer minor units (cents).
The tax charged on this adjustment. Integer minor units (cents).
Total cash-discount adjustment. Integer minor units (cents).
Reporting total: line + order + promo discount. Integer minor units (cents).
object
Cents when value_type is fixed; basis points when percent.
The line-level part of discount_total. Integer minor units (cents).
object
object
The amount of this line allocated to the discount. Integer minor units (cents).
The total discount allocated to this line. Integer minor units (cents).
The line total, net of the line discount. Integer minor units (cents).
Decimal, 3 places. Negative on a refund line.
Decimal, 3 places. Cumulative quantity refunded against this line.
The tax charged on this line. Integer minor units (cents).
The per-unit discount. Integer, 4 decimal places (1.2345 = 12345).
The snapshot unit price. Integer, 4 decimal places (1.2345 = 12345).
Total tendered. Integer minor units (cents).
object
The tender amount. Integer minor units (cents).
The cumulative amount refunded against this tender. Integer minor units (cents).
Total rounding adjustment. Integer minor units (cents).
Already net of the line discount. Integer minor units (cents).
Total surcharge adjustment. Integer minor units (cents).
Total tax charged. Integer minor units (cents).
object
The snapshot tax rate. Integer basis points (1/100 of a percent).
The tax charged at this rate. Integer minor units (cents).
The amount this rate was applied to. Integer minor units (cents).
The sale total. Integer minor units (cents).
Decimal, 3 places. Sum of line quantities.
Opaque delta-sync version. Increases with every change; use it to detect updates.
Opaque pagination cursor. Pass back as ?cursor= to fetch the next page.
Example
{ "data": [ { "adjustments": [ { "type": "surcharge" } ], "discounts": [ { "allocation_method": "across", "source": "manual_line", "target_type": "line_item", "value_type": "percent" } ], "payments": [ { "entry_mode": "chip", "status": "pending" } ], "status": "open" } ]}default
Section titled “default”An error response.
object
object
A machine-readable error code, e.g. VALIDATION_FAILED.
object
A plain-English sentence describing what went wrong.
Example
{ "error": { "code": "UNAUTHORIZED" }}