> ## Documentation Index
> Fetch the complete documentation index at: https://developers.mageloyalty.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Get earning history entry

> Get a single earning history entry.

Get a single earning history entry by its ID. Validates that the entry belongs to the given customer and shop.

## Response

Returns a single [earning history entry](/api-reference/customers/list-earning-history) object.

## Errors

| Status | Scenario                                                              |
| ------ | --------------------------------------------------------------------- |
| `404`  | Entry or customer not found                                           |
| `429`  | [Rate limit](/api-reference/rate-limits) exceeded (6 requests/second) |

<RequestExample>
  ```bash cURL theme={null}
  curl --request GET \
    --url https://api.mageloyalty.com/v1/customers/6789012345/earning-history/entry_abc \
    --header 'Authorization: <api-key>'
  ```

  ```javascript Node theme={null}
  const response = await fetch(
    "https://api.mageloyalty.com/v1/customers/6789012345/earning-history/entry_abc",
    {
      method: "GET",
      headers: { Authorization: "<api-key>" },
    }
  );

  const data = await response.json();
  ```

  ```python Python theme={null}
  import requests

  response = requests.get(
      "https://api.mageloyalty.com/v1/customers/6789012345/earning-history/entry_abc",
      headers={"Authorization": "<api-key>"},
  )

  data = response.json()
  ```

  ```php PHP theme={null}
  <?php
  $ch = curl_init("https://api.mageloyalty.com/v1/customers/6789012345/earning-history/entry_abc");
  curl_setopt_array($ch, [
      CURLOPT_RETURNTRANSFER => true,
      CURLOPT_HTTPHEADER => ["Authorization: <api-key>"],
  ]);
  $data = json_decode(curl_exec($ch), true);
  ```
</RequestExample>

<ResponseExample>
  ```json 200 OK theme={null}
  {
    "data": {
      "type": "earning_history_entry",
      "id": "entry_abc",
      "attributes": {
        "earning_rule_id": "rule_abc",
        "action": "purchase",
        "points": 150,
        "base_points": 100,
        "points_multiplier": 1.5,
        "status": "approved",
        "order_id": "5678901234",
        "order_number": "#1042",
        "points_due_at": null,
        "points_given_at": "2024-06-01T12:05:00.000Z",
        "points_expiry_at": null,
        "created_at": "2024-06-01T12:00:00.000Z",
        "updated_at": "2024-06-01T12:05:00.000Z"
      }
    }
  }
  ```

  ```json 404 Not Found theme={null}
  {
    "errors": [
      {
        "status": "404",
        "title": "Not Found",
        "detail": "Earning history entry 'entry_abc' not found"
      }
    ]
  }
  ```
</ResponseExample>
