> ## 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.

# Create Purchase

> This endpoint submits a purchase to our system for processing. Because this purchase is processed asynchronously, there is no response JSON. Please allow up to a couple minutes to receive this purchase back from the GET /purchases endpoint.

**This endpoint is only available in SANDBOX**

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

### Response

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

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

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

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

<ResponseField name="card" type="string">
  The card the user used, if it is registered in Thanx
</ResponseField>

<RequestExample>
  ```bash theme={null}
  curl https://api.thanxsandbox.com/purchases \
    -X POST \
    -H "Content-Type: application/json"  \
    -H "Accept-Version: v4.0" \
    -H "Accept: application/json" \
    -H "Authorization: Bearer ${token}" \
    -H "X-ClientId: ${client_id}" 
    -d '{
      "purchase": {
        "merchant_id":  "weoru",
        "location_id":  "hljkfd2345",
        "user_id":      "wgljsdwer23",
        "amount":       13.45,
        "purchased_at": "2020-09-15T00:52:10.655+00:00",
        "card_id":      null
      }
    }'
  ```
</RequestExample>

<ResponseExample>
  ```json theme={null}
  {}
  ```
</ResponseExample>
