Getting Started
Before you can split a payment, you need two things: sellers (sub-dealers) registered in your marketplace, and commission rules that tell Lunixi how much of each seller's leg belongs to you. This page walks through both, plus the dealer lifecycle you'll manage day to day.
All endpoints here use your server-side access token (Authorization: Bearer at_live_…) — see Authentication. Base URL: https://api-gateway.lunixi.com/api/v1.
How it works
Create sellers
Register each seller with POST /marketplace/dealers — or import your existing base in one call with POST /marketplace/dealers/bulk.
Set commission rules
Define a DEFAULT rule, then override per category or per seller. Dry-run with POST /marketplace/commission-rules/preview and inspect the effective rate for any seller with GET /marketplace/commission/resolve.
Onboard the sellers
Each seller completes KYC and signs the contract through the onboarding portal or SDK. Only ACTIVE sellers can receive split payments.
Start charging
Add sellers[] to a payment request — see Split 2D Payment.
Register a seller
Create a sub-dealer with its legal profile. The seller starts at the APPLICATION onboarding stage (coarse status DRAFT).
curl -X POST https://api-gateway.lunixi.com/api/v1/marketplace/dealers \
-H "Authorization: Bearer at_live_5f3e2b1a..." \
-H "Content-Type: application/json" \
-d '{
"dealerType": "LEGAL_ENTITY",
"verificationMode": "LUNIXI_KYC",
"country": "TR",
"externalRef": "seller-1042",
"profile": {
"legalName": "Aksoy Elektronik Ticaret A.Ş.",
"displayName": "Aksoy Elektronik",
"taxIdType": "VKN",
"taxId": "1234567890",
"categoryCode": "electronics",
"email": "[email protected]",
"phone": "+905550001122"
},
"authorizedPersons": [
{ "fullName": "Ayşe Aksoy", "email": "[email protected]", "hasSignatureAuthority": true, "isPrimary": true }
]
}'Key fields:
| Field | Notes |
|---|---|
dealerType | LEGAL_ENTITY or INDIVIDUAL |
verificationMode | LUNIXI_KYC (Lunixi runs KYC in the onboarding portal), EXTERNAL or NONE |
profile.taxIdType | VKN, TCKN or VAT_NO |
profile.categoryCode | Used by category-scoped commission rules |
externalRef | Your own seller id — round-trips on reads |
Bulk import (CSV rows)
Migrating an existing seller base? Send parsed CSV rows in one request:
curl -X POST https://api-gateway.lunixi.com/api/v1/marketplace/dealers/bulk \
-H "Authorization: Bearer at_live_5f3e2b1a..." \
-H "Content-Type: application/json" \
-d '{
"rows": [
{ "firmaAdi": "Aksoy Elektronik A.Ş.", "vkn": "1234567890", "kategori": "electronics", "email": "[email protected]", "komisyon": "8.5" },
{ "firmaAdi": "Yıldız Moda Ltd.", "vkn": "9876543210", "kategori": "fashion", "email": "[email protected]" }
]
}'Each row takes firmaAdi (company name) and vkn (tax number) as required, plus optional kategori, email and komisyon (a per-seller commission rate applied at import).
The dealer lifecycle
Every seller carries an onboarding stage — a fine-grained, resumable position in the onboarding flow:
AWAITING_TERMS: the seller cannot move until you set commission and payout terms. Every other step is on the seller or on verification.| Stage | Who acts | What happens |
|---|---|---|
APPLICATION | Seller | Seller created; send the onboarding link — the seller fills the application in the portal/SDK |
KYC_PENDING | Seller | Identity verification runs in the portal/SDK |
AWAITING_TERMS | You | Set commission & payout terms (POST /marketplace/dealers/{id}/terms) |
CONTRACT_PENDING | Seller | Contract sent; seller signs in the portal/SDK |
COMPLETED | — | You activated the seller (POST /marketplace/dealers/{id}/activate) — coarse status flips to ACTIVE, eligible for split payments |
A failed KYC moves the seller to the terminal REJECTED stage. The onboarding stage is distinct from the coarse lifecycle status (DRAFT → PENDING_KYC → ACTIVE, plus SUSPENDED / HOLD / CLOSED) used for day-to-day eligibility.
Track any seller's position with GET /marketplace/dealers/{id}/application, and list your registry with GET /marketplace/dealers (filters: status, search, limit, offset).
Suspending and reactivating
PUT /marketplace/dealers/{id}/status changes the seller's coarse lifecycle status — for example suspending a seller so new split payments to them are rejected:
curl -X PUT https://api-gateway.lunixi.com/api/v1/marketplace/dealers/d_8f2a.../status \
-H "Authorization: Bearer at_live_5f3e2b1a..." \
-H "Content-Type: application/json" \
-d '{ "status": "SUSPENDED" }'A suspended seller fails split-payment eligibility with SELLER_SUSPENDED — see Split 2D Payment.
Commission rules
Commission decides how much of each seller leg you keep. Rules are resolved most-specific-first: per-seller → category → default. Creating a new rule for the same scope supersedes the currently active one (effective-dated).
Create a rule
# Default rule: 10% on everything
curl -X POST https://api-gateway.lunixi.com/api/v1/marketplace/commission-rules \
-H "Authorization: Bearer at_live_5f3e2b1a..." \
-H "Content-Type: application/json" \
-d '{ "scope": "DEFAULT", "basis": "PERCENT", "ratePercent": "10" }'
# Category override: 8.5% for electronics
curl -X POST https://api-gateway.lunixi.com/api/v1/marketplace/commission-rules \
-H "Authorization: Bearer at_live_5f3e2b1a..." \
-H "Content-Type: application/json" \
-d '{
"scope": "CATEGORY",
"categoryCode": "electronics",
"basis": "PERCENT",
"ratePercent": "8.5",
"reasonNote": "Electronics campaign Q3"
}'
# Per-seller override: fixed ₺5.00 per transaction
curl -X POST https://api-gateway.lunixi.com/api/v1/marketplace/commission-rules \
-H "Authorization: Bearer at_live_5f3e2b1a..." \
-H "Content-Type: application/json" \
-d '{
"scope": "SUB_DEALER",
"subDealerId": "d_8f2a...",
"basis": "FIXED",
"fixedAmountMinor": "500"
}'| Field | Notes |
|---|---|
scope | DEFAULT, CATEGORY (requires categoryCode) or SUB_DEALER (requires subDealerId) |
basis | PERCENT (with ratePercent, as a string, e.g. "8.5") or FIXED (with fixedAmountMinor, minor-unit string) |
minTransactionMinor | Optional minimum transaction amount for the rule to apply (minor-unit string) |
reasonNote | Free-text note recorded in the audit log |
List active rules with GET /marketplace/commission-rules.
Preview before committing
POST /marketplace/commission-rules/preview accepts the same body as rule creation and returns what the rule would do — without persisting anything. Use it to sanity-check a change against real amounts before rolling it out.
Resolve the effective rate
To see exactly which rule applies to a seller right now:
curl "https://api-gateway.lunixi.com/api/v1/marketplace/commission/resolve?subDealerId=d_8f2a...&categoryCode=electronics&mtdVolumeMinor=125000000" \
-H "Authorization: Bearer at_live_5f3e2b1a..."| Query param | Notes |
|---|---|
subDealerId | Required — the seller to resolve for |
categoryCode | Optional — the transaction's category |
mtdVolumeMinor | Optional — month-to-date volume (minor-unit string) used by volume-aware resolution |
Errors
| Status | Meaning | What to do |
|---|---|---|
400 | Validation failed (missing legalName/taxId, bad scope/basis combination) | Fix the request body |
401 | Missing or invalid API key | Check the Authorization header |
404 | Dealer not found (or belongs to another merchant) | Verify the subDealerId |
Next steps
- Seller Onboarding — mint onboarding links, hosted portal & embedded SDK
- Split 2D Payment — your first split charge
- Transactions & Payouts — the ledger side of the loop