Skip to content

Products API ​

Push products from the vendor's system to the marketplace, then keep their price and stock up to date. All requests need the API key of the integration, see authentication. Errors follow the common format.

POST /products ​

Create or update a product in the marketplace. If a product with the same externalId already exists, it will be updated. On first creation, the product is created as DRAFT. The marketplace admin can then approve and publish it.

Request body:

FieldTypeRequiredDescription
externalIdstringyesUnique product identifier in the vendor's system
titlestringyesProduct title
descriptionHtmlstringnoProduct description in HTML
vendorstringnoBrand name (defaults to the vendor name)
productTypestringnoProduct type (e.g. "Bags")
tagsstring[]noProduct tags
productOptionsobject[]noProduct options (see below)
variantsobject[]yesAt least one variant (see below)
imagesobject[]noProduct images (see below)
metafieldsobject[]noCustom metafields (see below)

Product option ​

FieldTypeRequiredDescription
namestringyesOption name (e.g. "Size")
valuesstring[]yesOption values (e.g. ["S", "M", "L"])

Variant ​

FieldTypeRequiredDescription
skustringyesSKU identifier
barcodestringnoBarcode (EAN, UPC, etc.)
pricenumberyesSale price
compareAtPricenumbernoOriginal price before discount
inventoryQuantityintegernoAvailable stock quantity
trackedbooleannoWhether inventory is tracked (default: true)
requiresShippingbooleannoWhether shipping is required (default: true)
weightobjectno{ value: number, unit: "GRAMS" | "KILOGRAMS" | "OUNCES" | "POUNDS" }
optionValuesobject[]no[{ optionName: "Size", name: "M" }] — must match productOptions
externalVariantIdstringnoUnique variant identifier in the vendor's system

Image ​

FieldTypeRequiredDescription
srcstringyesPublic URL of the image
altstringnoAlt text for accessibility
externalIdstringnoUnique image ID to avoid re-uploading on updates

Metafield ​

FieldTypeRequiredDescription
keystringyesMetafield key (e.g. "material")
valuestringyesMetafield value (e.g. "leather")

Example request:

bash
curl -X POST https://api.garnetmarketplace.com/products \
  -H "Authorization: Bearer your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "externalId": "vendor-product-123",
    "title": "Premium Leather Bag",
    "descriptionHtml": "<p>A beautiful leather bag</p>",
    "productType": "Bags",
    "tags": ["leather", "premium"],
    "productOptions": [
      { "name": "Size", "values": ["S", "M", "L"] }
    ],
    "variants": [
      {
        "sku": "BAG-001-S",
        "price": 129.99,
        "inventoryQuantity": 50,
        "optionValues": [{ "optionName": "Size", "name": "S" }]
      },
      {
        "sku": "BAG-001-M",
        "price": 129.99,
        "inventoryQuantity": 30,
        "optionValues": [{ "optionName": "Size", "name": "M" }]
      }
    ],
    "images": [
      { "src": "https://example.com/bag-front.jpg", "alt": "Front view" }
    ],
    "metafields": [
      { "key": "material", "value": "leather" },
      { "key": "country_of_origin", "value": "Italy" }
    ]
  }'

Response:

json
{ "productId": "gid://shopify/Product/123456789" }

PATCH /products ​

Bulk update price and stock for existing products by SKU. Maximum 250 items per request. Only updates variants that match existing SKUs in the marketplace.

Request body: Array of objects:

FieldTypeRequiredDescription
skustringyesSKU identifier
pricenumberyesNew price
stockintegeryesNew stock quantity

Example request:

bash
curl -X PATCH https://api.garnetmarketplace.com/products \
  -H "Authorization: Bearer your_api_key" \
  -H "Content-Type: application/json" \
  -d '[
    { "sku": "BAG-001-S", "price": 119.99, "stock": 45 },
    { "sku": "BAG-001-M", "price": 119.99, "stock": 28 }
  ]'

Response:

json
{ "updated": 1, "unknownSkus": [] }