products

Embed
Preview of the card
<a href="https://linkyhub.net/docs/ref-products"><img src="https://linkyhub.net/docs/_api/public/orgs/2fd2a4b7-b627-4925-af1e-1c51bf890403/spaces/c4b920fb-a433-40b5-b354-ff84bf0c3eb1/pages/ecc8d52b-590a-48e5-8440-c41fcd879e7b/social-card.svg?v=3e7ae33eec8b" alt="products" width="600" height="315"></a>
PATCHhttps://linkyhub.net/api/v3/products/{productId}Scope products:write

Change a product. Only the fields sent change; images replace the whole gallery.

Parameters

productIdstringpathrequired

Request body

application/json
namestring
descriptionstring
Plain text; line breaks are kept.
imagesobject[]
The whole gallery, cover first.
Show child parameters
urlstringrequired
altstring
What the image shows, for screen readers.
priceCentsinteger
In the smallest currency unit: 12.50 is 1250.
compareAtCentsinteger
Shown struck through. Null clears it.
currencystring
ISO 4217. Defaults to USD.
soldOutboolean
allowCustomAmountboolean
Pay what you want: the buyer picks the amount.
minimumCentsinteger
With allowCustomAmount: the lowest amount accepted.
isPhysicalboolean
Shipped goods: checkout collects a shipping address and the order waits for fulfilment.
isActiveboolean
False hides it without deleting it.
externalIdstring
Your own id for it; null clears it.
{
  "name": "string",
  "description": "string",
  "images": [
    {
      "url": "string",
      "alt": "string"
    }
  ],
  "priceCents": 0,
  "compareAtCents": 0,
  "currency": "string",
  "soldOut": true,
  "allowCustomAmount": true,
  "minimumCents": 0,
  "isPhysical": true,
  "isActive": true,
  "externalId": "string"
}

Code samples

cURL
curl -X PATCH "https://linkyhub.net/api/v3/products/{productId}" \
  -H "Authorization: Bearer $LINKYHUB_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"name":"string","description":"string","images":[{"url":"string","alt":"string"}],"priceCents":0,"compareAtCents":0,"currency":"string","soldOut":true,"allowCustomAmount":true,"minimumCents":0,"isPhysical":true,"isActive":true,"externalId":"string"}'
TypeScript
Python
Go
PHP
Ruby
Java

Responses

200 Done.
Example
{
  "id": "string",
  "blockId": "string",
  "kind": "string",
  "name": "string",
  "description": "string",
  "images": [
    {
      "id": "string",
      "url": "string",
      "alt": "string",
      "position": 0
    }
  ],
  "priceCents": 0,
  "compareAtCents": 0,
  "currency": "string",
  "isActive": true,
  "isPhysical": true,
  "soldOut": true,
  "inventory": 0,
  "variants": [
    {
      "id": "string",
      "name": "string",
      "sku": "string",
      "priceCents": 0,
      "compareAtCents": 0,
      "inventory": 0,
      "position": 0,
      "isActive": true
    }
  ],
  "salesCount": 0,
  "source": "block",
  "editableInPlace": true,
  "externalId": "string",
  "url": "string",
  "updatedAt": "2024-01-01T00:00:00Z"
}
Schema
idstringrequired
blockIdstringrequired
kindstringrequired
namestringrequired
descriptionstringrequired
imagesobject[]required
Show child parameters
idstringrequired
urlstringrequired
altstringrequired
positionintegerrequired
priceCentsintegerrequired
compareAtCentsintegerrequired
currencystringrequired
isActivebooleanrequired
isPhysicalbooleanrequired
soldOutbooleanrequired
inventoryintegerrequired
variantsobject[]required
Show child parameters
idstringrequired
namestringrequired
skustringrequired
priceCentsintegerrequired
compareAtCentsintegerrequired
inventoryintegerrequired
positionintegerrequired
isActivebooleanrequired
salesCountintegerrequired
sourcestringrequired
block | shopify | print-on-demand | external
editableInPlacebooleanrequired
externalIdstringrequired
Your own id for the product, as you set it. Other apps never see it.
urlstringrequired
The product on the creator’s public page; null when no block sells it.
updatedAtstringrequired
The latest change to the product or any of its 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.
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.
POSThttps://linkyhub.net/api/v3/products/{productId}/filesScope products:write

Attach a file buyers receive after paying (multipart, part "file").

Parameters

productIdstringpathrequired

Request body

multipart/form-data
filestringrequired
{
  "file": "string"
}

Code samples

cURL
curl -X POST "https://linkyhub.net/api/v3/products/{productId}/files" \
  -H "Authorization: Bearer $LINKYHUB_API_KEY" \
  -H "Content-Type: multipart/form-data" \
  -d '{"file":"string"}'
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 · PATCH /products/{productId}

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/products/{productId}/files/{assetId}Scope products:write

Remove a delivered file. Buyers who already downloaded it keep their copy.

Parameters

productIdstringpathrequired
assetIdstringpathrequired

Code samples

cURL
curl -X DELETE "https://linkyhub.net/api/v3/products/{productId}/files/{assetId}" \
  -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 · PATCH /products/{productId}

Headers
RateLimit-Limitinteger
Requests allowed in the current window.
RateLimit-Remaininginteger
Requests left in the current window.
RateLimit-Resetinteger
Seconds until the window resets.
POSThttps://linkyhub.net/api/v3/products/{productId}/courseScope products:write

Turn a product into a course, so buyers get its lessons.

Parameters

productIdstringpathrequired

Code samples

cURL
curl -X POST "https://linkyhub.net/api/v3/products/{productId}/course" \
  -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 · PATCH /products/{productId}

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