Authentication

Authorize

Exchanges your API key and secret for an access token. Send the token as Authorization: Bearer {accessToken} on every other call.

Wecheer issues one apiKey, apiSecret and advertiserId per brand and per environment. Keep them on your server only.

POST{user-management-base-url}/api/advertiser/v1/authorize

Base URL

EnvironmentUser management base URL
Staginghttps://api.wecheer.me/staging-user-management
Productionhttps://api.wecheer.me/user-management

Headers

HeaderValueRequired
apiKeyYour API keyYes
apiSecretYour API secretYes
Content-Typeapplication/json or application/json-patch+jsonYes

Body

FieldTypeRequiredDescription
advertiserIdstringYesYour brand’s ID on Wecheer, shared at onboarding.
cURL
curl -X POST 'https://api.wecheer.me/staging-user-management/api/advertiser/v1/authorize' \
  -H 'accept: text/plain' \
  -H 'apiKey: YOUR_API_KEY' \
  -H 'apiSecret: YOUR_API_SECRET' \
  -H 'Content-Type: application/json-patch+json' \
  -d '{ "advertiserId": "YOUR_ADVERTISER_ID" }'

Response

JSON · 200
{
  "accessToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
  "advertiserId": "YOUR_ADVERTISER_ID"
}

The access token expires after 1 hour. Call Authorize again to get a new one.

StatusMeaning
200Success. The body holds the access token.
400The request is invalid, for example a missing advertiserId. A wrong API key or an unknown advertiserId also returns 400, with the message Error creating token. Error id …
401The apiKey header is empty.

Consumptions

Consumption object

One action in your system that can reward a user, with one or more lines.

JSON
{
  "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 }
  ]
}
FieldTypeRequiredDescription
consumptionIdstringYesThe 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.
consumptionDatestringYesWhen the action happened, in ISO 8601 UTC, for example 2026-04-25T12:34:00Z.
identifiersarray of IdentifierYesWho to reward. Send at least one. userId is the most reliable match.
consumptionLinesarray of LineYesWhat happened. Send several lines for a basket with several products.

Identifier

FieldTypeRequiredDescription
keystringYesOne of userId, phoneNumber, email, externalProfileId.
valuestringYesThe Wecheer user ID, phone number, email or external profile ID.

Line

FieldTypeRequiredDescription
skustringYesThe SKU set up for this trigger in the campaign.
quantityintegerYesNumber of units, as a whole number. Decimals are rejected. Use 1 for actions such as a poll answer or a review.
productNamestringNoIgnored. 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.

POST{campaigns-base-url}/api/advertiser-integration/v1/consumption

Base URL

EnvironmentCampaigns base URL
Staginghttps://api.wecheer.me/staging-campaigns
Productionhttps://api.wecheer.me/campaigns

Headers

HeaderValueRequired
AuthorizationBearer {accessToken}Yes
Content-Typeapplication/json or application/json-patch+jsonYes
cURL
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

StatusMeaning
200Consumption accepted.
400Request invalid: missing consumptionId, identifiers or body.
401Token missing or expired.
404User 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.
409Consumption already processed. Returned only when the user is found and has joined the campaign.
500Error 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

ValueProvided byNotes
Redirect URLWecheerOne for staging and one for production. Register both in your CIAM.
Issuer URLYouThe OpenID Connect issuer of your Microsoft CIAM tenant.
Client ID and client secretYouFor the application you registered for Wecheer, per environment.
SSO on or offWecheerSet 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.

DataClaim nameRequiredUsed for
Unique user IDsubYesLinks the Wecheer profile to your user.
Phone numberPhoneAt least one of the twoRecommended identifier. Verify it at sign-up.
Emailpreferred_usernameAt least one of the twoIdentifier when there is no phone number.
First name, last namegiven_name, family_nameNoFills the Wecheer profile.
GenderGenderNoFills the Wecheer profile.
Date of birthDateofBirth, format dd-MM-yyyyNoFills 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.

JSON
{
  "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.

JSON
{
  "provider": "…",
  "eventType": "PointsReceived",
  "data": { }
}

Consumption events

EventSent when
Any ConsumptionA QR code is scanned or a receipt is validated
First ConsumptionThe user’s first consumption in a campaign
Consumption Match ItemA receipt item matches the campaign rules
Points ReceivedPoints are added to the user
Punchcard Stamps ReceivedStamps are added to a punch card
Punchcard Step CompletedA punch card milestone is reached
Card ReceivedThe user receives a campaign card
Cheercoins UpdatedThe user’s Cheercoins balance changes

Example: Points Received

JSON
{
  "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

EventSent when
user_updatedProfile details change
User Data SharedThe user shares data with a campaign
UserChannelSubscriptionChangedCommunication preferences change

Reward events

EventSent when
RewardCreatedA reward is added to the catalog
CatalogRedeemA user redeems a catalog reward. Includes the voucher code.

Example: CatalogRedeem

JSON
{
  "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.

CodeStatusMeaning
200OKThe request succeeded.
400Bad RequestThe request is malformed or missing a required field. On Authorize, also a wrong API key or an unknown advertiserId.
401UnauthorizedThe apiKey header is empty, or the token is missing or expired.
404Not FoundThe user or resource doesn’t exist.
409ConflictDuplicate, for example a consumptionId already processed.
429Too Many RequestsRate limit reached.
500Internal Server ErrorUnexpected 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.