url (safe to open — the member sees the matching state in the webview) plus a status and a resolution object telling you exactly how to fix it, so you don't have to wait for the member to open the session to find out:no_entitlement — no pass has ever been assigned to this client, or their only pass is in some other unusable state. Fix by issuing a pass.pass_expired — the client has a pass, but it has lapsed past its expiry date. Fix by renewing that pass; you don't need to issue a new one.is_error is false for both — the session is still created, and these fields are additive to the plain success response. A client with an active pass gets the plain response with no status/resolution at all.client_not_found, means the client_id doesn't resolve to a member at all, so no session is created and there is no url. Its fix is the same as no_entitlement — issue_pass — because issuing a pass is what creates the member: POST /issued_passes creates the member and issues the pass in one call. The difference is only that there's no session to open until you do.is_error: false too — the fix is on your side in all three states, so none of them is reported as a failure. Branch on object, not on which keys are present: hosted_session always carries a url you can open, hosted_session_resolution never does. Then branch on resolution.action for what to do.Idempotency-Key to safely retry. Only a created session is cached against the key, so after you fix a client_not_found you can retry with the same key and get a real session.curl --location '/v3/api/business/reseller/hosted_sessions' \
--header 'Idempotency-Key: 550e8400-e29b-41d4-a716-446655440000' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"client_id": "bardge9370"
}'{
"object": "hosted_session",
"url": "https://bardge-webview.vercel.app/xO9IT8bnVasaN2P2NBbLrIz0i05p4O48",
"message": "SUCCESS"
}