DEVELOPER API

API documentation

Use the 7 merchant endpoints below to check your balance and products, create orders, and query or download the delivered account details.

Base URLhttps://accsfox.com/v1/merchant
Pay the $1.43 activation fee and your key is issued automatically, with no manual review.

Conventions

  • GET endpoints carry X-App-Id and X-Api-Key. Keep the API Key on your own server only.
  • POST endpoints do not send X-Api-Key; they use X-Api-Timestamp, X-Api-Nonce and X-Api-Signature instead.
  • A write request’s timestamp may differ from server time by at most 300 seconds. Generate a new nonce for every request; a repeated nonce returns HTTP 409.
  • Customer-linked API keys share the customer's account balance. API fields balanceCents, priceCents and chargedAmountCents are in USD cents.
  • All seven endpoints return HTTP 402 when the balance is below the equivalent of 1.00 USD, including the balance endpoint.
  • externalOrderNo must be unique within an App ID. The same number may only retry exactly the same product, variant and quantity; anything else returns 409.
  • Requests and responses use UTF-8 JSON. POST requests must set Content-Type: application/json.
  • Each App ID has its own limits. Reads share 60 requests per minute and 10 per 10 seconds. Order creation allows 10 per minute and 2 per 10 seconds.
  • Exceeding a limit returns HTTP 429. Wait the number of seconds in Retry-After before retrying. To retry an order, reuse externalOrderNo and generate a fresh nonce and signature.
  • A failed request returns error.code and error.message; handle it by the HTTP status code.

GET authentication

X-App-Id: app_0123456789abcdef0123456789abcdef
X-Api-Key: key_your_api_key

POST request signature

Run HMAC-SHA256 over the canonical string with your API Key. First sort the body’s object keys recursively and serialize it as compact JSON, then compute its SHA-256. The signature format is sha256=<64 lowercase hex characters>.

HXPUZI-HMAC-V1
<Unix timestamp in seconds>
<nonce>
POST
/v1/merchant/orders
<SHA-256 of the canonical JSON body>
X-App-Id: app_0123456789abcdef0123456789abcdef
X-Api-Timestamp: 1786172400
X-Api-Nonce: 0123456789abcdef0123456789abcdef
X-Api-Signature: sha256=<HMAC-SHA256 result>
Content-Type: application/json

Complete signing example in Node.js

import { createHash, createHmac, randomBytes } from "node:crypto";

const appId = process.env.Demo_APP_ID;
const apiKey = process.env.Demo_API_KEY;
const baseUrl = "https://accsfox.com";
const path = "/v1/merchant/orders";
const body = {
  externalOrderNo: "merchant-order-1001",
  productId: "22222222-2222-4222-8222-222222222222",
  variantId: "33333333-3333-4333-8333-333333333333",
  quantity: 1
};

function stableJson(value) {
  if (value === null || typeof value !== "object") return JSON.stringify(value);
  if (Array.isArray(value)) return "[" + value.map(stableJson).join(",") + "]";
  return "{" + Object.keys(value).sort().map(
    (key) => JSON.stringify(key) + ":" + stableJson(value[key])
  ).join(",") + "}";
}

const timestamp = Math.floor(Date.now() / 1000).toString();
const nonce = randomBytes(16).toString("base64url");
const bodyHash = createHash("sha256").update(stableJson(body)).digest("hex");
const canonical = [
  "HXPUZI-HMAC-V1", timestamp, nonce, "POST", path, bodyHash
].join("\n");
const signature = "sha256=" + createHmac("sha256", apiKey)
  .update(canonical)
  .digest("hex");

const response = await fetch(baseUrl + path, {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
    "X-App-Id": appId,
    "X-Api-Timestamp": timestamp,
    "X-Api-Nonce": nonce,
    "X-Api-Signature": signature
  },
  body: JSON.stringify(body)
});

Key rotation and revocation

  • Sign in, click the pay-to-activate button on this page and confirm. Once the $1.43 activation fee is paid from your account balance, access is activated automatically, and this page then always shows your App ID and API Key.
  • An administrator rotates the key from the API management page; the new API Key is shown only once.
  • If your API Key has leaked or may have leaked, click “Reset API Key” on this page and enter the code sent to your sign-in email to get a new key. The App ID stays the same; the old key stops working immediately, with no grace period.
  • A grace period of 0–10080 minutes can be set for the old key; 0 makes the old key invalid at once.
  • Disabling the credential revokes both the old and the new key of that App ID at once; every endpoint then returns HTTP 401.
  • Old credentials that have not been rotated still accept the original POST authentication for now. After rotating, switch to HMAC before the grace period ends.

Signature errors

  • MERCHANT_API_SIGNATURE_REQUIRED: the write request has no signature headers.
  • MERCHANT_API_SIGNATURE_EXPIRED: the timestamp differs from server time by more than 300 seconds.
  • MERCHANT_API_SIGNATURE_INVALID: malformed headers, a modified body, or the wrong key.
  • MERCHANT_API_REPLAY_DETECTED: the nonce was already used; generate a new one.

Balance below the access minimum

{
  "error": {
    "code": "MERCHANT_BALANCE_BELOW_ACCESS_MINIMUM",
    "message": "Your balance is below the equivalent of 1.00 USD, so the merchant API is temporarily unavailable."
  }
}
01

Get merchant balance

Check the available balance for this App ID. For customer-linked keys, the account balance is converted to USD at the current store rate. balanceCents is in USD cents.

GEThttps://accsfox.com/v1/merchant/balance

No parameters

Response example

{
  "appId": "app_0123456789abcdef0123456789abcdef",
  "merchantName": "Sample merchant",
  "balanceCents": 12850,
  "currency": "USD"
}
02

List categories

Returns only the parent and child categories that are open in the store this App ID belongs to. When a parent category is not open, its children are not returned either. Use parentId to rebuild the hierarchy.

GEThttps://accsfox.com/v1/merchant/categories

No parameters

Response example

{
  "categories": [
    {
      "id": "11111111-1111-4111-8111-111111111111",
      "parentId": null,
      "name": "Facebook",
      "slug": "facebook",
      "status": "active"
    }
  ]
}
03

List products

Products can only be listed by child category, and that category must be open in the current store. category is the required child-category slug: it cannot be omitted, cannot be a parent category, and categories of other stores are not accepted. Only products listed in this store whose category is open are returned, with amounts always in USD.

GEThttps://accsfox.com/v1/merchant/products

Parameters

FieldRequiredDescription
categoryYesQuery parameter: child-category slug; parent categories are not supported. Example: facebook-accounts

Response example

{
  "products": [
    {
      "id": "22222222-2222-4222-8222-222222222222",
      "categoryId": "11111111-1111-4111-8111-111111111111",
      "title": "Product name",
      "slug": "product-slug",
      "priceCents": 150,
      "currency": "USD",
      "availableInventory": 25,
      "variants": []
    }
  ]
}
04

Product details

Returns live details by product slug. Only products listed in this store whose category is open can be accessed; otherwise 404 is returned. Fetch it again before ordering to confirm the product status, USD price, stock and variants.

GEThttps://accsfox.com/v1/merchant/products/{slug}

Parameters

FieldRequiredDescription
slugYesPath parameter: the product’s unique slug

Response example

{
  "product": {
    "id": "22222222-2222-4222-8222-222222222222",
    "title": "Product name",
    "slug": "product-slug",
    "priceCents": 150,
    "currency": "USD",
    "availableInventory": 25,
    "variants": [
      {
        "id": "33333333-3333-4333-8333-333333333333",
        "name": "10 pcs",
        "priceCents": 1400,
        "availableInventory": 8,
        "quantityStep": 1
      }
    ]
  }
}
05

Create order

Create an order with an HMAC-SHA256 signature. Customer-linked orders debit the customer's wallet after converting the product total to the wallet currency. Retrying the same externalOrderNo charges once.

POSThttps://accsfox.com/v1/merchant/orders

Parameters

FieldRequiredDescription
externalOrderNoYesYour own unique order number, up to 120 characters, ASCII letters, digits and . _ : - only. A retry with the same number must keep the same product, variant and quantity
productIdYesProduct UUID
variantIdNoVariant UUID; required for products with variants
quantityYesQuantity to buy, 1–1000

Request example

{
  "externalOrderNo": "merchant-order-1001",
  "productId": "22222222-2222-4222-8222-222222222222",
  "variantId": "33333333-3333-4333-8333-333333333333",
  "quantity": 1
}

Response example

{
  "externalOrderNo": "merchant-order-1001",
  "chargedAmountCents": 1400,
  "currency": "USD",
  "idempotent": false,
  "order": {
    "orderNo": "FO202608080001",
    "status": "paid",
    "totalAmountCents": 10080,
    "currency": "CNY"
  },
  "items": [
    {
      "productId": "22222222-2222-4222-8222-222222222222",
      "variantId": "33333333-3333-4333-8333-333333333333",
      "productTitle": "Product name · 10 pcs",
      "quantity": 1
    }
  ],
  "delivery": {
    "count": 0,
    "mode": "inline",
    "items": []
  }
}
06

Get order

Returns the status and the delivered account details of an order created by this App ID. orderNo may be your own order number, the platform order number or the platform order UUID. Up to 50 delivered items are returned inside items; above 50 they are downloaded through downloadUrl.

GEThttps://accsfox.com/v1/merchant/orders/{orderNo}

Parameters

FieldRequiredDescription
orderNoYesPath parameter: your order number, the platform order number or the order UUID

Response example

{
  "externalOrderNo": "merchant-order-1001",
  "chargedAmountCents": 1400,
  "currency": "USD",
  "order": {
    "orderNo": "FO202608080001",
    "status": "completed"
  },
  "items": [
    {
      "productTitle": "Product name · 10 pcs",
      "quantity": 1
    }
  ],
  "delivery": {
    "count": 100,
    "mode": "download",
    "items": [],
    "downloadUrl": "/v1/merchant/orders/FO202608080001/delivery.txt"
  }
}
07

Download delivered account details

Downloads the account details of a delivered order created by this App ID. It uses the same authentication headers as the other GET endpoints. The response is UTF-8 plain text with one item per line; HTTP 409 is returned while delivery is not complete.

GEThttps://accsfox.com/v1/merchant/orders/{orderNo}/delivery.txt

Parameters

FieldRequiredDescription
orderNoYesPath parameter: your order number, the platform order number or the order UUID

Response example

card-1
card-2