Redirect a tracked outbound product link
Resolves an outbound product link and answers 302 to the target, or 307 to the VoltPlan homepage when nothing resolves. Branches by priority: (1) bom — curated bom_products row: the row's URL (Amazon ASIN or manufacturer-direct) when its country matches the visitor's region (universal rows count as de), else the same slot's row curated for the visitor's country, else a localized Amazon search; unknown or inactive rows → 307. (2) q — stored affiliate link of component_id/c for the visitor's region when one exists, otherwise a localized Amazon search for q; never 307. (3) component_id, c or a known legacy p slug (sterling-pro-combi-s-1600, renogy-rover-40a) — stored affiliate link for the region, otherwise a localized Amazon search for the component name; unknown component → 307. (4) No usable parameter, including an unknown p slug → 307. component_id takes precedence over c, both over p. Region comes from the region parameters in their listed precedence, falling back to de. The click is recorded in component_click_events (with User-Agent and Referer), except in development or for bot user agents.
Request
- Base URL: https://voltplan.app
- URL: https://voltplan.app/api/go
- Auth: none declared
Query parameters
Curated bom_products row id; highest-priority branch. Unknown or inactive rows redirect home (307).
Free-text product query; used when bom is absent or blank. Redirects to the stored affiliate link of component_id/c when one exists for the region, else to a localized Amazon search for q; never 307.
PocketBase components id. Without q, an unknown id redirects home (307).
Alias of component_id, used when component_id is absent.
Legacy product slug (sterling-pro-combi-s-1600, renogy-rover-40a), used when neither component_id nor c is set; unknown slugs redirect home (307).
Click source prefix; the recorded source is <source>_affiliate or <source>_amazon_search in all branches. Without source the component branch records blog_affiliate or blog_amazon_search.
Name recorded for the click in the q branch; defaults to q.
Type recorded for the click in the q branch.
Marketplace override, highest precedence. Accepts a marketplace code (de, us, uk, fr, es, it, au), a country alias (at, ch, lu, nl, se, dk, no → de; be → fr; ca, mx → us; nz → au; ie, gb → uk; pt → es), a language code (en → us, de, fr, es, it) or a lang-COUNTRY tag (country part tried first, then language). Case-insensitive; any other value is ignored and the next region signal applies.
Same as region; read only when region is absent or empty.
Headers
Region override header, used when no query override applies.
Read only when x-voltplan-region is absent or empty.
CDN country header; checked after the VoltPlan headers.
CDN country header; checked after x-vercel-ip-country.
CDN country header; checked after cf-ipcountry.
First address is GeoIP-resolved to a country when no header above yields a region.
GeoIP-resolved when x-forwarded-for is absent.
Last signal: the first language range that normalizes to a region wins.
Changes
No recorded changes to this operation across all 1 revision of this API.