variants
POST
https://linkyhub.net/api/v3 /products/{productId}/variants Scope products:writeAdd a size, colour or other option. Buyers must then pick one at checkout.
Parameters
productIdstringpathrequiredRequest body
application/json
namestringrequiredShown to buyers, e.g. "Large / Blue".
skustringpriceCentsintegerNull or omitted: the product price.
compareAtCentsintegerinventoryintegerNull 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-LimitintegerRequests allowed in the current window.
RateLimit-RemainingintegerRequests left in the current window.
RateLimit-ResetintegerSeconds until the window resets.
default An error.
Example
{
"error": "string",
"message": "string"
}Schema
errorstringrequiredA stable code to branch on, e.g. insufficient_scope.
messagestringrequiredA sentence to show a person.
Headers
RateLimit-LimitintegerRequests allowed in the current window.
RateLimit-RemainingintegerRequests left in the current window.
RateLimit-ResetintegerSeconds until the window resets.
DELETE
https://linkyhub.net/api/v3 /variants/{variantId} Scope products:writeDelete a variant. Past orders keep their amounts.
Parameters
variantIdstringpathrequiredCode 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-LimitintegerRequests allowed in the current window.
RateLimit-RemainingintegerRequests left in the current window.
RateLimit-ResetintegerSeconds until the window resets.
default An error.
Same as default · POST /products/{productId}/variants
Headers
RateLimit-LimitintegerRequests allowed in the current window.
RateLimit-RemainingintegerRequests left in the current window.
RateLimit-ResetintegerSeconds until the window resets.
PATCH
https://linkyhub.net/api/v3 /variants/{variantId} Scope products:writeChange a variant’s name, SKU, price, stock, order or availability.
Parameters
variantIdstringpathrequiredRequest body
application/json
namestringShown to buyers, e.g. "Large / Blue".
skustringpriceCentsintegerNull or omitted: the product price.
compareAtCentsintegerinventoryintegerNull or omitted: untracked.
isActivebooleanpositioninteger{
"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-LimitintegerRequests allowed in the current window.
RateLimit-RemainingintegerRequests left in the current window.
RateLimit-ResetintegerSeconds until the window resets.
default An error.
Same as default · POST /products/{productId}/variants
Headers
RateLimit-LimitintegerRequests allowed in the current window.
RateLimit-RemainingintegerRequests left in the current window.
RateLimit-ResetintegerSeconds until the window resets.
PUT
https://linkyhub.net/api/v3 /variants/{variantId}/inventory Scope inventory:writeSet one variant’s stock; null means untracked.
Parameters
variantIdstringpathrequiredRequest 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-LimitintegerRequests allowed in the current window.
RateLimit-RemainingintegerRequests left in the current window.
RateLimit-ResetintegerSeconds until the window resets.
default An error.
Same as default · POST /products/{productId}/variants
Headers
RateLimit-LimitintegerRequests allowed in the current window.
RateLimit-RemainingintegerRequests left in the current window.
RateLimit-ResetintegerSeconds until the window resets.
Updated