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

> This endpoint submits a receipt for processing.

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

### Parameters

<ParamField body="merchant_id" type="string" required>
  Merchant ID
</ParamField>

<ParamField body="amount" type="string" required>
  The amount of the receipt
</ParamField>

<ParamField body="payment_type" type="string" required>
  (`card`, `cash`, `other`)
</ParamField>

<ParamField body="purchased_at" type="string" required>
  The timestamp of the purchase, in ISO8601
</ParamField>

<ParamField body="image_path" type="string">
  The path of the uploaded image
</ParamField>

<ParamField body="user_comments" type="string">
  Any user-entered notes
</ParamField>

<ParamField body="card_id" type="string">
  The card the user used, if it is registered in Thanx
</ParamField>

### Response

<Snippet file="entities/receipt.mdx" />

<RequestExample>
  ```bash theme={null}
  curl https://api.thanxsandbox.com/receipts \
    -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 '{
      "receipt": {
        "merchant_id": "weoru",
        "amount": 13.45,
        "payment_type": "cash",
        "purchased_at": "2020-09-15T00:52:10.655+00:00",
        "image_path": "uploads/receipts/image_5051555_1534872299.jpeg",
        "user_comments": "credit card reader was not working",
        "card_id": null
      }
    }'
  ```
</RequestExample>

<ResponseExample>
  ```json theme={null}
  {
    "receipt": {
      "id": "92b7b0dac4",
      "user_id": "weorufsdf",
      "merchant_id": "werouf",
      "state": "pending",
      "rejection_text": null,
      "amount": 13.45,
      "payment_type": "cash",
      "purchased_at": "2020-09-15T00:52:10.655+00:00",
      "submitted_at": "2020-09-15T00:55:11.876+00:00",
      "user_comments": "credit card reader was not working",
      "card_id": null,
      "image": {
        "small": "https://d1uv7brpxddy46.cloudfront.net/images/363/thumbnail/thumbnail-612c5e1821440637c0137be46d141e07.jpg?1604507010",
        "large": "https://d1uv7brpxddy46.cloudfront.net/images/363/medium/medium-612c5e1821440637c0137be46d141e07.jpg?1604507010",
        "default": "https://d1uv7brpxddy46.cloudfront.net/images/363/mobile/mobile-612c5e1821440637c0137be46d141e07.jpg?1604507010"
      }
    }
  }
  ```
</ResponseExample>
