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-usermanagement
Productionhttps://api.wecheer.me/usermanagement

Headers

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

Body

FieldTypeRequiredDescription
advertiserIdstringYesYour brand’s ID on Wecheer, shared at onboarding.
cURL
curl -X POST 'https://api.wecheer.me/staging-usermanagement/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"
}
StatusMeaning
200Success. The body holds the access token.
400The request is invalid, for example a missing advertiserId.
401The API key or secret is wrong.

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: each ID is processed once, and a repeat returns 409.
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.
valuestringYesThe Wecheer user ID, phone number or email.

Line

FieldTypeRequiredDescription
skustringYesThe SKU set up for this trigger in the campaign.
quantitynumberYesNumber of units. Use 1 for actions such as a poll answer or a review.
productNamestringNoA readable name for the line. Defaults to the SKU.

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-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, or user hasn’t joined the campaign.
409Consumption already processed.
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

Claim names differ between tenants, so we map them with you during setup.

DataRequiredUsed for
Unique user IDYesLinks the Wecheer profile to your user.
Phone numberAt least one of the twoRecommended identifier. Verify it at sign-up.
EmailAt least one of the twoIdentifier when there is no phone number.
First name, last nameNoFills the Wecheer profile.
LanguageNoShows Wecheer in the user’s language.
Marketing consentNoSets the user’s opt-ins on Wecheer.

Events

Event envelope

Events Wecheer shares with you through Segment or a webhook. All use the standard Segment track structure. Event names 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" }
}

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
PunchcardStampsReceivedStamps are added to a punch card
punchcard_step_completedA punch card milestone is reached
card_receivedThe user receives a campaign card
CheercoinsUpdatedThe 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_createdA new user registers
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.
Redeem Reward StartedA redemption starts
Redeem Reward FailedA redemption fails

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.

CodeStatusMeaning
200OKThe request succeeded.
400Bad RequestThe request is malformed or missing a required field.
401UnauthorizedCredentials or token are missing, wrong 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.