New mini program: look up members by mobile or email
For members who open the new mini program without a jump: look up their old balances by a verified mobile number or email address, credit them, and report the migration.
| Method | URL | Called by | Authentication |
|---|---|---|---|
POST | https://open.acrossflow.com/v1/mp/lookup | New mini program's backend | Redeem token |
POST | https://open.acrossflow.com/v1/mp/migrated | New mini program's backend | Redeem token |
When a member opens the new mini program directly, without a jump, the new mini program's backend can use the member's verified mobile number or email address to look up their points and stored value from the old mini program. After the member confirms, it credits them and reports the migration by memberId. Only members whose imported record includes a mobile number or email address can be found. For authentication, response structure, and common error codes, see the API overview.
Call sequence
- Sign in and verify a mobile or email
- Session and the verified value
/v1/mp/lookup- Matching members, possibly several
- List the members
- Confirm which one
/v1/mp/migratedafter crediting
- The member signs in to the new mini program, and the backend gets their OpenID in the new mini program.
- The new mini program verifies the member's mobile number or email address, for example with an SMS or email code, or WeChat's phone number verification component.
- The backend calls
/v1/mp/lookupwith the verified value. - If more than one member is returned, the member confirms which one is theirs.
- After crediting the member, the backend calls
/v1/mp/migratedwith thememberId; see Report a migration.
This endpoint returns the balances and contact details of members matching the mobile number or email address it receives, and does not check that the caller verified it. Lookups with unverified values would let anyone who types in someone else's number see and claim their points and stored value.
Look up members
POST https://open.acrossflow.com/v1/mp/lookup
Authorization: Bearer aft_…
Content-Type: application/json
{ "mobile": "+85291234567" }
Request parameters
| Field | Type | Required | Description |
|---|---|---|---|
mobile | string | One of | The member's verified mobile number; see Data types for the format |
email | string | One of | The member's verified email address; see Data types for the format |
Response
{
"ok": true,
"members": [
{
"memberId": "mem_…",
"name": "…",
"points": 12050,
"balance": 3000,
"mobile": "+85291234567",
"email": null,
"extra": { "coupons": "2 × $20 off $100" },
"status": "pending",
"migratedAt": null,
"migratedOpenId": null
}
]
}
| Field | Type | Description |
|---|---|---|
members | array | Matching members in import order; an empty array if none match |
members[] | object | Same structure as the member returned by the redeem endpoint; see Redeem a jump token |
Notes
- Matching is exact. Email addresses are case-insensitive. Partial or fuzzy matching is not supported.
- Matching uses the mobile numbers and email addresses in member records: those the merchant imported, and those added by jump-based migration reports.
- One mobile number or email address can belong to several members, for example a number shared by a family. Show details such as name and points and let the member confirm which record is theirs. Never pick or merge records automatically.
- This endpoint is read-only and does not change a member's status. The status becomes
migratedonly after a migration report. - Credit each member only once; this is the caller's responsibility. The member may already have been credited through a jump. Before crediting, check the
memberIdagainst your own records.statusand the other migration fields are for reference only. - Each Redeem token can look up 60 times per minute; see Rate limits.
Error codes
Error codes specific to this endpoint. For common error codes, see the API overview.
| HTTP | error | Description |
|---|---|---|
| 400 | invalid | Neither or both of mobile and email were sent, or the value is malformed |
| 402 | paused | The merchant's account is over its plan limits and the grace period has ended; lookups are paused |
| 403 | channel | The token's channel no longer exists |
| 429 | rate_limited | This Redeem token has made 60 lookups in the last 60 seconds |