Skip to main content
POST
/
api
/
creator
/
v1
/
links
Create an attribution link
curl --request POST \
  --url https://app.openlight.tech/api/creator/v1/links \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "brand_id": "<string>",
  "product_id": "<string>",
  "destination_url": "<string>",
  "tracking_id": "<string>"
}
'
{
  "link": {
    "id": "<string>",
    "brand_id": "<string>",
    "product_id": "<string>",
    "url": "<string>",
    "destination_url": "<string>",
    "marketplace": "<string>",
    "tracking_id": "<string>",
    "status": "active",
    "created_at": "2023-11-07T05:31:56Z"
  }
}
Use this endpoint to create an attribution link. The request must include brand_id and product_id; it may also include optional tracking_id and destination_url. Field notes:
  • tracking_id: Client-side tracking tag, up to 200 characters. Put your downstream tag, campaign, or source value here. Leading/trailing whitespace is trimmed and ASCII control characters are rejected. Create and list responses return the normalized value, and future reports will use it for downstream attribution.
  • destination_url: Amazon landing page URL. If omitted, OpenLight uses the product detail page. It controls where the click lands and is not a tracking tag.
A successful request returns 201 with { "link": LinkDTO }. The response marketplace field returns the Amazon marketplace domain for the link, such as amazon.com, amazon.co.uk, or amazon.de. It identifies the link’s Amazon site; it is not a partnership status or tracking tag. Possible errors include:
  • 400 invalid_request: The request body is incomplete or invalid.
  • 403 forbidden_resource: The current token owner cannot access the brand or product.
  • 403 ads_not_connected: The brand ads connection is not ready for link creation.
  • 404 product_not_found: The product does not exist or is not accessible.
Related operation: to view existing attribution links, use List attribution links.

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
brand_id
string
required

品牌 ID。Brand ID.

product_id
string
required

商品 ID。Product ID.

destination_url
string

Amazon 落地页 URL;可选,默认使用商品详情页。Amazon landing page URL; optional, defaults to the product detail page.

tracking_id
string

客户侧追踪标识;可选,前后空白会被裁剪,不能包含 ASCII 控制字符。创建和列表响应会返回规范化后的值,后续报表也会使用该字段做下游归因。Client-side tracking tag; optional, leading/trailing whitespace is trimmed and ASCII control characters are rejected. Create/list responses return the normalized value, intended for downstream reporting.

Maximum string length: 200

Response

Attribution link created