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:
- 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.
- 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.
- If all fields (productCode, name, and brand) are provided:
- The process will follow the first flow based on the productCode.
- 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
Parameter | Type | Required | Description |
---|---|---|---|
merchantCode | String | Yes | The merchant code to which the product belongs. |
Request Body
Parameter | Type | Required | Description |
---|---|---|---|
name | String | No | The name of the product. |
productCode | String | No | The product code. |
serialNumber | String | No | The product's serial number. |
model | String | No | The product model. |
brand | String | No | The brand of the product. |
warrantyYear | Integer | Yes | The warranty period of the product. |
description | String | No | The product description. |
setupRequired | Boolean | Yes | Indicates 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
}