Claim Receipt


Request Details

Item Value
Description Allows clients to replicate the Fan Center claim receipt process via API. This API is used for clients with the CrowdTwist Purchase V1 integration.
Method POST
Endpoint – Online https://api.crowdtwist.com/v2/claim_receipt/online?api_key=[api_key]
Endpoint – In store https://api.crowdtwist.com/v2/claim_receipt/in_store?api_key=[api_key]
Content Type: JSON (application/json)


Request

Field Name Sample Value Required Format Notes
URL PARAMETERSnone
QUERY STRING PARAMETERS
api_key QWERTYUIOP Yes String  

Request Body

Field Name Sample Value Required Format Notes
user_id   Yes Integer The id of the user claiming this receipt
receipt_number   Yes String The number or identifier of the receipt to be claimed
receipt_total   Yes Integer The total purchase value of the receipt to be claimed
store_number   Yes, for in store String The number or identifier of the store that this purchase was made
date_purchased   Yes, for in store Unix Timestamp The date this purchased occurred


Successful Response

Field Name Sample Value Required Format Description
points 1000 Yes Integer Number of points earned for the transaction


Error Response

Field Name Sample Value Required Format Description
error param_error Yes String Missing the user_id parameter.
message Missing the user_id parameter. Yes String A short, descriptive sentence detailing the error.


Error Response Codes

Error Message
input_error The input provided in invalid or formatted incorrectly.
internal_error Something went wrong on our end.
page_not_found The requested page does not exist or has been removed.
param_error A missing or invalid parameter is included in the request.


Sample Request – Online

curl -X POST
https://api.crowdtwist.com/v2/claim_receipt/online?api_key=QWERTYUIOP
{
    "user_id":1,
    "receipt_number":"123abc",
    "receipt_total":100.50
}
  
curl -X POST
https://api.crowdtwist.com/v2/claim_receipt/online?api_key=QWERTYUIOP
{
    "user_id":1,
    "receipt_number":"123abc",
    "receipt_total":100.50
}
  

Sample Request – In Store

curl -X POST
https://api.crowdtwist.com/v2/claim_receipt/in_store?api_key=QWERTYUIOP
{
    "user_id":1,
    "receipt_number":"123abcd",
    "receipt_total":100.50,
    "store_number":"456def",
    "date_purchased":1479136508
}
curl -X POST
https://api.crowdtwist.com/v2/claim_receipt/in_store?api_key=QWERTYUIOP
{
    "user_id":1,
    "receipt_number":"123abcd",
    "receipt_total":100.50,
    "store_number":"456def",
    "date_purchased":1479136508
}


Sample Successful Response: Status Code 200

{
  "points": "1000"
}
{
  "points": "1000"
}

Sample Error Response: Status Code 400

{
  "error": "input_error",
  "message": "Invalid receipt provided."
}
{
  "error": "input_error",
  "message": "Invalid receipt provided."
}
{
  "error": "input_error",
  "message": "Receipt has already been claimed."
}
{
  "error": "input_error",
  "message": "Receipt has already been claimed."
}
{
  "error": "input_error",
  "message": "Unable to claim receipt for this user."
}
{
  "error": "input_error",
  "message": "Unable to claim receipt for this user."
}