POST
/
receipts
curl https://api.thanxsandbox.com/receipts \
  -X POST \
  $AUTH_HEADERS
  -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
    }
  }'
{
  "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"
    }
  }
}

Parameters

merchant_id
string
required

Merchant ID

amount
string
required

The amount of the receipt

payment_type
string
required

(card, cash, other)

purchased_at
string
required

The timestamp of the purchase, in ISO8601

image_path
string

The path of the uploaded image

user_comments
string

Any user-entered notes

card_id
string

The card the user used, if it is registered in Thanx

Response

id
string

The receipt ID

merchant_id
string

Merchant ID

user_id
string

User ID

state
enum

The processing state of the receipt (pending, processing, applied, denied)

rejection_text
string

If the receipt is denied, the reason provided

amount
decimal

The amount of the receipt

payment_type
enum

(card, cash, other)

purchased_at
string

The timestamp of the purchase, in ISO8601

submitted_at
string

When the user submitted the receipt, in ISO8601

user_comments
string

Any user-entered notes

card_id
string

The card the user used, if it is registered in Thanx

image
hash

The uploaded receipt image information

curl https://api.thanxsandbox.com/receipts \
  -X POST \
  $AUTH_HEADERS
  -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
    }
  }'
{
  "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"
    }
  }
}