List recent events
const url = 'https://api.oletapp.com/your-store/v1/events?limit=50&order=asc&include_deleted=true&type=sale.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/events?limit=50&order=asc&include_deleted=true&type=sale.completed' \ --header 'Authorization: Bearer <token>'Returns recent events in the same envelope a webhook delivers: id, type, created_at, truncated and data. Use it to see a sample payload while building an integration, or to catch up after missed deliveries. Events are kept for 30 days.
- Ordering:
order=ascwalks forward withnext_cursor.order=descreturns only the newest events, first page only. datais the resource as it is now, not as it was when the event happened, and a customer who has opted out of data sharing appears as{ "id" }only.- An event whose resource has since been removed is left out, so a page can hold fewer than
limititems whilehas_moreis stilltrue. - Scopes: each event needs the read scope of its resource (
sales:read,customers:read,catalog:readorinventory:read). Withtype, a credential without that scope gets403 INSUFFICIENT_SCOPE. Withouttype, only events the credential may read are returned, and a credential with none of those scopes gets an empty list. include_deletedis not applicable and is refused if set.
Requires scope: any
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.
Only events of this type. Needs the read scope of the type’s resource.
Only events of this type. Needs the read scope of the type’s resource.
Responses
Section titled “Responses”List recent events
object
object
When the change was detected.
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.
object
YYYY-MM-DD, or null.
Read-only. Set only through the admin UI or a DSAR request, never through this API.
True for the retailer’s single system walk-in customer.
The customer’s account credit limit. Integer minor units (cents).
Opaque delta-sync version. Increases with every change; use it to detect updates.
object
object
object
The retail price. Integer minor units (cents).
Live supplier links for this product. Never carries supply_price; use the admin UI or an export for cost data.
object
This supplier link’s own id, not the supplier’s id. Distinct from supplier_id below.
Whether this is the product’s primary supplier.
This retailer’s own code for the product at this supplier, if set.
The linked supplier’s id.
The supplier name as of this document.
Tags attached to this product, with names.
object
The tag’s own id, usable to reference it elsewhere.
The tag name as of this document.
Present on a variant parent product; empty on a variant child or an ordinary product.
object
The variant attribute’s id. A variant child’s variant_options reference it as attribute_id.
The attribute name, for example Size or Colour.
Display order among this product’s variant attributes.
object
Opaque delta-sync version. Increases with every change to this document: its own fields, and the addition, removal, or edit of a code, tag link, supplier link, variant option, variant attribute, or component, including when an attached tag or supplier is itself renamed. Use it to detect updates.
object
Current stock level. Up to 3 decimal places.
Delta-sync version, as a string (bigint).
Only the id, when the full document is withheld or too large.
object
The event id. It is the same on every retry and for every webhook of the event; receivers dedupe on it.
True when data was cut down to the id because the document was too large.
Opaque pagination cursor. Pass back as ?cursor= to fetch the next page.
Example
{ "data": [ { "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" }, "type": "sale.completed" } ]}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" }}