Skip to main content
This is the happy path a partner engineer should complete in sandbox before the technical session. Use the TypeScript SDK or raw HTTP. Postman works if you do not use its built-in OAuth 2.0 helper. Base URL: https://api.sandbox.swapnice.com (or a Swapnice-issued sandbox host). All /v1/* calls after token exchange need Authorization: Bearer $ACCESS_TOKEN. Mutating calls also need Idempotency-Key. Access tokens last about 15 minutes.

Field-name cheat sheet

1. Environment

Plus the client_id / client_secret Swapnice issued. Create a PKCE pair (code_verifier 43+ chars, code_challenge = Base64URL SHA-256). A known-good verifier/challenge pair for a first sandbox pass:

2. Discovery

No auth. Confirms the host is the Partner API.

3. Authorization code

scope is space-separated and must be allowed on the app. Save code. Codes expire in about 5 minutes and are single-use.

4. Token

Save access_token. Optional: POST /oauth/introspect with that token (needs tokens:introspect).

5. Customer

Save customer.id as CUSTOMER_ID. Replaying the same idempotency key should not create a second customer.

6. Connection session

Save session_id. Poll GET /v1/connection-sessions/:session_id. In a white-glove sandbox, Swapnice can complete the user accept step with you.
Save receipt_id. Then:

8. Event

Header Idempotency-Key is required.
consent_purpose must be one you granted. Save event_id. Replay the same key — you should get the same event. Change the body on that key — you should get 409.
Wait until status is processed before you expect profile facts.

9. Profile, claims, intents

If these are empty, the archive has not landed. Retry the event GET, then the profile.

10. Optional: webhook, entry, revoke

Revoke returns 202 and a workflow_id. Poll GET /v1/workflows/:id. A follow-up event with consent_purpose=personalization should now fail. Cleanup: POST /oauth/revoke with { "token": "..." } and no Bearer header.

Suggested collection order

Errors you should hit on purpose

When you can complete this list, you are ready for a productive integration session. Bring the request_ids from any call that surprised you.