New mini program: redeem jump tokens and report migrations
The two endpoints the new mini program's backend calls: redeem the member's af_token for their balances in the old mini program, then report the migration once the member is credited.
| Method | URL | Called by | Authentication |
|---|---|---|---|
POST | https://open.acrossflow.com/v1/mp/redeem | New mini program's backend | Redeem token |
POST | https://open.acrossflow.com/v1/mp/migrated | New mini program's backend | Redeem token |
A member who jumps from the old mini program to the new one carries a single-use jump token (af_token). The new mini program's backend redeems it for the member's points and stored value from the old mini program, credits the member, then reports the migration. For members who open the new mini program directly, without a jump, see Look up members by mobile or email. For authentication, response structure, and common error codes, see the API overview.
Call sequence
wx.navigateToMiniProgramwithaf_tokenaf_tokenand the member's session/v1/mp/redeem- Points and stored value
/v1/mp/migratedafter crediting
- The old mini program opens the new one with
wx.navigateToMiniProgram, passingaf_tokenboth in the landing path's query string and inextraData. - The new mini program reads
af_tokenfrom its launch options and sends it to its own backend together with the member's session. - The backend calls
/v1/mp/redeemto retrieve the member's points and stored value. - After crediting the member, the backend calls
/v1/mp/migratedto report the migration.
A Redeem token can read the balance of any member in its channel. Deploy it only on the new mini program's server; never include it in mini program code.
Redeem a jump token
POST https://open.acrossflow.com/v1/mp/redeem
Authorization: Bearer aft_…
Content-Type: application/json
{ "token": "<af_token>" }
Request parameters
| Field | Type | Required | Description |
|---|---|---|---|
token | string | Yes | The af_token the member arrived with, unmodified |
Response
{
"ok": true,
"jumpTokenId": "jmp_…",
"channelId": "chn_…",
"openId": "<the member's OpenID in the old mini program>",
"member": {
"memberId": "mem_…",
"name": "…",
"points": 12050,
"balance": 3000,
"mobile": "+85291234567",
"email": null,
"extra": { "coupons": "2 × $20 off $100" },
"status": "redeemed",
"migratedAt": null,
"migratedOpenId": null
}
}
| Field | Type | Description |
|---|---|---|
jumpTokenId | string | ID of this jump. Required by the report endpoint; persist it |
channelId | string | The channel that issued the jump token |
openId | string | The member's OpenID in the old mini program |
member | object | null | The member record the merchant imported; null if this member was never imported |
member.memberId | string | AcrossFlow member ID |
member.name | string | Member name as imported |
member.points | integer | Points, multiplied by 100 |
member.balance | integer | Stored value, multiplied by 100, in the currency the merchant imported |
member.mobile | string | null | The member's mobile number in E.164 format; null if none |
member.email | string | null | The member's email address, lowercase; null if none |
member.extra | object | Extra columns the merchant added to the member sheet, such as coupons or tiers. Keys are the headers as written; values are the cell text, an empty string where blank. An empty object if there are none. How to credit them is up to the caller |
member.status | string | Migration status: pending (not redeemed), redeemed (redeemed, not yet reported), or migrated (migration reported). The redeem endpoint returns the status after this redemption |
member.migratedAt | string | null | When the migration was first reported; null if not reported |
member.migratedOpenId | string | null | The new mini program OpenID passed in the migration report; null if not reported |
Notes
- A jump token is valid for 600 seconds from issue and can be redeemed once. If redemption fails, have the member return to the old mini program and jump again.
- A Redeem token can only redeem jump tokens issued by its own channel. A token from another channel returns
401 tokenand is not consumed. - Credit each member only once; this is the caller's responsibility. The same member can redeem more than once, for example by jumping again after a failed report, and redeeming an already migrated member still returns the full original balance. Before crediting, check
member.memberIdagainst your own records and never credit the same member twice. status,migratedAt, andmigratedOpenIdcome from migration reports and are for reference only. If crediting succeeded but the report failed, they still show the member as not migrated. Your own records decide whether a member has been credited.mobileandemailcome from the member sheet the merchant imported, and may be filled in by a report; see Report a migration.- This endpoint is not idempotent: retrying after a lost response returns
401 token. See Retries and idempotency.
Report a migration
Call after the member has been credited, with the same Redeem token. Report a member who redeemed a jump with its jumpTokenId. A member found through the lookup endpoint has no jumpTokenId; report it with its memberId.
POST https://open.acrossflow.com/v1/mp/migrated
Authorization: Bearer aft_…
Content-Type: application/json
{
"jumpTokenId": "jmp_…",
"openId": "<the member's OpenID in the new mini program>",
"mobile": "+85291234567",
"email": "member@example.com"
}
Request parameters
| Field | Type | Required | Description |
|---|---|---|---|
jumpTokenId | string | One of | The jumpTokenId returned by the redeem endpoint |
memberId | string | One of | The memberId returned by the lookup endpoint. Must not be sent together with jumpTokenId |
openId | string | Yes | The member's OpenID in the new mini program |
mobile | string | No | Mobile number; see Data types for the format. Ignored when reporting by memberId |
email | string | No | Email address; see Data types for the format. Ignored when reporting by memberId |
Response
{ "ok": true, "memberId": "mem_…", "migratedAt": "2026-10-27T08:00:00.000Z" }
| Field | Type | Description |
|---|---|---|
memberId | string | null | ID of the member recorded as migrated; null if this member was never imported, in which case nothing is recorded |
migratedAt | string | null | When the migration was first recorded; null whenever memberId is null |
Notes
- This endpoint is idempotent: reporting again with the same
openIdreturns the first result. - Reporting the same member with a different
openId, or anopenIdalready linked to another member, returns409 migrated. - Do not report until the member has been credited. If crediting fails, have the member jump and redeem again.
- If crediting succeeded but the report failed, retry the report with the same
jumpTokenIdormemberId; the member does not need to jump or be looked up again. - When reporting by
jumpTokenId,mobileandemailare recorded only where the member's record has none; values the merchant imported take precedence. A member reported bymemberIdwas found by its contact details, so no contact details are recorded.
Example
The new mini program reads af_token in app.js:
App({
onShow(options) {
const extra = (options.referrerInfo && options.referrerInfo.extraData) || {};
const token = (options.query && options.query.af_token) || extra.af_token;
if (token) {
// Send it to your own backend to redeem; never call AcrossFlow from the mini program
}
},
});
Get the member's consent before using the migrated points and stored value.
Error codes
Error codes specific to these endpoints. For common error codes, see the API overview.
| HTTP | error | Endpoint | Description |
|---|---|---|---|
| 401 | token | redeem | The af_token is malformed, unknown, expired, already redeemed, or not from this token's channel |
| 401 | token | migrated | The jumpTokenId is missing, malformed, unknown, or its jump token has not been redeemed |
| 404 | member | migrated | The memberId does not belong to this token's channel |
| 409 | migrated | migrated | The member was already reported with a different openId, or the openId is linked to another member |