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

# Get Purchase

> This endpoint returns the purchase associated with the id in the path.

<Note>
  Please review proper request headers [here](/consumer/usage/headers).
</Note>

### Parameters

<ParamField path="id" type="string">
  The purchase ID
</ParamField>

### Response

<ResponseField name="id" type="string">
  The purchase ID
</ResponseField>

<ResponseField name="user_id" type="string">
  The user ID
</ResponseField>

<ResponseField name="merchant_id" type="string">
  The merchant ID
</ResponseField>

<ResponseField name="location_id" type="string">
  Location ID
</ResponseField>

<ResponseField name="purchased_at" type="string">
  Time the purchase was made in ISO8601-format
</ResponseField>

<ResponseField name="amount" type="decimal">
  The purchase amount
</ResponseField>

<ResponseField name="order" type="hash">
  Provides information about the associated order, if any

  <Expandable title="order">
    <ResponseField name="id" type="string">
      The ID of the order in the provider's system
    </ResponseField>

    <ResponseField name="provider" type="enum">
      The online ordering provider (`OLO`, `Toast`, `Other`)
    </ResponseField>
  </Expandable>
</ResponseField>

<RequestExample>
  ```bash Get Purchease theme={null}
  curl https://api.thanxsandbox.com/purchases/:id \
    -X GET \
    -H "Content-Type: application/json"  \
    -H "Accept-Version: v4.0" \
    -H "Accept: application/json" \
    -H "Authorization: Bearer ${token}" \
    -H "X-ClientId: ${client_id}" 
  ```
</RequestExample>

<ResponseExample>
  ```json theme={null}
  {
    "purchase": {
      "id": "92b7b0dac4",
      "user_id": "weori235",
      "merchant_id": "9a1f0772c9ac",
      "location_id": "e7183da044",
      "purchased_at": "2020-01-01T20:00:00Z",
      "amount": 9.99,
      "order": {
        "provider": "OLO",
        "id": "YWEI2342F"
      }
    }
  }
  ```
</ResponseExample>
