ACG-Faka Backend Setup
About 947 words
About ACG-Faka
ACG-Faka is an open-source PHP card-key storefront system. It supports automatic card-key delivery, manual delivery, upstream supplier integration and theme customization, and ships with an admin panel and several storefront templates.
Project repository
ACG-Faka connects to upstream suppliers through its "Store Sharing" feature. xstock provides a dedicated ACG-Faka adapter component: fill in the connection details in the admin panel and you can pull products, check availability and get quotes.
- Status: Supported (products, availability, quotes)
- Ordering: supported; once delivery completes, xstock writes the delivered content through a callback (see API Bridge delivery callback)
- Adapter component:
xstock.distshopadapter.acg_faka - Protocol: ACG-Faka store-sharing protocol (V3.1.2 refactored version)
Before you start
xstock's adapter URL and merchant credentials (merchant ID / merchant key). The adapter URL looks like:
http://<xstock-host>:11021/dist/acg/{shop-id}It is neither the direct API path /dist/api/v1 nor Dujiao's /api/v1/upstream.
Step 1: Sign in to the admin panel
Go to http://<your-shop-domain>/admin and sign in with the administrator email and password; the first sign-in requires a CAPTCHA.

- The admin URL is usually the shop domain plus
/admin; - If you forget the password, reset the administrator with the init command in the deployment directory.
Step 2: Open "Store Sharing"
In the left menu, open SHARED → Store Sharing. This page lists all upstream stores and their connection status.

| Column | Meaning |
|---|---|
| Store name | Local identifier; choose anything |
| Store URL | Upstream adapter URL |
| Balance (cached) | Balance at the last successful connection |
| Status | Connection result; on failure it prompts you to check the URL, protocol and credentials |
| Protocol | Share protocol version agreed with the upstream |
Step 3: Add a store
Click Add Store at the top left and fill in the form below:

| Field | Value | Description |
|---|---|---|
| Protocol | 异次元(V3.1.2 重构后全新版) | Must match the xstock adapter component; do not pick an older version |
| Store URL | http://<xstock-host>:11021/dist/acg/{shop-id} | No trailing /shared |
| Merchant ID | The app_id assigned by xstock | Obtained under "API Credentials" in the portal |
| Merchant key | The app_key assigned by xstock | Shown only once; store it once pasted |
| Counterparty currency | Match xstock's settlement currency | For example CNY |
| Settlement rate | Enter 1 for the same currency | Upstream price × rate = local base price |
| Use account cost price as cost basis | Optional | When enabled, your tier price becomes the cost basis |
Click Save. Afterwards, return to the list and click "Connect" or wait for automatic detection; the status should become connected and the balance should show the upstream available balance.
Three common causes of connection failures
- The store URL is missing
/dist/acg/{shop-id}, or has an extra/shared; - You selected an older protocol version, so field signatures do not match;
- The merchant ID / key is wrong, or the store has not been enabled on xstock.
Step 4: Sync products
Once connected, go to TRADE → Product Management and use "Sync upstream / Pull products" to import xstock's categories and products locally.

| Check | Expected |
|---|---|
| Categories | Match the xstock catalog |
| Product name | The title (the default language when several languages exist) |
| Sale price | The local price after markup rules |
| Stock | Close to the reading from the real-time stock endpoint |
| Integration status | Enabled (api_status); otherwise consumers cannot buy |
Product prices come from xstock's multi-currency prices, converted to the local currency using the counterparty currency and settlement rate.
Step 5: Markup and pricing
SHARED → Markup Templates lets you set markup ratios per upstream and per category, applied to the synced products.
Try it on a small set of products first, confirm the margins, then apply it in bulk.
Step 6: Ordering and orders
After an order is created on the storefront, check TRADE → Product Orders:

- Order details show the synced product code and the upstream response;
- After the order is accepted, it shows the pending-delivery text "order accepted, goods are being prepared";
- Once delivery completes, xstock writes the delivered content through ACG-Faka's
/xstock/callbackand marks the order as shipped; - For the callback signature, fields and deployment, see API Bridge delivery callback.
Capability status
| Capability | Status | Description |
|---|---|---|
| Connectivity test | Supported | Returns the store name and balance |
| Product list / details | Supported | Category tree plus product fields |
| Real-time stock | Supported | Query by product or spec |
| Pre-order stock check | Supported | A clear message when the quantity is insufficient |
| Real-time quote | Supported | Unit price × quantity |
| Place order | Supported | Returns the pending-delivery text after acceptance (pending_delivery_text) |
| Delivery callback | Supported (requires the extension) | xstock pushes to /xstock/callback, which writes the delivered content and marks the order as shipped |
| Order query | Partially supported | Querying an unfilled order by request number always returns found=false |
| Pre-select card keys | Not supported | The platform has no pre-selection concept and always returns an empty list |
The delivery callback is not a native ACG-Faka capability; it only works after you mount the extension file as described in the API Bridge deployment notes. Once mounted, visiting /xstock/calltest and receiving xstock-callback-ok means the extension is ready.
Related
- Interface and signature details: Acg-Faka API Bridge
- Capability boundaries and limits: Support overview
- Private or unlisted programs: Other downstream types