curl --request POST \
--url https://api.joylink.io/public/createlink \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"destination": "https://goto.walmart.com/..."
}
'{
"url": "https://joylink.io/abc123"
}Links
Create a short link
POST
/
public
/
createlink
curl --request POST \
--url https://api.joylink.io/public/createlink \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"destination": "https://goto.walmart.com/..."
}
'{
"url": "https://joylink.io/abc123"
}Use this endpoint to create a Joylink short link from a destination URL.
The API may apply affiliate rewrites before the short link is created, so the final destination is not always identical to the
For this Impact conflict:
For this Amazon conflict:
For this Creator Connections conflict:
For this JL extra commission conflict:
Send an explicit override choice when you want to be fully declarative:
To preserve the original affiliate destination instead, send:
For an Amazon link with no
If a JL extra commission product is available and you want to keep the original destination, send:
If a Creator Connections campaign is available and you want to keep the original destination, send:
To opt into the
destination you send.
Request body
destination(required): URL to shorten.trackingid(optional): Explicit affiliate tracking value. For Amazon links, this always overrides any existingtagquery parameter on the destination.require_choices(optional): Whentrue, the API returns409 choice_requiredinstead of using the default override behavior for supported conflicts.choices(optional): Map of choice ids to selected option ids. Use this when your integration already knows how it wants to resolve a conflict.sub_id2andsub_id3(optional): Impact SubID values. These are applied only when the final destination is an Impact affiliate URL. Omit a field to preserve an existing value, or send an empty string to clear it.
Default behavior
When you do not sendrequire_choices: true, the API resolves supported conflicts automatically:
- The API starts with the
destinationyou send. - If that destination is already an Impact affiliate link for a supported retailer, and your Joylink account has synced Impact tracking for that retailer, the API rewrites the link to use your tracking by default.
- If the final destination is an Impact affiliate URL,
sub_id2andsub_id3are applied after the Impact keep or override decision. - For Amazon URLs:
trackingidalways wins and replaces any existingtag.- If
trackingidis omitted, Joylink uses the Amazon tag configured in your Joylink user settings.
- If the product has a Creator Connections campaign available, the API uses that Creator Connections link by default.
- If there is no Creator Connections campaign, but a JL extra commission link is available, the API uses that extra commission link by default.
Choice required
Whenrequire_choices is true, the API returns a 409 response with a reusable choice_required envelope instead of taking the default override path.
The endpoint evaluates conflicts one at a time, in this order:
impact_link_overrideamazon_tag_overridecreator_connections_link_overridejl_extra_commission_link_override
choices, and the API may return another 409 for the next conflict in the sequence.
Supported conflicts:
- An Impact affiliate link that would otherwise be rewritten to use your synced Impact tracking.
- An Amazon link whose existing
tagdiffers from your Joylink user tag whentrackingidis omitted. - A product with an available Creator Connections campaign that would otherwise replace the original destination.
- A product with an available JL extra commission link that would otherwise replace the original destination.
choice_required.options[].url is included when the API can preview the resulting destination ahead of time. Keep options always include it. Override options for Creator Connections and JL extra commission may omit it.
Example Impact conflict:
{
"choice_required": {
"id": "impact_link_override",
"prompt": "This link already uses an Impact affiliate tag. Choose whether to override it with your own affiliate tracking.",
"documentation_url": "https://docs.joylink.io/create-a-short-link#choice-required",
"options": [
{
"id": "override",
"label": "Override with my affiliate tracking",
"url": "https://goto.walmart.com/12345/..."
},
{
"id": "keep",
"label": "Keep the existing link",
"url": "https://goto.walmart.com/54321/..."
}
]
}
}
overridereplaces the existing Impact affiliate link with the affiliate tracking configured on your Joylink account.keeppreserves the original affiliate destination instead of replacing it.
documentation_url field points to this section so an integration can surface a helpful link when it receives the conflict.
Example Amazon conflict:
{
"choice_required": {
"id": "amazon_tag_override",
"prompt": "This Amazon link already uses a different affiliate tag. Choose whether to override it with your own affiliate tracking.",
"documentation_url": "https://docs.joylink.io/create-a-short-link#choice-required",
"options": [
{
"id": "override",
"label": "Override with my affiliate tracking",
"url": "https://www.amazon.com/dp/B0TEST1234?tag=my-tag-20"
},
{
"id": "keep",
"label": "Keep the existing link",
"url": "https://www.amazon.com/dp/B0TEST1234?tag=other-tag-20"
}
]
}
}
overridereplaces the existing Amazontagwith your Joylink user tag.keeppreserves the original Amazontagalready present on the destination URL.
{
"choice_required": {
"id": "creator_connections_link_override",
"prompt": "This product has a Creator Connections campaign available. Choose whether to override the destination with the Creator Connections link.",
"documentation_url": "https://docs.joylink.io/create-a-short-link#choice-required",
"options": [
{
"id": "override",
"label": "Override with Creator Connections"
},
{
"id": "keep",
"label": "Keep the existing link",
"url": "https://www.amazon.com/dp/B0TEST1234?tag=my-tag-20"
}
]
}
}
overrideuses the Creator Connections link that would normally be applied for this product.keeppreserves the original destination and skips the Creator Connections link rewrite.
{
"choice_required": {
"id": "jl_extra_commission_link_override",
"prompt": "This product has a JL extra commission link available. Choose whether to override the destination with the JL extra commission link.",
"documentation_url": "https://docs.joylink.io/create-a-short-link#choice-required",
"options": [
{
"id": "override",
"label": "Override with JL extra commission link"
},
{
"id": "keep",
"label": "Keep the existing link",
"url": "https://www.amazon.com/dp/B0TEST1234?tag=my-tag-20"
}
]
}
}
overrideuses the JL extra commission link that would normally be applied for this product.keeppreserves the original destination and skips the extra commission link rewrite.
Choose the behavior up front
If your integration already knows how it wants to handle this conflict, send the choice up front in thechoices object.
Example request that uses the default override behavior:
{
"destination": "https://goto.walmart.com/..."
}
{
"destination": "https://goto.walmart.com/...",
"choices": {
"impact_link_override": "override"
}
}
{
"destination": "https://goto.walmart.com/...",
"choices": {
"impact_link_override": "keep"
}
}
trackingid, preserve the existing Amazon tag with:
{
"destination": "https://www.amazon.com/dp/B0TEST1234?tag=other-tag-20",
"choices": {
"amazon_tag_override": "keep"
}
}
{
"destination": "https://www.amazon.com/dp/B0TEST1234?tag=my-tag-20",
"choices": {
"jl_extra_commission_link_override": "keep"
}
}
{
"destination": "https://www.amazon.com/dp/B0TEST1234?tag=my-tag-20",
"choices": {
"creator_connections_link_override": "keep"
}
}
409 flow, send:
{
"destination": "https://goto.walmart.com/...",
"require_choices": true
}
Body
application/json
When true, the API returns 409 choice_required instead of using the default override behavior for supported conflicts. Conflicts are evaluated one at a time in this order: impact_link_override, amazon_tag_override, creator_connections_link_override, jl_extra_commission_link_override.
Example:
false