Some content on this site may not be available right now. We are aware and actively monitoring the situation.
For the complete documentation index, see llms.txt. This page is also available as Markdown.

Product SKU

Generate SKU schema

get

Stock keeping unit or SKU is a number assigned to a particular product by a digital or physical retail store for easy identification and inventory tracking purposes. The SKU number is a string of alphanumeric characters that uniquely identify details such as price, product options and manufacturer of a particular product or service. SKUs are used in order notifications, electronic delivery, export files, etc

Query parameters
schemastringRequired

To create a new SKU schema, define the combination criteria from the Settings section below. The SKU number is a unique combination of Product ID (Product Code) plus all or one of the following: Currencies/Volume Discounts/Purchase Types/Pricing Options

Example: { "Products": [ { "Code": "VALID_PRODUCT_CODE_1", "Currencies": [ "USD", "EUR", "GBP", "BGN" ], "PurchaseTypes": [ "NEW_PRODUCT", "RENEWAL" ], "PricingConfigurationCodes": [ { "Code": "VALID_PRICING_CONFIGURATION_CODE_1", "VolumeDiscounts": [ [ 1, 3 ], [ 4, 10 ] ], "OptionGroups": [ { "Code": "GROUP_CODE_2" } ] } ] }, { "Code": "VALID_PRODUCT_CODE_2", "Currencies": [ "USD", "EUR" ], "PurchaseTypes": [ "NEW_PRODUCT" ], "PricingConfigurationCodes": [ { "Code": "VALID_PRICING_CONFIGURATION_CODE_2", "OptionGroups": [ { "Code": "GROUP_CODE_1" } ] } ] } ] }
Header parameters
Acceptstring · enumRequiredDefault: application/jsonExample: application/jsonPossible values:
X-Avangate-AuthenticationstringRequiredExample: code="{VENDOR_CODE}" date="{REQUEST_DATE_TIME}" hash="{HASH}"
Responses
200

Returns generated SKU schema

application/json
ProductCodestringOptional
get/productsku/
GET /rest/6.0/productsku/?schema=text HTTP/1.1
Host: api.2checkout.com
Accept: application/json
X-Avangate-Authentication: code="{VENDOR_CODE}" date="{REQUEST_DATE_TIME}" hash="{HASH}"
{
  "ProductCode": "text",
  "SkuPricingOptions": {
    "0": {
      "Code": "PRODUCT_CODE_1",
      "Details": {
        "0": {
          "ProductSKU": "",
          "Currency": "USD",
          "FromQty": 1,
          "ToQty": 5,
          "PurchaseType": "NEW_PRODUCT",
          "Groups": {
            "0": {
              "GroupCode": "OPTION_GROUP_CODE_1",
              "Options": {
                "0": {
                  "Name": "Option label #1",
                  "Value": "OPTION_CODE_1"
                }
              }
            }
          },
          "Options": "eJwBLADT/6G10uOW07exk6mNk7K/oN2Sc4l1lbXToqi5sriTcbOXseWu3pGFp3auuZOoleEc+Q=="
        },
        "1": {
          "ProductSKU": "",
          "Currency": "USD",
          "FromQty": 1,
          "ToQty": 5,
          "PurchaseType": "NEW_PRODUCT",
          "Groups": {
            "0": {
              "GroupCode": "OPTION_GROUP_CODE_1",
              "Options": {
                "0": {
                  "Name": "Option label #1",
                  "Value": "OPTION_CODE_1"
                }
              }
            }
          },
          "Options": "eJwBLADT/6G10uOW07exk6mNk7K/oN2Sc4l1lbXToqi5sriTcbOXseWu3pGFp3auuZOoleEc+Q=="
        }
      },
      "Errors": [
        ""
      ]
    },
    "1": {
      "ProductCode": "VALIDATION_ERRORS_PRODUCT_CODE",
      "SkuPricingOptions": {
        "Code": "",
        "Details": {},
        "Errors": [
          [
            "Product code INVALID_PRODUCT_CODE doesn't belong to this vendor",
            "Pricing Configuration Code INVALID_PRICING_CONFIGURATION_CODE is not valid for product code VALID_PRODUCT_CODE",
            "Pricing Configuration Code VALID_PRICING_CONFIGURATION_CODE is duplicated for product code VALID_PRODUCT_CODE",
            "Couldn't find any valid pricing options for groupCode INVALID_GROUP_CODE and pricing option code PRICING_CONFIGURATION_CODE",
            "We couldn't validate the following purchase types for product code : INVALID_PURCHASE_TYPE",
            "We couldn't validate the following currencies: USD_INVALID",
            "We could't validate all the requested volumes: [[1,3],[4,10]]. Please make sure that they are properly set for this pricing configuration code.",
            "There are too many possible combinations available for these input items.",
            "Product id 12312344 doesn't have any PricingConfigurationCodes"
          ]
        ]
      }
    }
  }
}
get
Query parameters
ProductCodestringRequiredExample: 6B3CB17DDA_COPY1
Header parameters
Acceptstring · enumRequiredDefault: application/jsonExample: application/jsonPossible values:
X-Avangate-AuthenticationstringRequiredExample: code="{VENDOR_CODE}" date="{REQUEST_DATE_TIME}" hash="{HASH}"
Responses
200

Returns generated SKU schema

application/json
ProductCodestringOptionalExample: O365BASIC
get/productsku/search
GET /rest/6.0/productsku/search?ProductCode=text&PricingConfigurations=[object+Object] HTTP/1.1
Host: api.2checkout.com
Accept: application/json
X-Avangate-Authentication: code="{VENDOR_CODE}" date="{REQUEST_DATE_TIME}" hash="{HASH}"
200

Returns generated SKU schema

{
  "ProductCode": "O365BASIC",
  "PricingConfigurations": {
    "Code": "5667F988EC",
    "Currencies": [
      {
        "Code": "EUR"
      }
    ],
    "PurchaseTypes": [
      {
        "Code": "NEW_PRODUCT"
      }
    ],
    "QuantityIntervals": [
      {
        "MinQuantity": 0,
        "MaxQuantity": 9999
      }
    ],
    "PriceOptionGroups": [
      {
        "Code": "WDS998U",
        "Options": [
          {
            "OptionValue": "Black color"
          }
        ]
      }
    ],
    "SkuCollection": [
      {
        "ProductCode": "PODQ92E",
        "SkuPricingOptions": [
          {
            "Code": "POC29I",
            "Details": [
              {
                "ProductSKU": " SKU-USD-0-20-R-C",
                "Currency": "USD",
                "FromQty": 0,
                "ToQty": 20,
                "PurchaseType": "NEW_PRODUCT",
                "Groups": {
                  "GroupCode": "SMGRP",
                  "Options": [
                    {
                      "Name": "DetailOption",
                      "Value": "OptionValue"
                    }
                  ]
                },
                "Options": "a:1:{i:13471;a:1:{i:0;i:72680;}"
              }
            ]
          }
        ]
      }
    ]
  },
  "Errors": [
    {
      "Field": "PricingConfigurations[0].Code",
      "Message": "This value should not be blank."
    }
  ]
}

Delete product SKU

post

Delete product SKU by criteria

Header parameters
X-Avangate-AuthenticationstringRequired

Authentication header

Example: code="{VENDOR_CODE}" date="{REQUEST_DATE_TIME}" hash="{HASH}"
Acceptstring · enumRequiredExample: application/jsonPossible values:
Bodyobject · DeleteSkuProduct[]
ProductCodestringOptionalExample: ABAC3939F
SKUsstring[]OptionalExample: ["AA11","AA12","AA13"]
Responses
200

In case of success

application/json
ProductCodestringOptionalExample: B293KS234
SKUsstring[]OptionalExample: ["AA11","AA12","AA13!"]
Errorsstring[]OptionalExample: ["Can't parse both SKU and PriceConfiguration at same time","Invalid SKU AA13!"]
post/productsku/delete
POST /rest/6.0/productsku/delete HTTP/1.1
Host: api.2checkout.com
X-Avangate-Authentication: code="{VENDOR_CODE}" date="{REQUEST_DATE_TIME}" hash="{HASH}"
Accept: application/json
Content-Type: application/json
Content-Length: 151

[
  {
    "ProductCode": "ABAC3939F",
    "PriceConfiguration": [
      {
        "PriceConfigurationCode": "B293KS234",
        "SKUs": [
          "AA11",
          "AA12",
          "AA13"
        ]
      }
    ],
    "SKUs": [
      "AA11",
      "AA12",
      "AA13"
    ]
  }
]
[
  {
    "ProductCode": "B293KS234",
    "PriceConfiguration": [
      {
        "PriceConfigurationCode": "B293KS234",
        "SKUs": [
          "AA11",
          "AA12",
          "AA13"
        ],
        "Errors": [
          "Invalid PriceConfigurationCode",
          "Invalid SKU AA13!"
        ]
      }
    ],
    "SKUs": [
      "AA11",
      "AA12",
      "AA13!"
    ],
    "Errors": [
      "Can't parse both SKU and PriceConfiguration at same time",
      "Invalid SKU AA13!"
    ]
  }
]

Last updated

Was this helpful?