Overview
What a link session is and the rules that apply to all of its endpoints.
A link session is the hosted page where the seller connects their marketplace accounts. You create the session through the API, send the url to the seller, and they authorize access there, with no marketapi login. Each authorized account becomes a connection.
The states of a link session and of the Connection it creates, as diagrams: States and events.
Step by step, from a created seller to a connected account: Connecting a seller.
Endpoints
| Method | Path | What it does |
|---|---|---|
POST | /v1/sellers/{id}/link-sessions | Create a link session |
GET | /v1/link-sessions/{id} | Get a link session |
DELETE | /v1/link-sessions/{id} | Revoke |
All of them require Authorization: Bearer mk_your_api_key. See Authentication.
The seller goes in the path
A session always belongs to one seller, so their id goes in the creation URL (/v1/sellers/{id}/link-sessions). After that, the session has its own id.
The url shows up once
The page url only comes in the creation response (and in the replay of the same Idempotency-Key, for 24 h). We keep only a hash of it. Lost it? Create another session.
The session app
The app field (auto or platform) keeps the choice made at creation. A connection keeps the app it was made with.
States
status | Meaning |
|---|---|
pending | open, within its deadline |
completed | the seller clicked Finish; connectionIds lists what they connected |
expired | passed expiresAt without finishing |
revoked | you revoked it |