Lantern
REST APILoyalty API

Get Purchase History

Retrieves the customer's purchase history and total spend for the current calendar year. Used for tier qualification calculations. The calculation considers the customer's enrollment date to ensure accurate spend tracking.

GET
/purchase-history/

Query Parameters

include_orders?boolean

Whether to include individual order details.

Defaultfalse
limit?integer

Max orders to return if include_orders=true (max: 50).

Default20
Formatint32
offset?integer

Orders to skip for pagination if include_orders=true.

Default0
Formatint32

Response Body

application/json

application/json

application/json

curl -X GET "https://yourstore.myshopify.com/a/lantern/purchase-history/"
{
  "currentYear": 2026,
  "enrollmentDate": "2025-03-15T00:00:00.000Z",
  "calculationStartDate": "2026-01-01T00:00:00.000Z",
  "totalSpend": 1250.5,
  "orderCount": 15,
  "currency": "USD",
  "orders": [
    {
      "id": "6842969882865",
      "name": "#1035",
      "orderNumber": 1035,
      "date": "2026-01-27T23:56:50.583Z",
      "total": "85.95",
      "pointsEarned": 258,
      "spend": 85.95
    }
  ],
  "ordersPagination": {
    "total": 50,
    "limit": 20,
    "offset": 0,
    "hasMore": true
  }
}
{
  "error": "Invalid app proxy request"
}
{
  "error": "Customer not found",
  "customerId": "7234567890123"
}