Skip to main content
Use this browser endpoint immediately after your server creates Stripe Checkout and before redirecting or mounting Checkout. It stores attribution only. It does not create a sale and does not prove payment.
The @biqli/analytics method storeStripeSession() is the recommended client. It reads the SDK’s current click ID, adds a fresh idempotency key, and sends the authenticated request.

SDK request

If you loaded the global browser script:
The SDK uses the stored bq_id. You can pass bq_id explicitly only when your application already obtained and validated the click ID through the same browser attribution flow.

Authentication and origin

Send the workspace publishable key as a bearer token:
The request must come from a valid browser Origin whose hostname is allowed in the workspace tracking settings. The publishable key, allowed hostname, click, and Stripe connection must all belong to the same workspace. Do not use a secret workspace API key for this browser endpoint. Never expose a Stripe secret or restricted key in the request.

Headers

The JSON request body cannot exceed 8,192 bytes.

Request fields

The endpoint rejects unknown fields.

Exact mapping request

Use the raw request only for debugging a browser-equivalent request. A server without a browser Origin is rejected by design.

Pending fallback request

You can omit stripe_session_id when it is not yet available:
This creates a short-lived pending candidate. Biqli later accepts it only when the customer email matches exactly one eligible, unconsumed candidate. Multiple candidates are ambiguous and fail closed. Prefer the exact mapping request.

Response

A new registration returns 201 Created:
An existing compatible registration can return 200 OK. checkout.id is Biqli’s public registration ID, not the Stripe Checkout Session ID. Exact Checkout mappings default to a 90-day eligibility window. Pending registrations without a Session ID default to 24 hours. Treat these as upper bounds, not a reason to delay payment.

Idempotency

The endpoint requires Idempotency-Key.
  • Repeating the same key and canonical request returns the original response and adds Idempotency-Replayed: true.
  • Reusing the key with different request data returns 409 idempotency_conflict.
  • Attempting to bind an existing Stripe Checkout identity to another click returns 409 stripe_attribution_conflict.
  • Idempotency records are retained for seven days.
The browser SDK creates a new idempotency key per method call. If your UI retries after an unknown network outcome and you need response replay, call the API with a stable attempt key or retain the first successful response in your application state.

Errors

Errors use Biqli’s structured API error format unless a readiness failure occurs before the controller. The client tracking limit is 120 requests per 60 seconds for a publishable-key and IP pair. Responses include standard and X-RateLimit-* diagnostic headers.

SDK errors

The browser method throws BiqliError. Two client-side errors can occur before an HTTP request:
  • consent_required when browser tracking consent is disabled;
  • missing_click_id when neither an explicit nor stored valid click ID exists.
Handle them before opening Checkout:
Read Implement Stripe Checkout for the complete server and browser sequence.