Environments
Discovery:
GET {base}/.well-known/oauth-authorization-server
Local Worker development (http://localhost:8787) is available for Swapnice-internal or white-glove sessions. Partner teams should treat sandbox as the source of truth unless we schedule a shared local walkthrough.
What you receive at kickoff
Swapnice issues:- Sandbox
app_id,client_id, and a one-timeclient_secret - Allowed redirect URIs (you supply these first)
- Allowed scopes and consent purposes for the pilot
- A support alias for integration questions (
api@swapnice.com)
Expected implementation process
1
Read the contract
Review SDK versus API, integration, data collection, and outputs before the technical session.
2
Register redirect URIs and scopes
Send the exact sandbox and production redirect URIs, plus the scope template you intend to use. Swapnice configures the sandbox app.
3
Complete OAuth in sandbox
PKCE authorize → token → introspect. Confirm token expiry and refresh before writing events.
4
Walk one test user through connect
Create a customer, open
connection_url, grant purposes, persist the receipt.5
Send two event families
One explicit claim (for example
profile.selected) and one behavioral event (for example purchase.completed). Confirm 202, then GET /v1/events/:id until processed.6
Read profile, claims, and intents
Call the three read routes with
consent_purpose. Confirm facts, alternatives, and a 403 after you revoke that purpose.7
Register the webhook receiver
Create the endpoint and verify signature handling. Live delivery is near-term; the receiver should still be ready.
8
Technical session
Bring the payloads, failing cases, and scope questions. This is the meeting the docs are meant to make productive.
9
Production review
Production app, production policy versions, go-live event list, and a revoke/suppression test.
Sandbox checklist
Use this as the acceptance list before asking for production.- Sandbox token introspects with the expected scopes
- Redirect URI mismatches are rejected
- Customer upsert is idempotent on
external_id - Connection session expires if left unused
- Events without a receipt return
consent_required - Replaying the same
Idempotency-Keyreturns the original event - Changing the body on that key returns
409 - Profile read returns resolved facts after the archive processes
- Revoking a purpose blocks later events and purpose-scoped reads
- No secrets, emails, or payment tokens appear in
payloadormetadata - Webhook receiver verifies the signing secret (even if delivery is still test-only)
Suggested test fixtures
Postman and cURL
Follow the request walkthrough for the full ordered sequence (authorize → customer → connect → consent → event → profile → revoke). If you use Postman:- Do not use the built-in OAuth 2.0 helper. Authorize is a JSON
POSTwithcustomer_idand PKCE. - Set collection auth to Bearer
{{access_token}}after the token call. - Tokens expire in about 15 minutes. Re-run authorize + token when you see
401. POST /v1/customerstakesexternal_id, notcustomer_id.
Common errors
What “done” looks like for a pilot
The sandbox integration is complete when:- A test user can connect, grant, generate events, and appear in a profile read.
- Revocation suppresses that user.
- Your backend can call profile/intent reads without the client SDK.
- You have a written list of production event types and purposes.
Getting help
Email api@swapnice.com with:- Sandbox
app_idandrequest_idfrom the failing response - Route, timestamp, and a redacted payload
- Whether the call came from the SDK or raw HTTP