variants

Embed
Preview of the card
<a href="https://linkyhub.net/docs/ref-variants"><img src="https://linkyhub.net/docs/_api/public/orgs/2fd2a4b7-b627-4925-af1e-1c51bf890403/spaces/c4b920fb-a433-40b5-b354-ff84bf0c3eb1/pages/e844f483-23f2-4d6d-ba38-f4c9b249e5ec/social-card.svg?v=3e7ae33eec8b" alt="variants" width="600" height="315"></a>
POSThttps://linkyhub.net/api/v3/products/{productId}/variantsScope products:write

Add a size, colour or other option. Buyers must then pick one at checkout.

Parameters

productIdstringpathrequired

Request body

application/json
namestringrequired
Shown to buyers, e.g. "Large / Blue".
skustring
priceCentsinteger
Null or omitted: the product price.
compareAtCentsinteger
inventoryinteger
Null or omitted: untracked.
isActiveboolean
{
  "name": "string",
  "sku": "string",
  "priceCents": 0,
  "compareAtCents": 0,
  "inventory": 0,
  "isActive": true
}

Code samples

cURL
curl -X POST "https://linkyhub.net/api/v3/products/{productId}/variants" \
  -H "Authorization: Bearer $LINKYHUB_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"name":"string","sku":"string","priceCents":0,"compareAtCents":0,"inventory":0,"isActive":true}'
TypeScript
Python
Go
PHP
Ruby
Java

Responses

201 Done.
{}
Headers
RateLimit-Limitinteger
Requests allowed in the current window.
RateLimit-Remaininginteger
Requests left in the current window.
RateLimit-Resetinteger
Seconds until the window resets.
default An error.
Example
{
  "error": "string",
  "message": "string"
}
Schema
errorstringrequired
A stable code to branch on, e.g. insufficient_scope.
messagestringrequired
A sentence to show a person.
Headers
RateLimit-Limitinteger
Requests allowed in the current window.
RateLimit-Remaininginteger
Requests left in the current window.
RateLimit-Resetinteger
Seconds until the window resets.
DELETEhttps://linkyhub.net/api/v3/variants/{variantId}Scope products:write

Delete a variant. Past orders keep their amounts.

Parameters

variantIdstringpathrequired

Code samples

cURL
curl -X DELETE "https://linkyhub.net/api/v3/variants/{variantId}" \
  -H "Authorization: Bearer $LINKYHUB_API_KEY"
TypeScript
Python
Go
PHP
Ruby
Java

Responses

200 Done.
{}
Headers
RateLimit-Limitinteger
Requests allowed in the current window.
RateLimit-Remaininginteger
Requests left in the current window.
RateLimit-Resetinteger
Seconds until the window resets.
default An error.

Same as default · POST /products/{productId}/variants

Headers
RateLimit-Limitinteger
Requests allowed in the current window.
RateLimit-Remaininginteger
Requests left in the current window.
RateLimit-Resetinteger
Seconds until the window resets.
PATCHhttps://linkyhub.net/api/v3/variants/{variantId}Scope products:write

Change a variant’s name, SKU, price, stock, order or availability.

Parameters

variantIdstringpathrequired

Request body

application/json
namestring
Shown to buyers, e.g. "Large / Blue".
skustring
priceCentsinteger
Null or omitted: the product price.
compareAtCentsinteger
inventoryinteger
Null or omitted: untracked.
isActiveboolean
positioninteger
{
  "name": "string",
  "sku": "string",
  "priceCents": 0,
  "compareAtCents": 0,
  "inventory": 0,
  "isActive": true,
  "position": 0
}

Code samples

cURL
curl -X PATCH "https://linkyhub.net/api/v3/variants/{variantId}" \
  -H "Authorization: Bearer $LINKYHUB_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"name":"string","sku":"string","priceCents":0,"compareAtCents":0,"inventory":0,"isActive":true,"position":0}'
TypeScript
Python
Go
PHP
Ruby
Java

Responses

200 Done.
{}
Headers
RateLimit-Limitinteger
Requests allowed in the current window.
RateLimit-Remaininginteger
Requests left in the current window.
RateLimit-Resetinteger
Seconds until the window resets.
default An error.

Same as default · POST /products/{productId}/variants

Headers
RateLimit-Limitinteger
Requests allowed in the current window.
RateLimit-Remaininginteger
Requests left in the current window.
RateLimit-Resetinteger
Seconds until the window resets.
PUThttps://linkyhub.net/api/v3/variants/{variantId}/inventoryScope inventory:write

Set one variant’s stock; null means untracked.

Parameters

variantIdstringpathrequired

Request body

application/json
inventoryintegerrequired
{
  "inventory": 0
}

Code samples

cURL
curl -X PUT "https://linkyhub.net/api/v3/variants/{variantId}/inventory" \
  -H "Authorization: Bearer $LINKYHUB_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"inventory":0}'
TypeScript
Python
Go
PHP
Ruby
Java

Responses

200 Done.
{}
Headers
RateLimit-Limitinteger
Requests allowed in the current window.
RateLimit-Remaininginteger
Requests left in the current window.
RateLimit-Resetinteger
Seconds until the window resets.
default An error.

Same as default · POST /products/{productId}/variants

Headers
RateLimit-Limitinteger
Requests allowed in the current window.
RateLimit-Remaininginteger
Requests left in the current window.
RateLimit-Resetinteger
Seconds until the window resets.
Updated