Consumptions
Consumption object
One action in your system that can reward a user, with one or more lines.
{
"consumptionId": "I198037776491223",
"consumptionDate": "2026-04-25T12:34:00Z",
"identifiers": [
{ "key": "userId", "value": "user-uuid-12345" },
{ "key": "phoneNumber", "value": "40720005123" },
{ "key": "email", "value": "user@example.com" }
],
"consumptionLines": [
{ "sku": "example_sku_product_a", "quantity": 1 }
]
}| Field | Type | Required | Description |
|---|---|---|---|
consumptionId | string | Yes | The ID of the action in your system. Must be unique within your brand: each ID is processed once, and a repeat returns 409 if the user is found and has joined the campaign. See Errors and retries. |
consumptionDate | string | Yes | When the action happened, in ISO 8601 UTC, for example 2026-04-25T12:34:00Z. |
identifiers | array of Identifier | Yes | Who to reward. Send at least one. userId is the most reliable match. |
consumptionLines | array of Line | Yes | What happened. Send several lines for a basket with several products. |
Identifier
| Field | Type | Required | Description |
|---|---|---|---|
key | string | Yes | One of userId, phoneNumber, email, externalProfileId. |
value | string | Yes | The Wecheer user ID, phone number, email or external profile ID. |
Line
| Field | Type | Required | Description |
|---|---|---|---|
sku | string | Yes | The SKU set up for this trigger in the campaign. |
quantity | integer | Yes | Number of units, as a whole number. Decimals are rejected. Use 1 for actions such as a poll answer or a review. |
productName | string | No | Ignored. The line is always named by its SKU. |
Other accepted fields
The request also accepts unitPrice, serialNumbers and metadata.
Create consumption
Sends one consumption to reward a user.
{campaigns-base-url}/api/advertiser-integration/v1/consumptionBase URL
| Environment | Campaigns base URL |
|---|---|
| Staging | https://api.wecheer.me/staging-campaigns |
| Production | https://api.wecheer.me/campaigns |
Headers
| Header | Value | Required |
|---|---|---|
Authorization | Bearer {accessToken} | Yes |
Content-Type | application/json or application/json-patch+json | Yes |
curl -X POST 'https://api.wecheer.me/staging-campaigns/api/advertiser-integration/v1/consumption' \
-H 'accept: text/plain' \
-H 'Authorization: Bearer YOUR_ACCESS_TOKEN' \
-H 'Content-Type: application/json-patch+json' \
-d '{
"consumptionId": "I198037776491223",
"consumptionDate": "2026-04-25T12:34:00Z",
"identifiers": [ { "key": "userId", "value": "user-uuid-12345" } ],
"consumptionLines": [ { "sku": "example_sku_product_a", "quantity": 1 } ]
}'Responses
| Status | Meaning |
|---|---|
200 | Consumption accepted. |
400 | Request invalid: missing consumptionId, identifiers or body. |
401 | Token missing or expired. |
404 | User not registered, user hasn’t joined the campaign, or user has no Punch Card campaign from your brand that uses the advertiser consumption capture tool. Also returned for a repeated consumptionId in these cases. |
409 | Consumption already processed. Returned only when the user is found and has joined the campaign. |
500 | Error on Wecheer’s side. |
SSO
OpenID Connect setup
SSO is configured with your Wecheer contact, not through an API call. This is what each side provides. How the login works is described in the SSO guide.
Configuration values
| Value | Provided by | Notes |
|---|---|---|
| Redirect URL | Wecheer | One for staging and one for production. Register both in your CIAM. |
| Issuer URL | You | The OpenID Connect issuer of your Microsoft CIAM tenant. |
| Client ID and client secret | You | For the application you registered for Wecheer, per environment. |
| SSO on or off | Wecheer | Set per campaign. |
User data in the token
Wecheer reads these claim names from the ID token. They are fixed and not mapped during setup, so your identity provider must send them exactly as written.
| Data | Claim name | Required | Used for |
|---|---|---|---|
| Unique user ID | sub | Yes | Links the Wecheer profile to your user. |
| Phone number | Phone | At least one of the two | Recommended identifier. Verify it at sign-up. |
preferred_username | At least one of the two | Identifier when there is no phone number. | |
| First name, last name | given_name, family_name | No | Fills the Wecheer profile. |
| Gender | Gender | No | Fills the Wecheer profile. |
| Date of birth | DateofBirth, format dd-MM-yyyy | No | Fills the Wecheer profile. |
Events
Event envelope
Events Wecheer shares with you through Segment or a webhook. Segment events use the standard Segment track structure below. Webhooks use a different format: see Webhook format. Segment event names use Title Case with spaces and are case-sensitive: use them exactly as listed.
{
"type": "track",
"event": "EventName",
"userId": "user-uuid-12345",
"timestamp": "2026-01-15T12:34:56.789Z",
"properties": { },
"context": { "source": "wecheer", "version": "1.0" }
}Webhook format
A webhook is not sent in the Segment track format. Each request has a Security-Key header, and the body is { provider, eventType, data }, with an event type such as PointsReceived. The type, event, userId, timestamp and context fields above apply to Segment only.
{
"provider": "…",
"eventType": "PointsReceived",
"data": { }
}Consumption events
| Event | Sent when |
|---|---|
Any Consumption | A QR code is scanned or a receipt is validated |
First Consumption | The user’s first consumption in a campaign |
Consumption Match Item | A receipt item matches the campaign rules |
Points Received | Points are added to the user |
Punchcard Stamps Received | Stamps are added to a punch card |
Punchcard Step Completed | A punch card milestone is reached |
Card Received | The user receives a campaign card |
Cheercoins Updated | The user’s Cheercoins balance changes |
Example: Points Received
{
"type": "track",
"event": "Points Received",
"userId": "user-uuid-12345",
"timestamp": "2026-01-15T12:34:56.789Z",
"properties": {
"eventId": "evt-uuid-12345",
"campaignId": "camp-12345",
"points": 150,
"reason": "product_scan",
"previousBalance": 1000,
"newBalance": 1150
}
}User events
| Event | Sent when |
|---|---|
user_updated | Profile details change |
User Data Shared | The user shares data with a campaign |
UserChannelSubscriptionChanged | Communication preferences change |
Reward events
| Event | Sent when |
|---|---|
RewardCreated | A reward is added to the catalog |
CatalogRedeem | A user redeems a catalog reward. Includes the voucher code. |
Example: CatalogRedeem
{
"type": "track",
"event": "CatalogRedeem",
"userId": "user-uuid-12345",
"properties": {
"redemptionId": "redeem-uuid-12345",
"rewardId": "reward-uuid-12345",
"rewardName": "Digital voucher",
"cost": { "points": 500 },
"voucherCode": "VOUCHER-ABC123"
}
}Reference
Status codes
What to do with each code is explained in Errors and retries.
Error bodies are not the same on every response: some are plain text, some are { "message": "…" }. Unexpected errors return 500 with plain text. Check the status code first.
| Code | Status | Meaning |
|---|---|---|
200 | OK | The request succeeded. |
400 | Bad Request | The request is malformed or missing a required field. On Authorize, also a wrong API key or an unknown advertiserId. |
401 | Unauthorized | The apiKey header is empty, or the token is missing or expired. |
404 | Not Found | The user or resource doesn’t exist. |
409 | Conflict | Duplicate, for example a consumptionId already processed. |
429 | Too Many Requests | Rate limit reached. |
500 | Internal Server Error | Unexpected error on Wecheer’s side. |
Coming soon
In development
These APIs are on our roadmap. They will move into this reference, with a Changelog entry, when they are released.
Accounts In development
Create a Wecheer profile, with opt-ins, from your backend.
Reward redemptions In development
Check a reward code from your checkout, in store or online, and mark it as used.