Mircate
  1. PIM
Mircate
  • Introduction
  • Authentication
  • Errors
  • Change Logs
  • PIM
    • Get Products
      POST
    • Get Product Settings
      GET
    • Get Catalog Settings
      GET
    • Upsert Product
      POST
    • Upsert Category
      POST
    • Bulk Product Upsert
      POST
    • Check Batch Status
      POST
    • Delete Product
      POST
    • Attach Product Attribute Image
      POST
    • Attach Category Image
      POST
    • Get Image
      GET
    • Upsert Attributes
      POST
    • Delete Attribute
      POST
    • Upsert Attribute Options
      POST
    • Upsert Attribute Option
      POST
    • Delete Attribute Option
      POST
  • Promotion
    • Calculate
      POST
    • Start Transaction
      POST
    • Commit Transaction
      POST
    • Revert Transaction
      POST
    • Cancel Transaction
      POST
    • Get Active Promotions
      GET
  • Loyalty
    • Receive Event
      POST
    • Calculate
      POST
    • Start Transaction
      POST
    • Commit Transaction
      POST
    • Cancel Transaction
      POST
    • List Measurements
      POST
  • Wallet
    • Get Wallet
    • Create Wallet
    • Create Account
    • Get Account
    • Get Accounts
    • List Accounts
    • List Transactions
    • Add Account
    • Remove Account
    • Fix
    • Load
    • Spend
    • Refund
    • Cancel
  • Talking Product
    • Create Product
    • Update Product
    • Delete Product
    • Get Product
    • List Product
  • Merchant
    • Sales Channel
      • Reserve Stock
      • Cancel Stock
      • Commit Stock
      • Refund Stock
      • Get Current Stock
    • Product Supplier
      • Receive Stock
      • Receive Price
      • Get Stock/Price History
      • Check Batch Status
      • Remove My Products
      • Clean My Products
      • Export Stock/Price
      • List Exports
      • Get Exported Files
    • Global Products
      • Receive Products
      • Get Global Products
      • Remove Global Products
  • Common
    • Dataset
      • Create
      • Update
      • Delete
      • Value Upsert
      • Value Delete
      • List Sources
      • List Values
  • How to
    • Creating a Promotion Template
    • Promotion Transaction Flow
    • Understanding PIM Product Statuses
  1. PIM

Upsert Product

Production
https://api.b2b.retter.io/5p1hp1d2t
Production
https://api.b2b.retter.io/5p1hp1d2t
POST
https://api.b2b.retter.io/5p1hp1d2t
/CALL/PIMAPI/upsertProduct/{PROJECT_ID}
PIM
Last modified:2025-01-31 14:05:41
You can access this API using an API key.
The upsertProduct API method is used to perform the addition or update operations for a product. This method can be used to update an existing product in the PIM or add a new product that is not yet present in the PIM. The method automatically detects updates and can update the product information stored in the PIM or add a new product if it doesn't already exist.

Request

Authorization
Add parameter in header
x-api-key
Example:
x-api-key: ********************
Path Params
PROJECT_ID
string 
required
Body Params application/json
dataType
string 
required
The possible types for the "dataType" field are as follows:
PRODUCT: Represents a single product. All details of the product are encompassed under this type.
PRODUCT_MODEL: Expresses a group of similar products. For instance, it can represent a specific phone model or a vehicle model.
PRODUCT_VARIANT: Specifies different variations of a product. Differences such as color, size, or features are included under this type.
PRODUCT_BUNDLE: Denotes a bundle where multiple products are brought together. For example, it can be used to represent a product set or package.
parent
string 
optional
data
object 
required
code
string 
optional
sku
string 
required
family
string 
required
enabled
boolean 
optional
This field has been deprecated. It has been replaced with the status field.
status
required
Status" encompasses three different states: "DRAFT," "ACTIVE," and "ARCHIVED.
When products are in the "DRAFT" state and are updated, webhooks are not triggered. Changes in products that are in the "ACTIVE" state trigger webhooks. Even though changes in the "ARCHIVED" state trigger the webhook, modifications within the product itself do not trigger the webhook.
Allowed values:
DRAFTACTIVEARCHIVED
groups
array[string]
optional
categories
array[string]
optional
attributes
array [object {2}] 
optional
axesValues
array [object {2}] 
optional
axe
string 
optional
value
string 
optional
bundles
array[string]
optional
products
array [object {2}] 
optional
sku
string 
required
quantity
number 
required
>= 1
translateWithAI
boolean 
optional
When the 'TranslateWithAI' parameter is sent as true from the API, the attributes that support 'Localizable' and 'TranslateWithAI' will be translated into the languages left empty based on the default language information.
For the translation process to be successfully completed, the default locale field must be filled, while the target languages should be left empty.
Example
{
    "dataType": "PRODUCT",
    "data": {
        "code": "code",
        "sku": "123456",
        "family": "testfamily",
        "status": "DRAFT",
        "groups": [
            "happy"
        ],
        "categories": [
            "drinks"
        ],
        "attributes": [
            {
                "code": "name",
                "data": [
                    {
                        "scope": "eCommerce",
                        "locale": "tr_TR",
                        "value": "awesome"
                    }
                ]
            }
        ]
    },
    "axesValues": [
        {
            "axe": "color",
            "value": "RED"
        }
    ]
}

Request samples

Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
Request Request Example
Shell
JavaScript
Java
Swift
curl --location --request POST 'https://api.b2b.retter.io/5p1hp1d2t/CALL/PIMAPI/upsertProduct/' \
--header 'Content-Type: application/json' \
--header 'x-api-key;' \
--data-raw '{
    "dataType": "PRODUCT",
    "data": {
        "code": "code",
        "sku": "123456",
        "family": "testfamily",
        "status": "DRAFT",
        "groups": [
            "happy"
        ],
        "categories": [
            "drinks"
        ],
        "attributes": [
            {
                "code": "name",
                "data": [
                    {
                        "scope": "eCommerce",
                        "locale": "tr_TR",
                        "value": "awesome"
                    }
                ]
            }
        ]
    },
    "axesValues": [
        {
            "axe": "color",
            "value": "RED"
        }
    ]
}'

Responses

🟢200OK
application/json
Successful response
Body
meta
object 
optional
createdAt
string 
optional
updatedAt
string 
optional
updateToken
string 
optional
Example
{
    "meta": {
        "createdAt": "string",
        "updatedAt": "string",
        "updateToken": "string"
    }
}
🟠400Bad Request
🟠403Forbidden
🟠404Record Not Found
Modified at 2025-01-31 14:05:41
Previous
Get Catalog Settings
Next
Upsert Category
Built with