# Update special price promotion

Use the **UpdateSpecialPricePromotion** method to modify promotion at a special price.

## Request parameters

<table><thead><tr><th width="176.6666259765625">Parameter</th><th>Type / Description</th></tr></thead><tbody><tr><td><code>promotionCode</code></td><td><strong>Required (string)</strong><br>Code of the promotion that you want to update.</td></tr><tr><td><code>sessionID</code></td><td><strong>Required (string)</strong><br>Unique identifier of the session.</td></tr><tr><td><code>existingPromotion</code></td><td><strong>Required (string)</strong><br>Details of the existing promotion.</td></tr><tr><td><code>PriceMatrix</code></td><td><strong>Required (array of objects)</strong><br>Only for this type of promotion. It is generated by the <code>getPriceMatrix</code> call and used to set promotion special prices.</td></tr></tbody></table>

### Request sample

```php
<?php
require ('PATH_TO_AUTH');

// Retrieve promotion details

$promotionCode = 'PROMOTION_CODE'; // code of the promotion that you want to update

try {
    $Promotion = $client->getPromotion($sessionID, $promotionCode);
}
catch (SoapFault $e) {
    echo "Promotion: " . $e->getMessage();
    exit;
}

var_dump("Promotion", $Promotion);

// Keep the promotion you want to update in $existingPromotion
try{
    $existingPromotion = $client->getPromotion($sessionID, $promotionCode);
}

catch (SoapFault $e) {
    echo "Existing Promotion: " . $e->getMessage();
    exit;
}

// Set the fields to update

$priceMatrixDefinition1 = new stdClass;
$priceMatrixDefinition1->ProductCode = "test";
$priceMatrixDefinition1->PricingConfigurationCode = "738C6A2049";
$priceMatrixDefinition1->OptionHash = "708e43960c4edc42f14cf388bcb24bde";

$option1 = new stdClass;
$option1->GroupName = "Units";
$option1->OptionText = "1 - maximum";

$price1 = new stdClass;
$price1->Value = 20;
$price1->Currency = "USD";
$price2 = new stdClass;
$price2->Value = 15;
$price2->Currency = "EUR";

$priceMatrixDefinition1->Options = [$option1];
$priceMatrixDefinition1->Prices = [$price1, $price2];

$existingPromotion->DefaultCurrency = 'USD';
$existingPromotion->PriceMatrix = [\
    $priceMatrixDefinition1\
];
// Update the promotion
try {
    $updatedPromotion = $client->updatePromotion($sessionID, $existingPromotion);
}

catch (SoapFault $e) {
    echo "UpdatedPromotion: " . $e->getMessage();
    exit;
}

var_dump("UpdatedPromotion", $updatedPromotion);

?>
```

### Response sample

```json
{
   "@encodingStyle": "http://schemas.xmlsoap.org/soap/encoding/",
   "Body": {
      "addPromotionResponse": {
         "addPromotionReturn": {
            "@type": "ns2:Promotion",
            "Code": {
               "@type": "xsd:string",
               "#text": "6GR7JU369E"
            },
            "Name": {
               "@type": "xsd:string",
               "#text": "Promo percentage REST"
            },
            "Description": {
               "@type": "xsd:string",
               "#text": "Promo description1"
            },
            "StartDate": {
               "@type": "xsd:string",
               "#text": "2019-11-30"
            },
            "EndDate": {
               "@type": "xsd:string",
               "#text": "2100-12-31"
            },
            "MaximumOrdersNumber": {
               "@type": "xsd:int",
               "#text": "-1"
            },
            "MaximumQuantity": {
               "@type": "xsd:int",
               "#text": "1"
            },
            "InstantDiscount": {
               "@type": "xsd:boolean",
               "#text": "false"
            },
            "Coupon": {
               "@type": "ns2:PromotionCouponSingleOrMultiple",
               "Type": {
                  "@type": "xsd:string",
                  "#text": "MULTIPLE"
               },
               "Codes": {
                  "@arrayType": "xsd:string[2]",
                  "@type": "ns2:StringArray",
                  "item": [\
                     {\
                        "@type": "xsd:string",\
                        "#text": "code1"\
                     },\
                     {\
                        "@type": "xsd:string",\
                        "#text": "code2"\
                     }\
                  ]
               }
            },
            "Enabled": {
               "@type": "xsd:boolean",
               "#text": "true"
            },
            "ChannelType": {
               "@nil": "true"
            },
            "Type": {
               "@type": "xsd:string",
               "#text": "SPECIAL_PRICE"
            },
            "Discount": {
               "@nil": "true"
            },
            "Products": {
               "@arrayType": "ns2:PromotionProduct[1]",
               "@type": "ns2:PromotionProductsArray",
               "item": {
                  "@type": "ns2:PromotionProduct",
                  "Code": {
                     "@type": "xsd:string",
                     "#text": "test"
                  },
                  "PricingOptionCodes": {
                     "@nil": "true"
                  },
                  "PricingConfigurationCode": {
                     "@nil": "true"
                  }
               }
            },
            "PriceThreshold": {
               "@nil": "true"
            },
            "Translations": {
               "@arrayType": "ns2:PromotionTranslation[1]",
               "@type": "ns2:PromotionTranslationsArray",
               "item": {
                  "@type": "ns2:PromotionTranslation",
                  "Name": {
                     "@type": "xsd:string",
                     "#text": "Promo percentage REST"
                  },
                  "Language": {
                     "@type": "xsd:string",
                     "#text": "EN"
                  }
               }
            },
            "Sources": {
               "@arrayType": "xsd:string[0]",
               "@type": "ns2:SourcesArray"
            },
            "PublishToAffiliatesNetwork": {
               "@nil": "true"
            },
            "ApplyRecurring": {
               "@type": "xsd:string",
               "#text": "NONE"
            },
            "RecurringChargesNumber": {
               "@type": "xsd:int",
               "#text": "0"
            },
            "DefaultCurrency": {
               "@type": "xsd:string",
               "#text": "EUR"
            },
            "PriceMatrix": {
               "@arrayType": "ns2:PromotionPriceMatrix[1]",
               "@type": "ns2:PromotionPriceMatrixArray",
               "item": {
                  "@type": "ns2:PromotionPriceMatrix",
                  "ProductCode": {
                     "@type": "xsd:string",
                     "#text": "test"
                  },
                  "PricingConfigurationCode": {
                     "@type": "xsd:string",
                     "#text": "738C6A2049"
                  },
                  "OptionHash": {
                     "@type": "xsd:string",
                     "#text": "708e43960c4edc42f14cf388bcb24bde"
                  },
                  "Options": {
                     "@arrayType": "ns2:PromotionPriceMatrixOptions[1]",
                     "@type": "ns2:PromotionPriceMatrixOptionsArray",
                     "item": {
                        "@type": "ns2:PromotionPriceMatrixOptions",
                        "GroupName": {
                           "@type": "xsd:string",
                           "#text": "Units"
                        },
                        "OptionText": {
                           "@type": "xsd:string",
                           "#text": "1 - maximum"
                        }
                     }
                  },
                  "Prices": {
                     "@arrayType": "ns2:PromotionPriceMatrixPrices[12]",
                     "@type": "ns2:PromotionPriceMatrixPricesArray",
                     "item": [\
                        {\
                           "@type": "ns2:PromotionPriceMatrixPrices",\
                           "Value": {\
                              "@type": "xsd:double",\
                              "#text": "31.156"\
                           },\
                           "Currency": {\
                              "@type": "xsd:string",\
                              "#text": "CAD"\
                           }\
                        },\
                        {\
                           "@type": "ns2:PromotionPriceMatrixPrices",\
                           "Value": {\
                              "@type": "xsd:double",\
                              "#text": "20"\
                           },\
                           "Currency": {\
                              "@type": "xsd:string",\
                              "#text": "EUR"\
                           }\
                        },\
                        {\
                           "@type": "ns2:PromotionPriceMatrixPrices",\
                           "Value": {\
                              "@type": "xsd:double",\
                              "#text": "40"\
                           },\
                           "Currency": {\
                              "@type": "xsd:string",\
                              "#text": "USD"\
                           }\
                        },\
                        {\
                           "@type": "ns2:PromotionPriceMatrixPrices",\
                           "Value": {\
                              "@type": "xsd:double",\
                              "#text": "1587.5251590698"\
                           },\
                           "Currency": {\
                              "@type": "xsd:string",\
                              "#text": "ARS"\
                           }\
                        },\
                        {\
                           "@type": "ns2:PromotionPriceMatrixPrices",\
                           "Value": {\
                              "@type": "xsd:double",\
                              "#text": "18541.12858627"\
                           },\
                           "Currency": {\
                              "@type": "xsd:string",\
                              "#text": "CLP"\
                           }\
                        },\
                        {\
                           "@type": "ns2:PromotionPriceMatrixPrices",\
                           "Value": {\
                              "@type": "xsd:double",\
                              "#text": "18.1324"\
                           },\
                           "Currency": {\
                              "@type": "xsd:string",\
                              "#text": "GBP"\
                           }\
                        },\
                        {\
                           "@type": "ns2:PromotionPriceMatrixPrices",\
                           "Value": {\
                              "@type": "xsd:double",\
                              "#text": "2447.2"\
                           },\
                           "Currency": {\
                              "@type": "xsd:string",\
                              "#text": "JPY"\
                           }\
                        },\
                        {\
                           "@type": "ns2:PromotionPriceMatrixPrices",\
                           "Value": {\
                              "@type": "xsd:double",\
                              "#text": "499.518"\
                           },\
                           "Currency": {\
                              "@type": "xsd:string",\
                              "#text": "MXN"\
                           }\
                        },\
                        {\
                           "@type": "ns2:PromotionPriceMatrixPrices",\
                           "Value": {\
                              "@type": "xsd:double",\
                              "#text": "97.536"\
                           },\
                           "Currency": {\
                              "@type": "xsd:string",\
                              "#text": "RON"\
                           }\
                        },\
                        {\
                           "@type": "ns2:PromotionPriceMatrixPrices",\
                           "Value": {\
                              "@type": "xsd:double",\
                              "#text": "1846.05"\
                           },\
                           "Currency": {\
                              "@type": "xsd:string",\
                              "#text": "RUB"\
                           }\
                        },\
                        {\
                           "@type": "ns2:PromotionPriceMatrixPrices",\
                           "Value": {\
                              "@type": "xsd:double",\
                              "#text": "601.82854437393"\
                           },\
                           "Currency": {\
                              "@type": "xsd:string",\
                              "#text": "UAH"\
                           }\
                        },\
                        {\
                           "@type": "ns2:PromotionPriceMatrixPrices",\
                           "Value": {\
                              "@type": "xsd:double",\
                              "#text": "384.374"\
                           },\
                           "Currency": {\
                              "@type": "xsd:string",\
                              "#text": "ZAR"\
                           }\
                        }\
                     ]
                  }
               }
            }
         }
      }
   }
}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.2checkout.com/soap-api-reference/soap-api-6.0/api-requests/promotions/update-special-price-promotion.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
