Skip to main content
POST
/
instances
/
{instanceId}
/
token
/
{token}
/
products
Create/edit product
curl --request POST \
  --url https://api.z-api.io/instances/{instanceId}/token/{token}/products \
  --header 'Client-Token: <api-key>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "<string>",
  "price": 123,
  "currency": "<string>",
  "description": "<string>",
  "images": [
    {}
  ]
}
'
{
  "id": "<string>"
}

Overview

With this method you can register and update a product in your catalog.

Attributes

instanceId
string
required
Your instance ID. Available in the Z-API panel under Instances.
token
string
required
Your Z-API instance token.

Required

name
string
required
Product name
price
integer
required
Product price
currency
string
required
Currency type (e.g.: BRL)
description
string
required
Product description
images
array
required
Product image URLs

Optional

isHidden
boolean
Hide product in catalog
salePrice
integer
Promotional price
retailerId
string
Product ID
url
string
Product URL

Request Body

{
  "currency": "BRL",
  "description": "A product description",
  "images": ["https://avatars.githubusercontent.com/u/60630101?s=200&v=4"],
  "isHidden": false,
  "name": "My first product",
  "price": 20,
  "salePrice": 18,
  "retailerId": "002",
  "url": "https://z-api.io"
}

Response

200

id
string
Created/updated product ID
{
  "id": "4741575945866725"
}

405

Make sure you are correctly sending the method specification, that is, verify that you sent POST or GET as specified at the beginning of this topic.

415

If you receive a 415 error, make sure to add the “Content-Type” header to your request, which in most cases is “application/json”.