> ## Documentation Index
> Fetch the complete documentation index at: https://developers.e-cross.tech/llms.txt
> Use this file to discover all available pages before exploring further.

# Upsert SKUs

> Create or update SKUs of the Merchant catalog

<Warning>
  All the variations (SKUs) of a product must be sent together in the same request, even if only one SKU is being
  updated. SKUs not included in the request will be considered DELETED from the product and will be removed the
  connected sales channels.
</Warning>

<RequestExample>
  ```bash cURL theme={null}
  curl -X POST 'https://product.api.e-cross.tech/ext/merchant/skus' \
    -H 'Authorization: Bearer YOUR_TOKEN' \
    -H 'Content-Type: application/json' \
    -d '[
      {
        "skuId": "1234567890",
        "productId": "1234567",
        "main": true,
        "name": "USB charger type C",
        "description": "Beautiful and reliable super fast USB Type C charger.\nCharge your phone as never before!",
        "weight": 0.100,
        "height": 4,
        "width": 4,
        "length": 19,
        "ean": "0799439112766",
        "hscode": "850440",
        "localizedListPriceWithTaxes": 9.99,
        "localizedSalePriceWithTaxes": 8.00,
        "globalSaleChannelData": {
          "active": true,
          "brand": "ChargerW",
          "size": "2 meters",
          "color": "silver",
          "category": "Telefones e Celulares/Acessórios/Carregadores",
          "attributes": [
            {
              "name": "Connection Type",
              "value": "USB-C"
            }
          ]
        },
        "images": [
          "https://image-host/1234567/1.jpeg",
          "https://image-host/1234567/2.jpeg"
        ]
      }
    ]'
  ```
</RequestExample>

<ResponseExample>
  ```json Success theme={null}
  [
    {
      "skuId": "1234567890",
      "productId": "1234567",
      "main": true,
      "name": "USB charger type C",
      "description": "Beautiful and reliable super fast USB Type C charger.\nCharge your phone as never before!",
      "weight": 0.1,
      "height": 4,
      "width": 4,
      "length": 19,
      "ean": "0799439112766",
      "hscode": "850440",
      "globalSaleChannelData": {
        "active": true,
        "brand": "ChargerW",
        "size": "2 meters",
        "color": "silver",
        "category": "Telefones e Celulares/Acessórios/Carregadores",
        "attributes": [
          {
            "name": "Connection Type",
            "value": "USB-C"
          }
        ]
      },
      "images": [
        "https://image-host/1234567/1.jpeg",
        "https://image-host/1234567/2.jpeg"
      ],
      "salesChannelStatus": {},
      "localizationStatus": "PENDING_LOCALIZATION"
    }
  ]
  ```
</ResponseExample>

### Request Body Parameters

<ParamField body="skuId" type="string" required>
  The SKU identifier provided by the merchant. Must be unique within your catalog.
</ParamField>

<ParamField body="productId" type="string" required>
  The product identifier that groups all SKUs together. All SKUs with the same `productId` must be sent in the same
  request.
</ParamField>

<ParamField body="main" type="boolean" required>
  Indicates if this SKU is the main variation among all SKUs of the product. The main SKU is generally used by sales
  channels to display product information in product listing pages.
</ParamField>

<ParamField body="name" type="string" required>
  The title of the SKU in the original language.
</ParamField>

<ParamField body="description" type="string" required>
  The description of the SKU in the original language.

  <Warning>
    It's recommended to have the same description for all SKUs of the same product due to limitations on sales channels.
  </Warning>
</ParamField>

<ParamField body="weight" type="number" required>
  The weight of the SKU in kilograms.
</ParamField>

<ParamField body="height" type="integer" required>
  The height of the SKU in centimeters.
</ParamField>

<ParamField body="width" type="integer" required>
  The width of the SKU in centimeters.
</ParamField>

<ParamField body="length" type="integer" required>
  The length of the SKU in centimeters.
</ParamField>

<ParamField body="ean" type="string" required>
  EAN-13, UPS, ISBN, etc.
</ParamField>

<ParamField body="hscode" type="string" required>
  HS Code of the SKU, used for customs and import/export purposes. If you are in doubt about the HS Code please check it
  on [World Customs Organization Trade Tools](https://www.wcotradetools.org/en/harmonized-system).
</ParamField>

<ParamField body="localizedListPriceWithTaxes" type="number" deprecated>
  <Warning>
    This field is deprecated and will be removed in the future. Use the [Update Price (Origin)
    API](/api-reference/merchant-catalog/update-price-origin) or [Update Price (Destination)
    API](/api-reference/merchant-catalog/update-price-destination) to update the price instead.
  </Warning>

  List price of the SKU, in the merchant currency. This is the "origin list price" that will be used as the basis price for
  the localization process.
</ParamField>

<ParamField body="localizedSalePriceWithTaxes" type="number" deprecated>
  <Warning>
    This field is deprecated and will be removed in the future. Use the [Update Price (Origin)
    API](/api-reference/merchant-catalog/update-price-origin) or [Update Price (Destination)
    API](/api-reference/merchant-catalog/update-price-destination) to update the price instead.
  </Warning>

  Sale price of the SKU, in the merchant currency. This is the "origin sale price" that will be used as the basis price for
  the localization process.
</ParamField>

<ParamField body="globalSaleChannelData" type="object" required>
  Sales channel data used to map SKU data to all connected sales channels.

  <Expandable title="globalSaleChannelData properties">
    <ParamField body="active" type="boolean" required>
      Boolean indicating if the SKU is active/inactive in the sales channels.
    </ParamField>

    <ParamField body="category" type="string" required>
      Sales channel category in which the SKU should be published. This category is used as a reference for mapping with
      each sales channel's specific categories.
    </ParamField>

    <ParamField body="color" type="string">
      Color of the variation in the original language.
    </ParamField>

    <ParamField body="size" type="string">
      Size of the variation in the original language.
    </ParamField>

    <ParamField body="brand" type="string" required>
      Name of the brand of the product in the original language.
    </ParamField>

    <ParamField body="attributes" type="array">
      List of custom attributes of the product (maximum of 10 attributes). Each attribute contains:

      * `name`: name of the attribute
      * `value`: value of the attribute
    </ParamField>
  </Expandable>
</ParamField>

<ParamField body="images" type="array" required>
  Array containing URLs for the images of the SKU. Images should be publicly accessible.
</ParamField>

### Response Fields

All the fields from the request body are returned in the response, plus the following fields:

<ResponseField name="id" type="string">
  The unique identifier of the SKU within e-CROSS.
</ResponseField>

<ResponseField name="merchantId" type="string">
  The unique identifier of the merchant in e-CROSS.
</ResponseField>

<ResponseField name="localizationStatus" type="string">
  Status of the localization process. Can be one of:

  * `PENDING_LOCALIZATION`: The SKU is queued for localization processing (default status for newly created SKUs)
  * `REVIEW_DENIED`: The localization review was denied due to incomplete or incorrect data (title, description, color, size,..)
  * `DENIED_REGULATORY`: The SKU was denied due to regulatory compliance issues
  * `READY_FOR_SALES_CHANNEL`: Localization is complete and the SKU is ready to be published to sales channels
  * `LOCALIZATION_SKIPPED`: Localization was skipped (when automatic localization is disabled)

  <Warning>
    Besides the status above, if any other status is returned it should be threated as the localization process is still in progress.
  </Warning>
</ResponseField>

<ResponseField name="salesChannelStatus" type="object">
  A complex object (Record) where the key is the sales channel identifier within e-CROSS and the value contains the specific sales channel integration status.

  <Expandable title="salesChannelStatus properties">
    <ResponseField name="status" type="string">
      Status in the sales channel. Can be one of:

      * `READY_FOR_SALES_CHANNEL`: Pending integration with the sales channel
      * `SALES_CHANNEL_APPROVED`: Integration with sales channel was successful
      * `SALES_CHANNEL_DENIED`: Sales channel refused the integration
    </ResponseField>

    <ResponseField name="statusDate" type="string">
      Date when the status was set for the SKU.
    </ResponseField>

    <ResponseField name="statusMessage" type="string">
      Additional message related to the status.
    </ResponseField>
  </Expandable>
</ResponseField>
