Many merchants have run into the same problem: you adjust a price or start a promotion in the APSDAI dashboard, but the price on your website is still the old hard-coded number and has to be updated by hand. To solve this, we have added a product price query API to APSDAI JS, so the prices on your pages stay in sync with the dashboard automatically.

The New Initialization Mode

To use the JS API, you need the instantiation integration mode: load APSDAI JS first, then call window.APSDAI() to create an instance.

<script src="https://i-cdn.softscdn.com/apsdai.min.js"></script>
<script>
const example = window.APSDAI({ name: 'your_merchant_code' });
</script>

One important note: when using the instantiation mode, you must not also pass configuration through window.Apsdai — the configuration can only be passed in the instantiation parameters. The original declarative approach (declaring window.Apsdai before loading the script) still works and existing integrations do not need to be changed, but please pick one of the two forms and do not mix them.

Querying Product Prices

The instance method Product.Prices() returns product information. The first parameter is the product PATH from your dashboard, and the second parameter is an optional currency.

// Example 1: automatic currency selection
example.Product.Prices('PATH1')
    .then(res => { console.log(res); })
    .catch(err => { console.log(err); });

// Example 2: specify the currency
example.Product.Prices('PATH1', 'usd');

// Example 3: query multiple products at once
example.Product.Prices(['PATH1', 'PATH2', 'PATH3'], 'cny');

As for currencies, the International site supports cny, usd, twd and hkd, while the China site supports cny only; if omitted, the system selects the currency automatically.

What Data Is Returned

The API returns product information keyed by product PATH, including the product name, SKU, description, image, original price, current selling price and whether the product is on promotion:

{
    "code": 0,
    "data": {
        "PATH1": {
            "title": "Sample Product",
            "sku": "SKU",
            "desc": "Software description",
            "images": "url",
            "original_price": 12,
            "price": 2,
            "is_promotion": true
        }
    },
    "msg": ""
}

With original_price, price and is_promotion, you can easily render a struck-through original price, the promotional price and a "limited-time offer" badge on your pages — no front-end changes needed when a promotion starts or ends.

Best Practices

  • Batch queries: when rendering a product list, pass an array of PATHs in one call to avoid multiple requests
  • Centralized price management: prices are maintained entirely in the dashboard and no longer hard-coded on the front end, reducing mistakes when listing products or adjusting prices
  • Pair with payment buttons: the products you query work directly with data-apsdai-checkout buttons to complete the checkout flow

For the full parameter reference and field descriptions, see the Help Center documentation: Payment API Custom Parameters.