redirects

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.

get/api/go

Request

  • Base URL: https://voltplan.app
  • URL: https://voltplan.app/api/go
  • Auth: none declared

Query parameters

bomstring

Curated bom_products row id; highest-priority branch. Unknown or inactive rows redirect home (307).

qstring

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.

component_idstring

PocketBase components id. Without q, an unknown id redirects home (307).

cstring

Alias of component_id, used when component_id is absent.

pstring

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).

sourcestring

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.

component_namestring

Name recorded for the click in the q branch; defaults to q.

component_typestring

Type recorded for the click in the q branch.

regionstring

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.

countrystring

Same as region; read only when region is absent or empty.

Headers

x-voltplan-regionstring

Region override header, used when no query override applies.

x-voltplan-countrystring

Read only when x-voltplan-region is absent or empty.

x-vercel-ip-countrystring

CDN country header; checked after the VoltPlan headers.

cf-ipcountrystring

CDN country header; checked after x-vercel-ip-country.

x-country-codestring

CDN country header; checked after cf-ipcountry.

x-forwarded-forstring

First address is GeoIP-resolved to a country when no header above yields a region.

x-real-ipstring

GeoIP-resolved when x-forwarded-for is absent.

accept-languagestring

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.