Create Product
curl --request POST \
--url https://{cluster}.voucherify.io/v1/products \
--header 'Content-Type: application/json' \
--header 'X-App-Id: <api-key>' \
--header 'X-App-Token: <api-key>' \
--data '
{
"source_id": "first_product",
"name": "Samsung Phone",
"price": 200000,
"attributes": [
"color",
"memory",
"processor"
],
"metadata": {
"test": true,
"vendor": "Online Store"
},
"image_url": "{{internalVoucherifyURL}}"
}
'{
"id": "prod_0bae2dc5a090fd0184",
"source_id": "first_product",
"name": "Samsung Phone",
"price": 200000,
"attributes": [
"color",
"memory",
"processor"
],
"metadata": {
"test": true,
"vendor": "Online Store"
},
"image_url": "https://www.website.com/image.png",
"created_at": "2022-09-12T12:58:22.232Z",
"updated_at": "2022-09-12T12:59:55.890Z",
"object": "product"
}Create Product
Creates a product object.
Upsert Mode
If you pass an id or a source_id that already exists in the product database, Voucherify will return a related product object with updated fields.
POST
/
v1
/
products
Create Product
curl --request POST \
--url https://{cluster}.voucherify.io/v1/products \
--header 'Content-Type: application/json' \
--header 'X-App-Id: <api-key>' \
--header 'X-App-Token: <api-key>' \
--data '
{
"source_id": "first_product",
"name": "Samsung Phone",
"price": 200000,
"attributes": [
"color",
"memory",
"processor"
],
"metadata": {
"test": true,
"vendor": "Online Store"
},
"image_url": "{{internalVoucherifyURL}}"
}
'{
"id": "prod_0bae2dc5a090fd0184",
"source_id": "first_product",
"name": "Samsung Phone",
"price": 200000,
"attributes": [
"color",
"memory",
"processor"
],
"metadata": {
"test": true,
"vendor": "Online Store"
},
"image_url": "https://www.website.com/image.png",
"created_at": "2022-09-12T12:58:22.232Z",
"updated_at": "2022-09-12T12:59:55.890Z",
"object": "product"
}Authorizations
X-App-Id & X-App-TokenX-Voucherify-OAuth
Scopes
Body
application/json
Specify the product parameters.
Request schema for POST v1/products.
Response
200 - application/json
Returns a product object if the operation succeeded.
Response body schema for POST v1/products.
The metadata object stores all custom attributes assigned to the product. A set of key/value pairs that you can attach to a product object. It can be useful for storing additional information about the product in a structured format. It can be used to create product collections.

