Overview
Use this setup when you want the frontend to feel fully yours, but you still want Shoppex to handle the hard backend parts.Your Frontend
You control the branding, layout, auth flow, and customer experience.
Shoppex Backend
Shoppex handles order creation, affiliate attribution, balances, and payout requests.
API-First Flow
You connect your app to Shoppex through API endpoints instead of using a hosted dashboard UI.
This guide is for merchants who want a white-label customer or affiliate portal.
What Shoppex Handles
Orders With Affiliate Attribution
Create an order and attach an
affiliate_code so the referral stays linked to the invoice.Affiliate Stats And Balance
Read referral links, clicks, sales, commissions, claims, and balance buckets for your frontend.
Convert To Store Balance
Let affiliates move approved earnings into store balance with an API-triggered action.
Crypto Payout Requests
Accept payout requests without forcing automatic onchain payouts.
Recommended Portal Experience
For a strong headless setup, your portal usually needs three surfaces:Orders
Show invoices, payment state, and order history.
Affiliate
Show referral code, referral link, clicks, conversions, and commissions.
Balance Actions
Let affiliates convert earnings into store balance or request a payout.
Typical Integration Flow
Start provider payment
Your app starts the payment session for the gateway you want, like Stripe or PayPal.
1. Create The Order
Create the invoice or order from your frontend or backend and attach the affiliate code. Simple example:- your backend calls the invoice create flow
- it includes
affiliate_code: "creator123" - Shoppex stores the affiliate attribution on the invoice
2. Start Payment With The Provider You Want
You do not need to use a generic Shoppex checkout page if your flow is more API-first. Simple example:- create the invoice
- create a Stripe or PayPal payment session
- send the customer into that provider flow
- let Shoppex complete the invoice through the normal payment lifecycle
Think of Shoppex as the payment and accounting backend, while your frontend stays fully branded.
3. Read Affiliate Data For Your Frontend
For a headless customer or affiliate dashboard, use the Dev API affiliate endpoints.Affiliate Summary
GET /dev/v1/customers/{id}/affiliateConvert To Balance
POST /dev/v1/customers/{id}/affiliate/convert-to-balancePayout Request
POST /dev/v1/customers/{id}/affiliate/payout-requests- referral link and code
- clicks and sales
- commissions
- claims
- balance buckets like
available,requested, andconverted
4. Convert Affiliate Balance Into Store Balance
This is the self-serve flow for affiliates who want to spend their earnings inside the store instead of cashing out.- affiliate balance has
25 - user enters
10 - Shoppex creates the balance claim
- Shoppex credits
10into store balance
5. Create A Crypto Payout Request
This flow is for affiliates who want to request a payout without forcing fully automatic onchain settlement.This does not go through a payment gateway like Stripe or PayPal. Simple example: the API stores a payout request, then your own ops flow, webhook consumer, or treasury process decides whether and how the crypto payout gets fulfilled.
- affiliate enters an amount and wallet address
- your UI submits the payout request
- Shoppex stores the request cleanly
- your ops flow or webhook worker decides what happens next
Recommended Scopes
A good starting scope set for this type of portal is:| Scope | Why you usually need it |
|---|---|
customers.read | Read affiliate summaries and customer-linked data |
customers.write | Convert balances and create payout requests |
orders.read | Show order history or order-linked affiliate activity |
invoices.read | Read invoice state for payment and attribution context |
Good Implementation Rule
Keep one clear source of truth:- Shoppex owns affiliate balances, claims, payout requests, and invoice attribution
- your frontend owns branding, navigation, and UX
Best Fit
This setup is a strong fit when you want:- a fully branded customer portal
- a branded affiliate dashboard
- custom onboarding or checkout entry pages
- Shoppex handling the accounting and payment-side complexity in the background