Marketplace SDK
If you run a marketplace, you collect your sub-merchants' (sellers') applications on your own site. This SDK is the data layer of that self-onboarding portal.
The flow
You mint a token → send the seller a link → the seller fills the form
│
application → KYC → contract → submissionThe seller does not need a Lunixi account; the session is carried by the invite token.
Authentication — not Bearer
The Marketplace SDK does not use Authorization: Bearer. The session is a portal token (mp_…) carried in the X-Marketplace-Token header. Because you mint the token and hand it to the seller, there is no key for the seller to store.
Usage
<script src="https://cdn.lunixi.com/lunixi-loader.min.js"></script>// Renders the whole application wizard
await Lunixi.marketplace.mount('#onboarding', {
token: 'mp_...', // comes from the invite link
});React and the wizard screens are lazy-loaded on first mount; go headless and they never enter your bundle.
Client methods
| Method | What it does | Endpoint |
|---|---|---|
getApplicationStatus() | Returns the step the application is on | GET /api/v1/marketplace/portal/application |
submitApplication(payload) | Submits the application fields | POST /api/v1/marketplace/portal/submit |
getKycHandoff() | Gets the handoff details for the KYC flow | GET /api/v1/marketplace/portal/kyc-handoff |
signContract(payload) | Signs the contract | POST /api/v1/marketplace/portal/sign |
getToken() | Returns the active session token | — |
KYC handoff
When the application reaches the step that needs identity verification, getKycHandoff() gives you the handoff details and you move into the KYC SDK flow. Both SDKs can run on the same page — the loader fetches each one.
Things to know
Because you deliver the token by email or SMS, the link is a shareable secret. Keep its lifetime short, mint it per seller, and invalidate it once the application completes.
The SDK throws on failure — if the response is not 2xx you get an error carrying code and status (MARKETPLACE_REQUEST_FAILED is the default code). It never returns a silent empty result, so catch these between wizard steps and show the seller something meaningful.
Related
- Web SDK Overview — loader, modes, authentication models
- KYC SDK — the flow that runs after the handoff