Update price options
Last updated: 25-Sep-2019
Rate this article:
Overview
Use the updatePriceOptionGroup method to update/edit an existing price options group you configured for your account. Price options intervals cannot overlap.
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. |
Required (object) |
|
|
Use this object to update/edit a new price option group for your account. |
You cannot update the Code and Required parameters of the price options group.
Response
bool(true)
Request
<?php
require ('PATH_TO_AUTH');
$SearchOptions = new stdClass ();
$SearchOptions->Name = 'New Users from API';
$SearchOptions->Types = array('INTERVAL', 'RADIO'); //RADIO, CHECKBOX, INTERVAL, COMBO
$SearchOptions->Pagination = new stdClass ();
$SearchOptions->Pagination->Limit = 10;
$SearchOptions->Pagination->Page = 1;
try {
$existentPriceOptions = $client->searchPriceOptionGroups($sessionID, $SearchOptions);
}
catch (SoapFault $e) {
echo "existentPriceOptions: " . $e->getMessage();
exit;
}
var_dump ($existentPriceOptions);
$updatedPriceOptions = $existentPriceOptions->Items[0]; //assigning pricing option into a new variable
$updatedPriceOptions->Translations[0]->Name = 'New Users from API3';
$updatedPriceOptions->Translations[0]->Language = 'EN';
echo ($updatedPriceOptions->Name);
try {
$NewPriceOptionGroup = $client->updatePriceOptionGroup($sessionID, $updatedPriceOptions);
}
catch (SoapFault $e) {
echo "NewPriceOptionGroup: " . $e->getMessage();
exit;
}
var_dump("NewPriceOptionGroup", $NewPriceOptionGroup);
?>
Rate this article: