Getting started

Wecheer integration guide

Connect your app, website, POS, identity provider or CRM to Wecheer. The guides are organised by what you want to do: log users in, validate purchases, deliver rewards and share data.

Wecheer works without any integration. Consumers join a campaign from a link or QR code, validate their purchase with an on-pack QR code, a secret code, a photo of the receipt or a photo of the product, and get their reward in the Wecheer app. Integrations connect Wecheer to the systems you already run, so the experience is smoother for consumers and you get the data in real time. Each integration works on its own, so pick only the ones that fit your setup.

How your systems connect to Wecheer Your identity provider Microsoft CIAM Your sales systems POS, e-commerce or app Your checkout In store or online Your CRM, CDP or warehouse Marketing and analytics Login with SSO (OpenID Connect) Purchases (Consumption API) Reward voucher codes Data sharing (via Segment) Wecheer platform Users, roles and brand wallets Campaigns and earning rules Validation: receipts and AI Rewards and catalog
Each arrow is an optional integration. Without any of them, consumers log in with Wecheer login, validate purchases with a QR code, a secret code, a receipt or a product photo, and get rewards in the Wecheer app.

Quickstart

Reward a test user on staging with two API calls.

  1. Get your staging credentials. Your Wecheer contact shares your advertiserId, apiKey, apiSecret and a staging campaign link. The campaign already has a test SKU set up.
  2. Join the test campaign. Open the campaign link on your phone and log in. Your test user now has a card in the campaign and can receive rewards.
  3. Get an access token. Call the Authorize endpoint with your key and secret.
  4. Send your first consumption. Send the test SKU for your test user, then open the campaign and check that the points arrived.
cURL · step 3
curl -X POST 'https://api.wecheer.me/staging-usermanagement/api/advertiser/v1/authorize' \
  -H 'apiKey: YOUR_API_KEY' \
  -H 'apiSecret: YOUR_API_SECRET' \
  -H 'Content-Type: application/json-patch+json' \
  -d '{ "advertiserId": "YOUR_ADVERTISER_ID" }'
cURL · step 4
curl -X POST 'https://api.wecheer.me/staging-campaigns/api/advertiser-integration/v1/consumption' \
  -H 'Authorization: Bearer YOUR_ACCESS_TOKEN' \
  -H 'Content-Type: application/json-patch+json' \
  -d '{
    "consumptionId": "quickstart-0001",
    "consumptionDate": "2026-04-25T12:34:00Z",
    "identifiers": [ { "key": "phoneNumber", "value": "YOUR_TEST_PHONE" } ],
    "consumptionLines": [ { "sku": "YOUR_TEST_SKU", "quantity": 1 } ]
  }'

A 200 means the consumption was accepted. A 404 usually means the test user hasn’t joined the campaign yet: go back to step 2.

Environments

Every brand gets its own credentials for each environment. Build and test on staging, then switch the base URL and credentials to go live.

EnvironmentUser management base URLCampaigns base URL
Staginghttps://api.wecheer.me/staging-usermanagementhttps://api.wecheer.me/staging-campaigns
Productionhttps://api.wecheer.me/usermanagementhttps://api.wecheer.me/campaigns

Keep apiKey and apiSecret on your server only, never in an app, website or public repository. Your Wecheer contact can rotate them at any time.


Identity and login

Login options

Every point and reward belongs to a Wecheer user. Choose how your users log in.

Each brand chooses between Wecheer login and SSO with its own identity provider. You can override it per campaign, for example to keep Wecheer login for a staff programme while consumers use SSO.

Wecheer login No integration

The default. Users log in with a one-time code sent to their phone number or email, or with their Google or Apple account. Phone login gives the strongest one-person-one-account check.

SSO with Microsoft CIAM

When SSO is on for a campaign, users sign in and register on your identity provider, not on Wecheer. Wecheer trusts the token your provider issues and creates the Wecheer profile for you.

How the login works

  1. The user opens a campaign link or scans a campaign QR code.
  2. Wecheer sends the user to your CIAM sign-in page.
  3. The user signs in, or creates an account with you.
  4. Your CIAM sends the user back to Wecheer with an OpenID Connect token.
  5. Wecheer validates the token. If the user is new to Wecheer, we create their profile on the spot, with their opt-ins, and join them to the campaign.
SSO login sequence between the user, Wecheer and your CIAM User Wecheer Your CIAM 1. Opens campaign link or QR 2. Redirect to sign-in 3. Signs in or registers 4. Redirect back with token 5. Validate token Create profile if new Joined the campaign, wallet ready

Where SSO is configured

SettingLevelNotes
Identity provider connectionBrandOpenID Connect issuer, client credentials and token validation rules for your CIAM tenant.
SSO on or offCampaignTurn SSO on for consumer campaigns and keep Wecheer login for campaigns that need it, such as staff referral programmes.

The values we need from your identity team, and the user data the token must carry, are listed in the SSO reference.

User identifiers

For SSO users, the token must carry a phone number or an email, or both. Wecheer uses it to recognise the person. We recommend the phone number.

Wecheer gives every user a Wecheer user ID. We pass it to your system in the redirect link, and it is the most reliable way to match a user when you send purchases.

Why phone number: one person can easily create many email addresses, and with them many accounts that each claim the join reward. A phone number is much harder to multiply. If you use phone number, make sure your sign-up flow verifies it. With SSO, your identity provider decides who counts as a unique person, so this control sits on your side.

Account creation API In development

An API to create a Wecheer profile from your backend, with opt-ins, before the user opens Wecheer. It suits partners who already own the sign-up flow and don’t need a full SSO redirect. Ask your Wecheer contact for timing.


Purchase validation

Ways to validate a purchase

Tell Wecheer that a user bought something or took an action, so they earn points, stamps or an instant win.

QR code, secret code, receipt or product photo No integration

The consumer scans a unique QR code on the pack, enters a secret code from inside the pack, or takes a photo of their receipt or of the product itself. Wecheer checks it against the campaign rules and gives the reward.

How the Consumption API works

A consumption is any action in your system that should reward a user: a purchase line, a device registration, a review, a poll answer.

Each consumption carries a SKU, the name of the trigger. When the SKU you send matches a SKU set up in the user’s campaign, Wecheer gives the reward configured for it. Wecheer sets up the SKUs in the campaign with you, so you can add new triggers without code changes on our side.

Trigger (example)SKU (example)Reward (example)
Product purchasedexample_sku_product_a10 points
Device registeredexample_sku_device_registered990 points
Review submittedexample_sku_product_review100 points
Poll answeredexample_sku_poll_answer100 points

Before you send

Wecheer gives the reward only when all three are true:

  • The user has joined the campaign. They opened the campaign link or QR code and logged in, or SSO created them.
  • The consumption is new. Each consumptionId is processed once. Send the same ID again and Wecheer returns 409.
  • The user is active. Blocked users don’t receive rewards.

Send purchases by API

  1. Get an access token from the Authorize endpoint, using your API key and secret. Reuse it until it expires, then get a new one.
  2. Map your products to SKUs. Agree with your Wecheer contact which of your product codes or actions map to which campaign SKUs.
  3. Send one consumption per transaction to the Consumption endpoint. Use your own transaction ID as consumptionId, and send one line per product in the basket.
  4. Identify the user with the Wecheer user ID when you have it. Otherwise use their phone number or email.
  5. Handle the response as described in Errors and retries.

Reward distribution

Ways to deliver rewards

How the consumer gets the reward once they’ve earned it.

In the Wecheer app No integration

The reward lands in the consumer’s Wecheer wallet: a digital voucher, e-gift card, cashback, mobile top-up or physical reward. For a free product in store, outlet staff confirm it with a staff account.

Reward redemption API In development

One API call for your system to check a reward code and mark it as used, so the reward is applied at checkout, in store or online.

Reward budgets, stock and fulfilment are agreed per programme with your Wecheer contact. They aren’t part of the API.

Reward redemption API In development

Planned scope: your system, such as a POS, an e-commerce checkout or an app, sends the reward code shown by the consumer. Wecheer checks that it is valid, marks it as used and returns the reward details, such as the product or discount to apply. Talk to your Wecheer contact if you want to pilot it.


Data sharing

Data sharing

Share events between Wecheer and your CRM, CDP or data warehouse, in both directions, through Segment.

Segment is free for Wecheer clients to use for this, connects to more than 450 tools, and is SOC 2 compliant.

DirectionMethodStatusUse it when
From Wecheer to youSegment SourceAvailableRecommended. Your tools are in the Segment catalog, such as HubSpot, Salesforce, Braze or BigQuery.
Segment FunctionAvailableYour tool isn’t in the Segment catalog, or you need to transform events first.
WebhookAvailableYou want events sent straight to your server, without Segment.
From you to WecheerSegment DestinationAvailableYou already track events in Segment and want them to reward users on Wecheer.
Consumption APIAvailableYou want to send events to Wecheer directly, without Segment.

All events and their payloads are listed in the event reference.

Segment Source Available

Wecheer sends events into your Segment workspace, ready to route to any destination. No custom code is needed.

  1. In Segment, add Wecheer from the Sources catalog and name it, for example Wecheer_Staging and Wecheer_Prod.
  2. Copy the source’s write key.
  3. In Wecheer, go to Advertiser Settings, then Outbound Events, then Segment, and paste the write key.
  4. Choose the events you want to receive and save.
  5. In Segment, connect the destinations you need and map the events.

The full setup guide is on the Wecheer page of the Segment catalog. Your Wecheer contact can walk your Segment admin through it on a call.

Example: HubSpot

Add HubSpot as a destination in Segment, select the Wecheer source and log in to HubSpot. Then map events such as points_received, CatalogRedeem and user_created to HubSpot contact properties or custom events. Use Segment’s Event Debugger to check that events arrive.

Segment Function Available

A small JavaScript function that runs in Segment. It receives Wecheer events, applies your logic and forwards them to your endpoint. Create it under Connections, Catalog, Functions, connect it as a destination of the Wecheer source, and test it with sample events before going live.

JavaScript
async function onTrack(event, settings) {
  const payload = {
    eventName: event.event,
    userId: event.userId,
    timestamp: event.timestamp,
    properties: event.properties
  };
  const response = await fetch(settings.destinationUrl, {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
      'Authorization': `Bearer ${settings.apiToken}`
    },
    body: JSON.stringify(payload)
  });
  if (!response.ok) {
    throw new Error(`Request failed: ${response.status}`);
  }
}

Webhook Available

Wecheer sends the same events straight to an HTTP endpoint of yours, without a Segment workspace. It suits teams that prefer direct server-to-server delivery. Ask your Wecheer contact to set it up.

Segment Destination Available

Send events to Wecheer from your existing Segment tracking. Instead of calling the Wecheer API, you add Wecheer as a destination in Segment and route the events that should reward users.

Events flow from your systems through Segment to Wecheer Your systems App, web, backend Your Segment track() and identify() Wecheer Destination Segment catalog Wecheer platform Rewards and campaigns

Ask your Wecheer contact to set it up. If you don’t use Segment, send events with the Consumption API instead.


Concepts

Campaigns, cards and rewards

The few ideas you need to read the rest of these docs.

A brand on Wecheer is an advertiser. Each advertiser runs campaigns: promotions or loyalty programmes with their own rules, rewards and dates. When a user joins a campaign, they get a card in it. A user without a card can’t earn in that campaign.

Users earn when Wecheer validates a consumption: an on-pack QR code, a secret code, a receipt, a product photo, or a purchase sent by your API call. Depending on the campaign, a consumption gives points, stamps on a punch card, or a chance at an instant win. Points belong to the brand: points earned with one brand stay with that brand.

Users spend points in the campaign’s catalog. A redemption turns points into a reward, such as a digital voucher, an e-gift card or a free product. Each of these steps creates an event that you can receive through data sharing.

Errors and retries

Every consumption has a unique consumptionId, so retries are safe: if a retry reaches Wecheer after the first call was already processed, you get 409 and the user isn’t rewarded twice.

You receiveWhat to do
200Nothing. Wecheer gives the reward.
400Fix the payload. Don’t retry the same request.
401Your token is missing or expired. Get a new one and retry.
404The user isn’t registered or hasn’t joined the campaign. Ask them to open the campaign link, then send again.
409Already processed. Treat it as success and don’t retry.
429Slow down and retry later. See Rate limits.
500Retry with backoff, keeping the same consumptionId.

Rate limits

Limits are set per brand. Your Wecheer contact will share yours. When you receive 429, wait before retrying. If a Retry-After header is present, wait that many seconds.

JavaScript
const sleep = (ms) => new Promise((r) => setTimeout(r, ms));

async function requestWithBackoff(send, maxRetries = 5) {
  for (let attempt = 0; attempt < maxRetries; attempt++) {
    const response = await send();
    if (response.status !== 429 && response.status < 500) return response;
    const retryAfter = Number(response.headers.get('Retry-After')) || 2 ** attempt;
    await sleep(retryAfter * 1000);
  }
  throw new Error('Retries exhausted');
}

Resources

Who does what

Your systems stay yours. You keep your credentials, your data model and your business logic. Wecheer gives you what you need to move fast and test safely.

SSO

StepOwner
Share the redirect URL for staging and productionWecheer
Register Wecheer as an application in your CIAM and share the issuer, client ID and client secretYou
Make sure your sign-up flow gives each person one identity, for example with a verified phone numberYou
Connect your CIAM to your brand on Wecheer and switch SSO on for the right campaignsWecheer
Test sign-up and login end to end on stagingTogether

Consumption API

StepOwner
Share API credentials, advertiser ID and a staging campaignWecheer
Set up the campaign SKUs and rewards for your triggersWecheer
Map your internal events and products to the campaign SKUsYou
Build the API calls: token, payload, error handling and retriesYou
Test on staging and review the resultsTogether

Data sharing through Segment

StepOwner
Share the event scheme, field definitions and sample payloadsWecheer
Add the Wecheer source in Segment and paste the write key in WecheerYou
Choose events, connect destinations and map fieldsYou
Write, test and deploy the Function, if you use oneYou
Support and troubleshoot event deliveryWecheer

Go-live checklist

  • The full flow works on staging: login, consumption, reward and events.
  • You have production credentials from Wecheer, stored on your server only.
  • Your code points to the production base URLs.
  • Wecheer has set up the production campaign with the same SKUs you tested.
  • For SSO: the production redirect URL is registered in your CIAM, and Wecheer has your production client details.
  • For Segment: the production source is connected and the right events are selected.
  • Your Wecheer contact has confirmed the go-live date with you.

Security and compliance

AreaHow we handle it
Cloud platformAWS, serverless architecture
NetworkWAF, VPC isolation, TLS 1.2 or higher
Data at restAES-256 encryption
Data in transitTLS encryption. SSL Labs grade A+ for api.wecheer.me and app.wecheer.io.
LoginOne-time code by phone or email, Google or Apple sign-in, or SSO with token validation through OpenID Connect
Fraud preventionreCAPTCHA Enterprise, velocity checks and rate limiting, pattern detection, duplicate detection
PrivacyGDPR and PDPA compliant

Glossary

TermMeaning
AdvertiserThe brand or company running programmes on Wecheer.
CampaignA promotion or loyalty programme with its own rules, rewards and dates.
CardA user’s membership in a campaign. A user without a card hasn’t joined.
ConsumptionAn action that can earn a reward: a purchase line, a QR code, receipt or product photo scan, a review.
SKUThe name of a product or trigger, set up in a campaign.
PointsA brand’s own currency. Points earned with one brand stay with that brand.
Punch cardA digital stamp card. A full card unlocks a reward.
Instant winA reward the user can win straight after a qualifying action.
CheercoinsWecheer’s own coin, which can be used across campaigns.
RedemptionExchanging points or coins for a reward.
OutletA physical retail location, such as a convenience store, supermarket or fuel station.
Staff accountA Wecheer account for outlet staff, used to confirm in-store rewards.
SSOSingle sign-on. Users log in to Wecheer with the account they already have with your brand.

Support

Your Wecheer account manager is your first contact for credentials, campaign setup and technical questions during the integration. Not a client yet? Talk to us.

To launch fast: bring your identity owner, your backend developer and your Segment or CRM admin into the first call. Short on hands? Wecheer Professional Services can do the heavy lifting. Ask your Wecheer contact for a proposal.