Update Product
Change or modify a product or service.
This method triggers the Product Updated webhook. This webhook contains the same information as the response.
product
ID of the product.
active
Indicates whether the product is currently available for purchase.
true
attributes
Array of up to 5 alphanumeric strings defined by the merchant. Each string defines the key in a key-value pair in the
attributesobject in the correspondingskuobjects.
images
Array of Base64-encoded images.
name
The name of the product or service that is displayed to the customer.
package_dimensions
Describes the physical size and weight of the product. Relevant when
typeis goods. Contains the following fields:heightlengthweightwidth
These fields are represented as numbers, but it is the responsibility of the merchant to define and interpret the relevant units of length and weight.
statement_descriptor
A text description that appears in the customer's invoice. Limited to 22 characters. Relevant when
typeis service.
unit_label
A label that represents units of this product, such as seats, on customers’ invoices. Relevant when
typeis service.
Code Samples
.NET
using System; using System.Text.Json; namespace RapydApiRequestSample { class Program { static void Main(string[] args) { try { string product = "product_0d9dc6be69c769560fe913f3b086d8ca"; var metadata = new { merchant_defined = true }; string attributes = new string[] { "color", "armrest", "cover" }; var package_dimensions = new Object[] { new { height = 10 }, new { length = 20 }, new { weight = 100 }, new { width = 40 }, }; string result = RapydApiRequestSample.Utilities.MakeRequest("POST", $"/v1/products/{product}", request); Console.WriteLine(result); } catch (Exception e) { Console.WriteLine("Error completing request: " + e.Message); } } } }
JavaScript
const makeRequest = require('<path-to-your-utility-file>/utilities').makeRequest; async function main() { try { const body = { name: 'Gamers Red Chair' }; const result = await makeRequest( 'POST', '/v1/products/product_5d11e30104e3b802c44a08a434aef729', body ); console.log(result); } catch (error) { console.error('Error completing request', error); } }
PHP
<?php $path = $_SERVER['DOCUMENT_ROOT']; $path .= "/<path-to-your-utility-file>/utilities.php"; include($path); $body = [ "name" => "Gamer's Red Chair", "statement_descriptor" => "", ]; try { $object = make_request('post', '/v1/products/product_cc7ca57655ce8bc3149d318662b3b8bd', $body); var_dump($object); } catch(Exception $e) { echo "Error: $e"; } ?>
Python
from pprint import pprint from utilities import make_request product = { "name": "Gamer's Red Chair", "attributes": [ "color", "armrest", "cover" ], "metadata": { "merchant_defined": True }, "package_dimensions": { "height": 10, "length": 20, "weight": 100, "width": 40 } } result = make_request(method='post', path='/v1/products/product_0d9dc6be69c769560fe913f3b086d8ca', body=product) pprint(result)
/v1/products/:product
Update Product - services
curl -X post 'https://sandboxapi.rapyd.net/v1/products/product_6f3665c98c3e7eaae9697b80bc66a0e9' \ -H 'access_key: your-access-key-here' \ -H 'Content-Type: application/json' \ -H 'idempotency: your-idempotency-parameter-here' \ -H 'salt: your-random-string-here' \ -H 'signature: your-calculated-signature-here' \ -H 'timestamp: your-unix-timestamp-here' \ --data-raw '{ "active": true }'{ "status": { "error_code": "", "status": "SUCCESS", "message": "", "response_code": "", "operation_id": "204c7ac2-23b8-4504-98ed-4629e429d496" }, "data": { "id": "product_8c223b4bd834dae1170b9e338494562a", "active": true, "attributes": [], "created_at": 1761208040, "description": "Monthly parking - covered area, compact car", "images": [], "metadata": {}, "name": "Monthly parking", "package_dimensions": { "height": 0, "length": 0, "weight": 0, "width": 0 }, "shippable": false, "skus": [], "statement_descriptor": "", "type": "services", "unit_label": "", "updated_at": 1761208066 } }
Update Product - goods
curl -X post 'https://sandboxapi.rapyd.net/v1/products/product_0d9dc6be69c769560fe913f3b086d8ca' \ -H 'access_key: your-access-key-here' \ -H 'Content-Type: application/json' \ -H 'idempotency: your-idempotency-parameter-here' \ -H 'salt: your-random-string-here' \ -H 'signature: your-calculated-signature-here' \ -H 'timestamp: your-unix-timestamp-here' \ --data-raw '{ "name": "Gamer's Red Chair", "attributes": [ "color", "armrest", "cover" ] }'{ "status": { "error_code": "", "status": "SUCCESS", "message": "", "response_code": "", "operation_id": "13df4eab-812e-46d5-a04c-58bd9812bafc" }, "data": { "id": "product_94f575fe0c11a26723f91db5ceef2c25", "active": true, "attributes": [ "armrest", "color", "cover" ], "created_at": 1761206928, "description": "The ultimate in comfort for the dedicated gamer.", "images": [], "metadata": {}, "name": "Gamer's Red Chair", "package_dimensions": { "height": 0, "length": 0, "weight": 0, "width": 0 }, "shippable": true, "skus": [], "statement_descriptor": "", "type": "goods", "unit_label": "", "updated_at": 1761207579 } }