Onboarding
About 741 words
Going from zero to your first order takes the five steps below. Everything can be done self-service in the distributor portal; the steps that do not require manual approval are marked explicitly.
Step 1: Register and sign in to the portal
Register an account on the xstock distributor portal and sign in. One account represents one business entity and includes:
- Sign-in credentials (used for portal sign-in only)
- Settlement currency and contact details
- Account balance and tier
- Multiple stores can be created under the account
How accounts and stores relate
The account owns "money"; the stores own "integration". All stores under the same account share the balance and tier, but each has its own API Key, Secret, callback URL, and API scopes. A problem with one store does not affect the others.
Step 2: Top up your balance
Submit a top-up request on the portal's top-up page and complete the payment. Once the funds are credited, the balance can be used to place orders.
- Balances are initially partitioned by settlement currency: an account has only one settlement currency enabled at a time, with no automatic currency conversion.
- After a top-up is credited, the account tier takes effect on the next quote; no additional action is needed.
For details, see Balance and Billing.
Step 3: Create a store and obtain credentials
Create a new store in the portal and fill in:
| Setting | Description |
|---|---|
| Store name | Used only to tell stores apart in the portal; not used for API addressing |
| Storefront type | Dujiao-Next-type storefronts are currently supported; choose "Custom integration" for a self-built storefront |
| Callback URL | An HTTPS URL; after saving, the platform initiates a validation, and events are delivered only once validation passes |
| API scopes | Select as needed, for example product read, quote, order placement, order query, deliverable read, and after-sales |
| IP allowlist | Optional; once configured, only allowlisted addresses can call the API |
After saving, the system generates a pair of credentials:
- API Key: a public identifier sent with the request headers.
- API Secret: used only to compute signatures and displayed in full only once at generation time. Save it to your server configuration immediately.
Handling requirements
The Secret is equivalent to the account's calling permissions for that store. Do not write it into frontend code, repositories, logs, or customer-service documents. If you suspect a leak, rotate it in the portal immediately; after the new key takes effect, the old key expires within the grace period, and the attribution of historical orders is unchanged.
Step 4: Complete callback validation
The platform sends one validation request to the callback URL you provided:
- Your server verifies the signature and returns
{"code":"OK"}. - Only after validation passes is the callback URL considered valid.
- Changing the URL triggers re-validation, and the old URL stops receiving deliveries.
Requirements for the callback receiver:
- Publicly reachable, supports HTTPS, and has a valid certificate
- Returns 2xx within 5 seconds, with business processing done asynchronously
- Idempotent per
event_id, so repeated deliveries are not processed twice
For details, see Callback Events.
Step 5: Integration testing and go-live
We recommend testing in the following order:
get_categoriesto pull the category catalog, thenget_goodsto pull the product list, and confirm that SKUs are returned.get_availto check the sellable quantity of a few SKUs.get_quoteto obtain a quote and verify the amount and currency.post_orderto place a small test order.- Wait for the
order.fulfilledcallback, or pollget_ordersfor the status. - Call
get_orderswithwith_delivers=trueto fetch the deliverables and confirm the content is complete. - Walk through
req_cancel(cancel before delivery) andopen_ticket(submit an after-sales ticket).
Switch production traffic over only after everything passes. For an item-by-item checklist, see Integration Acceptance Checklist.
Common blockers
| Symptom | Check first |
|---|---|
| 401 or signature error | Is the timestamp within 5 minutes, and does the signature string include the digest of the raw request body? |
| 403 no permission | Has the store been granted the corresponding API scope? |
| 429 | Has the per-minute call limit been exceeded? See Errors and Retries |
| Order rejected for insufficient balance | Is the portal balance sufficient to hold this order's amount? |
| No callback received | Has the callback URL passed validation, and does it return 2xx within 5 seconds? |