Points Expiration

Request Details

Item Value
Description This endpoint is used to get details of points expiring for a specific member based on point expiration rules.
Method GET
Endpoint https://[environment]api[client_id].crowdtwist.com/v2/users/[user_id]/points_expiration?api_key=[api_key]&id_type=[id_type]
HTTP Header X-CT-Authorization = CTApiKey [API Key]
Note: there is a space between CTApiKey and the API Key value

Request

Field Name Sample Value Required Format Description
URL PARAMETERS
user_id 11138266 Yes String Unique ID of the user for whom the points expiration data needs to be returned. Unique ID can be any of the below:
– Email Address
– Facebook User ID
– Twitter User ID
– CrowdTwist ID
– Third Party ID
– Username
– Mobile Phone Number
Note: This should be similar to all other API Calls
QUERY PARAMETERS
api_key EHhs183jsu Yes String Unique API key of the client.
id_type email No String Id type of the user needs to be specified if default crowdtwist id is not used. Type of ID:
– email
– third_party_id
– mobile_phone_number
– facebook_user_id
– twitter_user_id
– id (CrowdTwist ID) – default ID if id_type is not specified
– username

Response

Response Body

Field Name Sample Value Required Format Description
inactivity_
points_expiration

See the INACTIVITY POINT 
EXPIRATION ARRAY
 section.

No Array The array is present if point expiration rule is set to - Point Expire after a period of inactivity.

redemption_period_
points_expiration

See the REDEMPTION PERIOD POINT 
EXPIRATION ARRAY
section.

No

Array

The array is present if point expiration rule is set to - Point Expire after a set of redemption period. The array will show point details for 6 month forward period, current month and 3 month trailing period.

INACTIVITY POINT EXPIRATION ARRAY

last_qualified_date

2021-05-20T18:25:43.511-04:00

Yes

String

The UTC date & time the of the last qualifying activity performed. This date must be an ISO-8601 compliant date field.

expiration_date

2021-05-20T18:25:43.511-04:00

Yes

String

The UTC date & time when the points will be expired. This date must be an ISO-8601 compliant date field.

days_until_expiry

50

Yes

Integer

Number of days left after which points will be expired for inactivity period.

points_expiring 200 Yes Integer Number of points that will be expiring if qualified activity is not performed.

REDEMPTION PERIOD POINT EXPIRATION ARRAY

points_expired 0 Yes Integer Number of points expired in the given month. It will be 0 for future months.
points_expiring 100 Yes Integer Number of points expiring in the given month. It will be 0 for trailing months.
points_redeemed 40 Yes Integer Number of points redeemed in the given month.

expiration_date

2021-05-20T18:25:43.511-04:00

Yes

String

The UTC date & time the of points expiration per month. This date must be an ISO-8601 compliant date field.


Error Responses

Field Name Sample Value Required Format Description
error Field value is empty. Yes String This is a short form of the error.
message Value of field [fieldname] must not be empty. Yes String This is a detailed message around the error specifying, as specifically as possible, what the fields are that are missing or where exactly the error is.


Error Response Codes

Error Error Code Description Reason
Input Error 4xx Returned whenever the request is missing required fields, including situations in which the body is malformed (e.g. HTTP method not supported, receipt not found, etc.). – missing_data
– not_unique
– receipt_not_found
– invalid_amount
– invalid_currency
– invalid_date
– invalid_custom_field
– invalid
Server Error 5xx HTTP error status code is returned due to an error that occurred in the backend. – internal_error: unexpected error occurred in the CrowdTwist backend
– missing_field
– invalid_data
– not_configured: error occurs when an configuration has not been configured yet


Example Response Codes

Response Code Error Message
200 page_not_found Unable to find points expiration configuration.
403 invalid_auth Invalid access credentials.
404 page_not_found Unable to find user.
500 internal_error An error has occurred.

Samples

Sample Request Body

curl -X GET https://api.crowdtwist.com/v2/users/alice@crowdtwist.com/points_expiration?api_key=QWERTYUIOP&id_type=email


Sample Response Body

When Point expiration rule is set to - Points Expire after a set redemption period.

{ "redemption_period_points_expiration": [ { "points_expired": 100, "points_expiring": 0, "points_redeemed": 0, "expiration_date": "2022-02-28T00:00:00.000Z" }, { "points_expired": 0, "points_expiring": 0, "points_redeemed": 0, "expiration_date": "2022-03-31T00:00:00.000Z" }, { "points_expired": 200, "points_expiring": 0, "points_redeemed": 0, "expiration_date": "2022-04-30T00:00:00.000Z" }, { "points_expired": 0, "points_expiring": 1000, "points_redeemed": 0, "expiration_date": "2022-05-31T00:00:00.000Z" }, { "points_expired": 0, "points_expiring": 3013, "points_redeemed": 120, "expiration_date": "2022-06-30T11:00:00.000Z" }, { "points_expired": 0, "points_expiring": 2000, "points_redeemed": 0, "expiration_date": "2022-07-31T00:00:00.000Z" }, { "points_expired": 0, "points_expiring": 0, "points_redeemed": 0, "expiration_date": "2022-08-31T00:00:00.000Z" }, { "points_expired": 0, "points_expiring": 0, "points_redeemed": 0, "expiration_date": "2022-09-30T00:00:00.000Z" }, { "points_expired": 0, "points_expiring": 1000, "points_redeemed": 0, "expiration_date": "2022-10-31T00:00:00.000Z" }, { "points_expired": 0, "points_expiring": 0, "points_redeemed": 0, "expiration_date": "2022-11-30T00:00:00.000Z" } ], "inactivity_points_expiration": [] }


When Point expiration rule is set to - Points Expire after a period of inactivity.

{ "redemption_period_points_expiration": [], "inactivity_points_expiration": [ { "last_qualified_date": "2022-05-25T08:45:41.000Z", "expiration_date": "2023-05-25T08:45:41.000Z", "days_until_expiry": 365, "points_expiring": 200 } ] }


When Multi Point expiration rules are set and member has points across different expiration rules.

{ "redemption_period_points_expiration": [ { "points_expired": 100, "points_expiring": 0, "points_redeemed": 0, "expiration_date": "2022-02-28T00:00:00.000Z" }, { "points_expired": 0, "points_expiringpoin": 0, "points_redeemed": 0, "expiration_date": "2022-03-31T00:00:00.000Z" }, { "points_expired": 200, "points_expiring": 0, "points_redeemed": 0, "expiration_date": "2022-04-30T00:00:00.000Z" }, { "points_expired": 0, "points_expiring": 1000, "points_redeemed": 0, "expiration_date": "2022-05-31T00:00:00.000Z" }, { "points_expired": 0, "points_expiring": 3013, "points_redeemed": 120, "expiration_date": "2022-06-30T11:00:00.000Z" }, { "points_expired": 0, "points_expiring": 2000, "points_redeemed": 0, "expiration_date": "2022-07-31T00:00:00.000Z" }, { "points_expired": 0, "points_expiring": 0, "points_redeemed": 0, "expiration_date": "2022-08-31T00:00:00.000Z" }, { "points_expired": 0, "points_expiring": 0, "points_redeemed": 0, "expiration_date": "2022-09-30T00:00:00.000Z" }, { "points_expired": 0, "points_expiring": 1000, "points_redeemed": 0, "expiration_date": "2022-10-31T00:00:00.000Z" }, { "points_expired": 0, "points_expiring": 0, "points_redeemed": 0, "expiration_date": "2022-11-30T00:00:00.000Z" } ], "inactivity_points_expiration": [ { "last_qualified_date": "2022-05-25T08:45:41.000Z", "expiration_date": "2023-05-25T08:45:41.000Z", "days_until_expiry": 365, "points_expiring": 200 } ] }


Sample Error Response

{ "error": "invalid_auth", "message": "Invalid access credentials." }