Before you begin
- If Bilt calls you on unlink, host Unlink an account with the bearer credential you issued to Bilt.
- Store the
linkIdfrom Create a link or Get a link. - Get your partner access token. See Authentication.
How it works
When the member disconnects in the Bilt app, Bilt calls you. When your customer disconnects in your product, you call Bilt. Either way the link ends, and both sides converge on the same state.Steps
Handle an unlink from the Bilt app
Bilt calls Unlink an account when the member disconnects your product in the Bilt app. It uses the same bearer credential as your other endpoints.1
Find the link
Look the link up by
partnerMemberId. Return 404 LINK_NOT_FOUND when there is none. Bilt treats that as a successful unlink.2
Check the member
When Bilt sends
biltMemberId, check that it matches the stored link. Return 409 MEMBER_ID_MISMATCH when it does not.3
Clean up
Return
200. Then delete the stored biltMemberId, remove your link records for the member, and stop sending their activity to Bilt.End a link from your product
Call End a link when your customer disconnects Bilt in your product or closes their account.- Authenticate with your partner access token, not the credential you issued to Bilt. That credential returns
401. - Send the
partnerUserIdand thelinkIdfrom the create or get response. ThelinkIdstops a delayed retry from ending a newer link. - A
204means the link isLINK_REVOKED, and the member stops earning. A repeat also returns204. - A
404 LINK_NOT_FOUNDmeans no link of yours has that ID. Clean up and treat it as done.
409 INVALID_STATE_TRANSITION means the link is mid-transition, which happens only for partners Bilt calls on unlink. Wait one to two seconds and resend. If it persists, contact Bilt with the requestId.
When your own unlink flow finds no linked account, answer your UI with an error such as NO_LINKED_ACCOUNT.
What can go wrong
- You send the credential you issued to Bilt. Bilt answers
401. - No link of yours has that
linkId. Bilt answers404 LINK_NOT_FOUND. Clean up and treat it as done. - The link is mid-transition. Bilt answers
409 INVALID_STATE_TRANSITION. Wait one to two seconds and resend. - Bilt sends a
biltMemberIdthat does not match. Answer409 MEMBER_ID_MISMATCH.
Next steps
- After a link ends, the member can link again through either flow, with a new
linkId. See Link from the Bilt app. - Errors and retries covers every error code.