Retrieve SKU code by details
Last updated: 18-Nov-2019
Rate this article:
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;
try {
$getSkuDetails = $client->getSkuDetails($sessionID, $skuDetailsObject);
} catch (SoapFault $e) {
echo $e->getMessage();
}
var_dump($getSkuDetails);
Response Example
{SKUCode} // eg: SKU-EUR-1-10-N-A
Rate this article: