Skip to main content

Amazon Affiliates

Overview​

Amazon Affiliates imports Amazon products into WooCommerce as external (affiliate) products. Each one links to Amazon with your Associates tracking ID, counts the clicks it sends, shows its price with the time it was fetched, and carries the disclosure Amazon requires.

Requires your own Amazon API keys

The module talks to Amazon through the Product Advertising API, using your access key, secret key and Associates tracking ID. Amazon issues API access only to approved Associates accounts that meet its sales requirements. Empora does not provide these keys.

Until all three are saved, the module shows Not connected: importing, searching and price refreshes are refused with a not_connected response, and no request is ever sent to Amazon.

It is a premium module. Enable it from Empora → Modules once your license includes amazon-affiliates; enabling it creates its clicks table and schedules its two jobs.

Availability​

ItemValue
Module keyamazon-affiliates
TierPremium — lowest plan Enterprise
Entitlement keyamazon-affiliates
Enabled optionaiowc_module_enabled_amazon-affiliates (off until enabled)
REST namespaceaiowc/v1

Connecting​

Save your access key, secret key and tracking ID, and choose your Amazon marketplace (amazon.com by default). The two keys are stored encrypted and are write-only: reading the settings tells you whether each key is set, never its value. Saving a blank key leaves the stored one unchanged; disconnecting clears both.

If Amazon rejects the keys, the module says so (keys_rejected) rather than reporting a connection.

The disclosure​

Amazon requires you to tell visitors that you earn from qualifying purchases. The module prints the disclosure beside the buy button of every imported product, and can also print it in the site footer.

The default text is: "As an Amazon Associate we earn from qualifying purchases." You can reword it, up to 300 characters, but the new text must still mention Amazon, that you earn, and qualifying purchases or commission. Text that does not is refused when you save it.

Settings​

Stored in the bundled option row aiowc_amz_settings.

KeyDefaultWhat it does
access_key—Your API access key. Write-only, stored encrypted.
secret_key—Your API secret key. Write-only, stored encrypted.
partner_tag—Your Associates tracking ID.
marketplacewww.amazon.comThe Amazon marketplace your account belongs to.
button_text"Buy on Amazon"The buy button label.
show_disclosure_footeroffAlso show the disclosure in the site footer.
disclosure_textthe standard textThe disclosure, checked as described above.
price_cache_hours24How long a fetched price is shown (1–24 hours).
click_retention_days90How long click records are kept (1–3,650 days).

What an import keeps​

Import by ASIN — one at a time or up to ten together, each reported on its own — or search Amazon and import from the results. An imported product keeps its title (which you can edit), the Amazon link with your tracking ID, the main image address, the price and the time that price was fetched. The image is shown from Amazon, not copied to your site.

On the storefront​

  • Buy button — goes through your site first, which counts the click, then sends the visitor to the product's Amazon page. Only a secure Amazon marketplace address is followed.
  • Price — shown with "Price as of" and the time it was fetched. Once it is older than the price_cache_hours setting it is replaced by "See the current price on Amazon"; an item Amazon lists as unavailable reads "Currently unavailable on Amazon".
  • Image — the Amazon image is used when the product has no image of its own.

REST API endpoints​

All require an administrator. Routes marked keys answer 409 not_connected until the module is connected.

MethodPathKeysPurpose
GET/amazon-affiliates/statusConnected or not, which keys are set, and the marketplace.
DELETE/amazon-affiliates/credentialsClear both stored keys.
POST/amazon-affiliates/importkeysImport one ASIN (asin) or up to ten (asins).
GET/amazon-affiliates/searchkeysSearch Amazon by keywords, department and page.
GET/amazon-affiliates/productsYour imported products.
POST/amazon-affiliates/products/{id}/refreshkeysRefresh one product's price now.
GET/amazon-affiliates/reportClicks per product over a period.
GET/amazon-affiliates/settingsRead the settings.
PUT / PATCH / POST/amazon-affiliates/settingsUpdate the settings.

Database schema​

TableHolds
{prefix}aiowc_amazon_clicksOne row per click to Amazon: product, ASIN and time.

Background jobs​

JobDoes
PriceRefreshJobHourly, refreshes up to ten products whose price is older than the cache window. Does nothing while not connected.
ClickCleanupJobDeletes click records older than click_retention_days.

Both are unscheduled when the module is disabled; imported products and click records stay.

Entitlement limits​

The entitlement is a single on/off grant. Without amazon-affiliates the module stays locked and none of the above loads.