Update Product
Update an existing product’s information
PUT
/
api
/
v2
/
products
/
{id}
Update Product
curl --request PUT \
--url https://api.example.com/api/v2/products/{id}import requests
url = "https://api.example.com/api/v2/products/{id}"
response = requests.put(url)
print(response.text)const options = {method: 'PUT'};
fetch('https://api.example.com/api/v2/products/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/api/v2/products/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/api/v2/products/{id}"
req, _ := http.NewRequest("PUT", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://api.example.com/api/v2/products/{id}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/v2/products/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
response = http.request(request)
puts response.read_bodyUpdate 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
| Parameter | Type | Required | Description |
|---|---|---|---|
id | integer | Yes | Product 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.| Parameter | Type | Description |
|---|---|---|
name | string | Product name (max 255 chars) |
tagline | string | Short description (max 255 chars) |
description | string | Full product description |
price | integer | Price in cents |
currency | string | ISO 4217 currency code |
merchant_product_id | string | Your reference ID |
upc_code_or_gtin | string | UPC or GTIN (triggers eligibility re-check) |
status | enum | active, inactive, or archived |
images | array | Array of image URLs (replaces all existing images) |
metadata | object | Custom key-value pairs (merged with existing) |
All monetary amounts are integers in cents (e.g., 4995 = $49.95).
Request
PUT /api/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/api/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/api/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
}
}
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"
}
}
Errors
| Status Code | Error Code | Description |
|---|---|---|
| 400 | invalid_request | Invalid parameters |
| 401 | unauthorized | Invalid or missing API key |
| 404 | not_found | Product not found |
| 422 | validation_error | Field validation failed |
| 429 | rate_limit_exceeded | Too many requests |
{
"error": {
"code": "validation_error",
"message": "Invalid price",
"details": [
{
"field": "price",
"message": "Price must be a positive integer"
}
]
}
}
Related Endpoints
- Create Product - POST /api/v2/products
- Get Product - GET /api/v2/products/
- List Products - GET /api/v2/products
- Check Eligibility - POST /api/v2/products/check-eligibility
Related Resources
⌘I
Update Product
curl --request PUT \
--url https://api.example.com/api/v2/products/{id}import requests
url = "https://api.example.com/api/v2/products/{id}"
response = requests.put(url)
print(response.text)const options = {method: 'PUT'};
fetch('https://api.example.com/api/v2/products/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/api/v2/products/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/api/v2/products/{id}"
req, _ := http.NewRequest("PUT", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://api.example.com/api/v2/products/{id}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/v2/products/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
response = http.request(request)
puts response.read_body