Identify merchants from your backend
Send authenticated merchant contact data with the correct app scope.
On this page
What you need
The private workspace key and app UUID. Use your app’s authenticated merchant context; obtain approval before forwarding Shopify access tokens.
Steps
- Choose a contact path: send known authorized contact fields without a token, or use the approved post-OAuth identify hook with transient token enrichment/watch registration.
- POST JSON to
https://heycrust.com/api/identifywithAuthorization: Bearer <workspace key>and the body below. The required domain field ismyshopifyDomain. - Include the originating HeyCrust
appId. It is required in a multi-app workspace; only a workspace owning exactly one app can infer it. Optional email, phone, ownerName, country, shopifyPlan and accessToken can be omitted or null. - Set
observation:"request"for fresh authorized identification/backfill, orobservation:"uninstall"for verified uninstall forwarding (without accessToken). Unspecified older callers work only before a relevant erasure; afterward they return 400 even after reinstall. Upgrade them before relying on contact recovery. Uninstall observations after a relevant fence are acknowledged without writing contacts or refreshing the app identification receipt. - Keep the hook bounded and catch failures so merchant authentication is not broken by a reporting failure. On serverless hosts, use the host’s supported background lifecycle rather than assuming detached work survives.
- Inspect the response and the app’s identification receipt, then verify the intended merchant contact record.
{
"appId": "11111111-1111-4111-8111-111111111111",
"myshopifyDomain": "example.myshopify.com",
"observation": "request",
"email": "merchant@example.com",
"ownerName": "Example Merchant",
"country": "US",
"shopifyPlan": "Basic"
}
Expected result
{"ok":true,"uninstallWatch":false} means contact upsert succeeded without a registered watch. A true watch flag means that path registered/found its watch. HTTP success is not a commission or install-attribution receipt.
Redaction
For a verified Shopify shop/redact workflow, retire local tracking first, then DELETE /api/identify with your workspace key and the exact originating app UUID:
{"myshopifyDomain":"example.myshopify.com","appId":"11111111-1111-4111-8111-111111111111"}
Require HTTP success and this matching receipt before acknowledging cleanup; retry a timeout, failure or mismatched scope:
{"ok":true,"scope":"app","appId":"11111111-1111-4111-8111-111111111111"}
This erases that app’s private events, delivery evidence, watches and contact/user sources. Other apps keep their own evidence and activity. Shared contacts are rebuilt from surviving sources; explicit workspace contact imports survive. Old unattributed contact/user values cannot prove independence and are discarded on a relevant erasure, so a legacy contact may need fresh identification. Financial audit facts remain.
For an explicitly authorized whole-workspace merchant erasure, send a separate body and require the workspace receipt:
{"myshopifyDomain":"example.myshopify.com","scope":"workspace"}
{"ok":true,"scope":"workspace"}
Domain-only identify or DELETE calls in a multi-app workspace return 400 APP_SCOPE_REQUIRED before contact reads or writes. Foreign apps return 403; conflicting or unknown scope fields return 400. App erasure and global erasure fences prevent stale writes; fresh authorized installation evidence is required for recovery. Uninstall delivery cannot reenroll a redacted lifecycle.
Deploy the scoped HeyCrust receiver and migration before updating app callers. Older receivers ignore appId and erase globally; checking their receipt afterward cannot undo that deletion. Do not test privacy deletion against a real merchant. See Privacy. See the Framework recipes for the actual app-generated hooks.
Troubleshooting
Check the workspace key, app ownership, domain field and contact formats. When accessToken is provided, missing email may trigger a transient Shopify contact read; watch registration also needs the correct app secret/context. Do not assume {ok:true} means the watch was established.