Skip to main content

Create Product

You can create a product using this service.

Warning

When sending product information, three main fields are considered: name, productCode, and brand. Here are the important considerations for these fields:

  1. If the productCode is present:
  • The system searches the database for the productCode:
  • If found: The product creation will take place.
  • If not found: A new product will be created using the name from the name field and the code from the productCode field with default attributes.
  1. If the productCode is not present but both the brand and name fields are available:
  • A new product will be created using the name from the name field and the brand from the brand field with default attributes.
  1. If all fields (productCode, name, and brand) are provided:
  • The process will follow the first flow based on the productCode.
  1. If neither the productCode nor the name and brand fields are provided:
  • The product creation will result in an error.

Request

curl --location --request POST '<BASE_URL>/merchant-products'
--header 'Content-Type: application/json'
--header 'Authorization: Basic ZGVtbzpwQDU1dzByZA=='
--data '{
"name": "<string>",
"productCode": "<string>",
"serialNumber": "<string>",
"model": "<string>",
"brand": "<string>",
"warrantyYear": "<integer>",
"description": "<string>",
"setupRequired": "<boolean>"
}'

Request Parameters

ParameterTypeRequired
Description
merchantCodeStringYesThe merchant code to which the product belongs.

Request Body

Parameter
Type
Required
Description
nameStringNoThe name of the product.
productCodeStringNoThe product code.
serialNumberStringNoThe product's serial number.
modelStringNoThe product model.
brandStringNoThe brand of the product.
warrantyYearIntegerYesThe warranty period of the product.
descriptionStringNoThe product description.
setupRequiredBooleanYesIndicates whether the product requires installation.

Response

200 OK
{
"id": 23891,
"name": "Arçelik No Frost Bulaşık Makinesi 2022",
"model": "HG3342",
"description": null,
"categoryTree": "Elektronik > Beyaz Eşya > Bulaşık Makinesi",
"brand": "Arçelik",
"mainCategoryId": 1,
"categoryId": 7,
"subCategoryId": 36,
"subCategoryBrandId": 886,
"merchantName": "Fakir",
"warrantyYear": 2,
"setupRequired": true,
"createdAt": "2023-07-17 22:46",
"updatedAt": "2023-07-31 14:07",
"source": "PANEL",
"productCode": "e1bce2c449674094b52c8378959918cd",
"imageUrl": null
}