User Receipt Submit

Request Details

Item Value
Description The receipt scanning feature allows members to upload receipt images in order to earn points for specific item purchases. Receipts can be submitted through the Upload Receipt widget or by leveraging the API workflow outlined below. API support for receipt scanning is particularly useful for clients looking to integrate receipt scanning into their native mobile apps.

*This feature requires a configured receipt scanning program.*

Method POST
Endpoint https://[environment]api[client_id].crowdtwist.com/v2/users/[user_id]/receipts/submit
Content Type application/json

Request

Field Name Sample Value Required Format Notes
URL PARAMETERS
user_id alice@crowdtwist.com Yes String Unique ID of the user for whom activities will be returned:
Options:
– Email Address
– Facebook User ID
– Twitter User ID
– CrowdTwist ID
– Third Party ID
– Username
– Mobile Phone Number
QUERY STRING PARAMETERS
api_key QWERTYUIOP Yes String
id_type email No String Type of ID being Sent:
Options:
– email
– facebook_user_id
– twitter_user_id
– id (CrowdTwist ID) – default ID if id_type is not specified
– third_party_id
– username
– mobile_phone_number
REQUEST BODY PARAMETERS
file_id 283f26e2be62866cb06c40886cd11c9fa2396385 Yes String The file id to be submitted for receipt processing. Obtained by uploading a receipt image to the File Upload Endpoint

Samples

Sample Request

{ "file_id": "283f26e2be62866cb06c40886cd11c9fa2396385" }


Sample Response Body

{ "id": 19382, "message": "Receipt successfully submitted for processing." }


Sample Error Response: Status Code 400 – Receipt Scan Program Not Activated

{ "error": "receipt_scanning_inactive", "message": "Receipt scanning is not active for this program." }


Sample Error Response: Status Code 400 – Unaccepted File Type

{ "error": "invalid_file_type", "message": "The provided file must be a jpg or jpeg." }


Sample Error Response: Status Code 400 – file_id Not Provided

{ "error": "file_id_required", "message": "A file id is required" }


Sample Error Response: Status Code 404 – file_id Provided Cannot be Found

{ "error": "file_not_found", "message": "The provided file id does not exist." }


Sample Error Response: Status Code 404 – User Provided Cannot be Found

{ "error": "user_not_found", "message": "User does not exist or is inactive." }