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.
Quickstart
Reward a test user on staging with two API calls.
- Get your staging credentials. Your Wecheer contact shares your
advertiserId,apiKey,apiSecretand a staging campaign link. The campaign already has a test SKU set up. - 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.
- Get an access token. Call the Authorize endpoint with your key and secret.
- Send your first consumption. Send the test SKU for your test user, then open the campaign and check that the points arrived.
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 -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.
| Environment | User management base URL | Campaigns base URL |
|---|---|---|
| Staging | https://api.wecheer.me/staging-usermanagement | https://api.wecheer.me/staging-campaigns |
| Production | https://api.wecheer.me/usermanagement | https://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 your identity provider Available
Users log in with the account they already have with your brand. Available today with Microsoft CIAM using OpenID Connect. Other OpenID Connect providers are scoped per project.
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
- The user opens a campaign link or scans a campaign QR code.
- Wecheer sends the user to your CIAM sign-in page.
- The user signs in, or creates an account with you.
- Your CIAM sends the user back to Wecheer with an OpenID Connect token.
- 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.
Where SSO is configured
| Setting | Level | Notes |
|---|---|---|
| Identity provider connection | Brand | OpenID Connect issuer, client credentials and token validation rules for your CIAM tenant. |
| SSO on or off | Campaign | Turn 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.
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.
Consumption API Available
Your POS, e-commerce platform, app or backend sends the purchase or action to Wecheer as it happens. Nothing to scan, and the reward arrives in real time.
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 purchased | example_sku_product_a | 10 points |
| Device registered | example_sku_device_registered | 990 points |
| Review submitted | example_sku_product_review | 100 points |
| Poll answered | example_sku_poll_answer | 100 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
consumptionIdis processed once. Send the same ID again and Wecheer returns409. - The user is active. Blocked users don’t receive rewards.
Send purchases by API
- Get an access token from the Authorize endpoint, using your API key and secret. Reuse it until it expires, then get a new one.
- Map your products to SKUs. Agree with your Wecheer contact which of your product codes or actions map to which campaign SKUs.
- 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. - Identify the user with the Wecheer user ID when you have it. Otherwise use their phone number or email.
- 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.
Voucher codes Available
When a consumer redeems a catalog reward, Wecheer issues a voucher code and sends it in the CatalogRedeem event. Your checkout, app or CRM can pick it up through Segment and accept it.
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 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.
| Direction | Method | Status | Use it when |
|---|---|---|---|
| From Wecheer to you | Segment Source | Available | Recommended. Your tools are in the Segment catalog, such as HubSpot, Salesforce, Braze or BigQuery. |
| Segment Function | Available | Your tool isn’t in the Segment catalog, or you need to transform events first. | |
| Webhook | Available | You want events sent straight to your server, without Segment. | |
| From you to Wecheer | Segment Destination | Available | You already track events in Segment and want them to reward users on Wecheer. |
| Consumption API | Available | You 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.
- In Segment, add Wecheer from the Sources catalog and name it, for example
Wecheer_StagingandWecheer_Prod. - Copy the source’s write key.
- In Wecheer, go to Advertiser Settings, then Outbound Events, then Segment, and paste the write key.
- Choose the events you want to receive and save.
- 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.
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.
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 receive | What to do |
|---|---|
200 | Nothing. Wecheer gives the reward. |
400 | Fix the payload. Don’t retry the same request. |
401 | Your token is missing or expired. Get a new one and retry. |
404 | The user isn’t registered or hasn’t joined the campaign. Ask them to open the campaign link, then send again. |
409 | Already processed. Treat it as success and don’t retry. |
429 | Slow down and retry later. See Rate limits. |
500 | Retry 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.
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
| Step | Owner |
|---|---|
| Share the redirect URL for staging and production | Wecheer |
| Register Wecheer as an application in your CIAM and share the issuer, client ID and client secret | You |
| Make sure your sign-up flow gives each person one identity, for example with a verified phone number | You |
| Connect your CIAM to your brand on Wecheer and switch SSO on for the right campaigns | Wecheer |
| Test sign-up and login end to end on staging | Together |
Consumption API
| Step | Owner |
|---|---|
| Share API credentials, advertiser ID and a staging campaign | Wecheer |
| Set up the campaign SKUs and rewards for your triggers | Wecheer |
| Map your internal events and products to the campaign SKUs | You |
| Build the API calls: token, payload, error handling and retries | You |
| Test on staging and review the results | Together |
Data sharing through Segment
| Step | Owner |
|---|---|
| Share the event scheme, field definitions and sample payloads | Wecheer |
| Add the Wecheer source in Segment and paste the write key in Wecheer | You |
| Choose events, connect destinations and map fields | You |
| Write, test and deploy the Function, if you use one | You |
| Support and troubleshoot event delivery | Wecheer |
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
| Area | How we handle it |
|---|---|
| Cloud platform | AWS, serverless architecture |
| Network | WAF, VPC isolation, TLS 1.2 or higher |
| Data at rest | AES-256 encryption |
| Data in transit | TLS encryption. SSL Labs grade A+ for api.wecheer.me and app.wecheer.io. |
| Login | One-time code by phone or email, Google or Apple sign-in, or SSO with token validation through OpenID Connect |
| Fraud prevention | reCAPTCHA Enterprise, velocity checks and rate limiting, pattern detection, duplicate detection |
| Privacy | GDPR and PDPA compliant |
Glossary
| Term | Meaning |
|---|---|
| Advertiser | The brand or company running programmes on Wecheer. |
| Campaign | A promotion or loyalty programme with its own rules, rewards and dates. |
| Card | A user’s membership in a campaign. A user without a card hasn’t joined. |
| Consumption | An action that can earn a reward: a purchase line, a QR code, receipt or product photo scan, a review. |
| SKU | The name of a product or trigger, set up in a campaign. |
| Points | A brand’s own currency. Points earned with one brand stay with that brand. |
| Punch card | A digital stamp card. A full card unlocks a reward. |
| Instant win | A reward the user can win straight after a qualifying action. |
| Cheercoins | Wecheer’s own coin, which can be used across campaigns. |
| Redemption | Exchanging points or coins for a reward. |
| Outlet | A physical retail location, such as a convenience store, supermarket or fuel station. |
| Staff account | A Wecheer account for outlet staff, used to confirm in-store rewards. |
| SSO | Single 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.