Retrieve SKU code by details
Last updated: 29-Sep-2021
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. Avangate 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. |
Response
{SKUCode} // eg: SKU-EUR-1-10-N-A
Request
<?php
require ('PATH_TO_AUTH');
$skuDetailsObject = [];
$skuDetailsObject['PricingConfigurationCode'] = 'YOUR_CODE';
$skuDetailsObject['Currency'] = 'USD';
$skuDetailsObject['PurchaseType'] = 'NEW_PRODUCT';
$skuDetailsObject['PriceOptions'] = ['B'];
$skuDetailsObject['Quantity'] = 1;
try {
$getProductByCode = $client->getSKUCodeByDetails($sessionID, $skuDetailsObject);
} catch (SoapFault $e) {
echo $e->getMessage();
}
var_dump($getProductByCode);
Rate this article: