Generate SKU schema

Use the getSchema method to create a new SKU schema and define the combination criteria. The SKU number is a unique combination of Product ID (Product Code) plus all or minimum one of the following:

  • Currencies

  • Volume Discounts

  • Purchase Types

  • Pricing Options

Request parameters

Parameters
Type / Description

productCode

Required (string)

Product code as available in the Merchant Control Panel.

currencies

Required (string)

purchaseTypes

Required (string)

The type of purchase applicable to the product: NEW_PRODUCT, RENEWAL, TRIAL, UPGRADE.

pricingConfigurationCodes

Required

pricingConfigurationCodes.code

Required

pricingConfigurationCodes.volumeDiscounts

Required

pricingConfigurationCodes.optionGroups

Required

Request sample

<?php

require ('PATH_TO_AUTH');

$inputSchema = new \stdClass();
$inputSchema->Products = [];
$inputSchema->Products[0] = new \stdClass();
$inputSchema->Products[0]->Code = '6B3CB17DDA_COPY1';
$inputSchema->Products[0]->Currencies = ['USD', 'EUR', 'GBP', 'BGN'];
$inputSchema->Products[0]->PurchaseTypes = ['NEW_PRODUCT', 'RENEWAL'];
$inputSchema->Products[0]->PricingConfigurationCodes = [];
$inputSchema->Products[0]->PricingConfigurationCodes[0] = new \stdClass();
$inputSchema->Products[0]->PricingConfigurationCodes[0]->Code = 'E684EC99B0';
$inputSchema->Products[0]->PricingConfigurationCodes[0]->VolumeDiscounts = [[1, 3], [4, 7]];
$inputSchema->Products[0]->PricingConfigurationCodes[0]->OptionGroups = [];
$inputSchema->Products[0]->PricingConfigurationCodes[0]->OptionGroups[0] = new \stdClass();
$inputSchema->Products[0]->PricingConfigurationCodes[0]->OptionGroups[0]->Code = 'GRUP_1';

$jsonRpcRequest = array (
    'method' => 'getSchema',
    'params' => array($sessionID, $inputSchema),
    'id' => $i++,
    'jsonrpc' => '2.0'
);

var_dump (callRPC((Object)$jsonRpcRequest, $host, true));

Response parameters

Parameters
Description

productCode

Product code as available in the Merchant Control Panel.

pricingConfigurationCode

productSku

Empty when the list is generated by the platform and with unique values (per vendor) for each line of the file.

currency

If currency is not selected to be included in the list (empty or null value) the the API defaults to "ANY". If currency is selected as an element of the SKU list creation, then it will be included - minimum one currency.

fromQty

The minimum value of the intervals set at product level for the specific Pricing configuration (volume discounts). In case volume discounts are not defined, the default value will be '1'.

toQty

The maximum value of the intervals set at product level for the specific Pricing configuration (volume discounts). In case volume discounts are not defined, the default value will be '99999'.

The intervals will be defined in the SKU list (at creation and upload) considering the product settings. In case intervals that are not defined in the Control Panel are included in the request, the request will return an error.

'Expand quantities' should consider distinct SKUs for each qty of the interval. (optional)

purchaseType

Purchase types will have one or multiple of the following values: NEW_PRODUCT, RENEWAL, TRIAL, UPGRADE - limited to what is defined at product level.

pricingOptionGroups

Can be multiple and each of them will have the GroupCode and for each pricing options group:

pricingOptions

Can be multiple and will contain Name and Value as output, the only valid input is the option group code.

Response sample

Last updated

Was this helpful?