Skip to main content
GET
/
v1
/
customers
/
{identifier}
/
earning-history
List earning history
curl --request GET \
  --url https://api.mageloyalty.com/v1/customers/{identifier}/earning-history \
  --header 'Authorization: <api-key>'
List a customer’s point earning history. The identifier can be a Shopify customer ID or email.

Query parameters

ParameterTypeDescription
filter[status]stringFilter by status: pending, approved, rejected
sortstringSort field. Prefix with - for descending. Options: created_at, points, points_given_at. Default: -created_at
page[number]integerPage number (default: 1)
page[size]integerResults per page (default: 20, max: 100)

Response

{
  "data": [
    {
      "type": "earning_history_entry",
      "id": "entry_abc",
      "attributes": {
        "earning_rule_id": "rule_abc",
        "action": "place_order",
        "points": 150,
        "base_points": 100,
        "points_multiplier": 1.5,
        "status": "approved",
        "order_id": "5678901234",
        "order_number": "#1042",
        "shopify_date": "2024-06-01T12:00:00.000Z",
        "points_due_at": null,
        "points_given_at": "2024-06-01T12:05:00.000Z",
        "points_expiry_at": null,
        "manual_intervention": false,
        "created_at": "2024-06-01T12:00:00.000Z",
        "updated_at": "2024-06-01T12:05:00.000Z"
      }
    }
  ],
  "meta": {
    "total": 12,
    "page": 1,
    "per_page": 20,
    "total_pages": 1
  }
}