Retrieve SKU code by details
Overview
Use the getSKUCodeByDetails method to retrieve an SKU based on its included details.
Parameters
Parameters | Type/Description | |
---|---|---|
sessionID |
Required (string) |
|
|
Session identifier, the output of the Login method. Include sessionID into all your requests. 2Checkout throws an exception if the values are incorrect. The sessionID expires in 10 minutes. |
|
skuDetailsObject |
Object |
|
|
Details below |
|
|
PricingConfigurationCode |
Required (string) |
|
|
Unique identifier of the pricing configuration. |
|
Currency |
Optional (string) |
|
|
ISO currency code. |
|
PurchaseType |
Optional (string) |
|
|
Purchase type identifier. Possible values:
|
|
PriceOptions |
Optional (stringArray) |
|
|
Array of price options names. |
|
Quantity |
Optional (int) |
|
|
Numeric identifier of product quantity. |
Request Example
<?php require ('PATH_TO_AUTH'); $skuDetailsObject = new \stdClass(); $skuDetailsObject->PricingConfigurationCode = 'YOUR_CODE'; $skuDetailsObject->Currency = 'USD'; $skuDetailsObject->PurchaseType = 'NEW_PRODUCT'; $skuDetailsObject->PriceOptions = ['A']; $skuDetailsObject->Quantity = 1; $jsonRpcRequest = new stdClass(); $jsonRpcRequest->jsonrpc = '2.0'; $jsonRpcRequest->method = 'getSKUCodeByDetails'; $jsonRpcRequest->params = array($sessionID, $skuDetailsObject); $jsonRpcRequest->id = $i++; $getSkuCodeByDetails = callRPC($jsonRpcRequest, $host); var_dump($getSkuCodeByDetails);
Response Example
{SKUCode} // eg: SKU-EUR-1-10-N-A