Skip to main content
PUT
/
v2
/
products
/
{id}
Update Product
curl --request PUT \
  --url https://api.example.com/v2/products/{id}

Update Product

Update product details including price, description, images, and metadata. Changes to UPC code will trigger a new eligibility check.

Authentication

Authorization: Bearer glm_test_YOUR_API_KEY

Path Parameters

ParameterTypeRequiredDescription
idintegerYesProduct ID

Request Body

{
  "name": "Premium Blood Pressure Monitor",
  "tagline": "Professional-grade automatic BP monitoring",
  "description": "Updated description with new features",
  "price": 5495,
  "images": [
    "https://cdn.example.com/bp-monitor-updated.jpg"
  ],
  "metadata": {
    "category": "medical_devices",
    "brand": "HealthTech Pro",
    "version": "2.0"
  }
}

Parameters

All parameters are optional. Only include fields you want to update.
ParameterTypeDescription
namestringProduct name (max 255 chars)
taglinestringShort description (max 255 chars)
descriptionstringFull product description
priceintegerPrice in cents
currencystringISO 4217 currency code
merchant_product_idstringYour reference ID
upc_code_or_gtinstringUPC or GTIN (triggers eligibility re-check)
statusenumactive, inactive, or archived
imagesarrayArray of image URLs (replaces all existing images)
metadataobjectCustom key-value pairs (merged with existing)
All monetary amounts are integers in cents (e.g., 4995 = $49.95).

Request

PUT /v2/products/{id}

Response

Returns the updated product object:
{
  "id": 12345,
  "name": "Premium Blood Pressure Monitor",
  "tagline": "Professional-grade automatic BP monitoring",
  "description": "Updated description with new features",
  "price": 5495,
  "currency": "USD",
  "merchant_product_id": "BP-MONITOR-001",
  "upc_code_or_gtin": "14567890123456",
  "status": "active",
  "eligibility": {
    "hsa_fsa_eligible": true,
    "message": "SIGIS verified - Medical device",
    "checked_at": "2025-10-18T14:30:00Z"
  },
  "images": [
    {
      "id": 569,
      "url": "https://cdn.example.com/bp-monitor-updated.jpg",
      "is_primary": true
    }
  ],
  "metadata": {
    "category": "medical_devices",
    "brand": "HealthTech Pro",
    "version": "2.0"
  },
  "created_at": "2025-10-18T14:30:00Z",
  "updated_at": "2025-10-18T16:00:00Z"
}

Examples

Update Price

curl -X PUT https://api.withgale.com/v2/products/12345 \
  -H "Authorization: Bearer glm_test_YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "price": 5495
  }'

Update Description and Status

curl -X PUT https://api.withgale.com/v2/products/12345 \
  -H "Authorization: Bearer glm_test_YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "description": "Enhanced model with improved accuracy and larger display",
    "tagline": "Professional-grade BP monitor",
    "status": "inactive"
  }'

Metadata Merging

Metadata updates are merged with existing values, not replaced:
// Existing metadata
{
  "metadata": {
    "category": "medical",
    "brand": "HealthTech"
  }
}

// Update request
{
  "metadata": {
    "inventory": 50
  }
}

// Result (merged)
{
  "metadata": {
    "category": "medical",
    "brand": "HealthTech",
    "inventory": 50
  }
}
To remove a metadata field, set it to null:
{
  "metadata": {
    "old_field": null
  }
}

Webhooks

Product updates trigger the following webhook event:
{
  "type": "product.updated",
  "data": {
    "id": 12345,
    "name": "Premium Blood Pressure Monitor",
    "price": 5495,
    "updated_at": "2025-10-18T16:00:00Z"
  }
}
See Webhooks Reference for details.

Errors

Status CodeError CodeDescription
400invalid_requestInvalid parameters
401unauthorizedInvalid or missing API key
404not_foundProduct not found
422validation_errorField validation failed
429rate_limit_exceededToo many requests
Example error:
{
  "error": {
    "code": "validation_error",
    "message": "Invalid price",
    "details": [
      {
        "field": "price",
        "message": "Price must be a positive integer"
      }
    ]
  }
}