---
title: "Redirect a component short link to its affiliate target"
method: GET
path: "/{componentId}"
tags: ["redirects"]
---

# Redirect a component short link to its affiliate target

`GET /{componentId}`

## Request

- Base URL: `https://voltplan.app`
- URL: `https://voltplan.app/{componentId}`
- Auth: none declared

Looks up the component (plus its `originalId` variant) and redirects to the stored affiliate link for the visitor's region, otherwise to a localized Amazon search for the component on that marketplace. Region comes from the region parameters in their listed precedence, falling back to `us`. The click is recorded in `component_click_events` with source `<src>_affiliate` or `<src>_amazon_search`, except in development or for bot `User-Agent`s. A malformed or unknown id answers 404.

## Query parameters

- `src` string
- `region` string
- `country` string

## Headers

- `x-voltplan-region` string
- `x-voltplan-country` string
- `x-vercel-ip-country` string
- `cf-ipcountry` string
- `x-country-code` string
- `x-forwarded-for` string
- `x-real-ip` string
- `accept-language` string

## Other responses

- `302`: Redirect to the stored affiliate link for the visitor's region or a localized Amazon search for the component.
- `404`: Agent-friendly 404 (buildNotFoundResponse): `text/markdown` when `Accept` lists `text/markdown` explicitly with a quality at least as high as `text/html` (wildcards never count), otherwise `text/html`. HEAD gets the same status and headers without a body.

---

[API](https://skmtc.dev/voltplan/apis/voltplan-api.md) · [All operations](https://skmtc.dev/voltplan/apis/voltplan-api/llms.txt) · [OpenAPI document](https://skmtc.dev/voltplan/apis/voltplan-api/revisions/575b86a7af92?raw)
