Update pricing configuration
Last updated: 15-Jan-2021
Rate this article:
Overview
Use the updatePricingConfiguration method to update/edit an existing pricing configuration.
Requirements
You cannot modify:
- The pricing configuration CODE.
- The PricingSchema from DYNAMIC to FLAT or vice versa.
- The intervals of an existing pricing configuration (MinQuantity and MaxQuantity).
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 an existing pricing configuration for your account. |
ProductCode |
Required (string) |
|
The unique product code that you control not the system-generated product identifier. |
Response
bool(true)
Request
<?php
require ('PATH_TO_AUTH');
$productCode = 'YOUR_PRODUCT_CODE';
try {
$ProductPricingConfigurations = $client->getPricingConfigurations($sessionID, $productCode);
var_dump("InitialPricingConfiguration", $ProductPricingConfigurations);
}
catch (SoapFault $e) {
echo "Pricing Configurations: " . $e->getMessage();
exit;
}
$ProductPricingConfigurations[1]->Prices->Renewal[0]->Currency = 'USD';
$ProductPricingConfigurations[1]->Prices->Renewal[0]->Amount = 99;
$newPriceConfig = $ProductPricingConfigurations[1];
try {
$UpdatedPricingConfiguration = $client->updatePricingConfiguration($sessionID, $newPriceConfig, $ProductCode);
}
catch (SoapFault $e) {
echo "UpdatedPricingConfiguration: " . $e->getMessage();
exit;
}
var_dump("UpdatedPricingConfiguration", $UpdatedPricingConfiguration);
?>
Rate this article: