# Subscription change deal

Use the **changeDeal** method to change the existing deal for a given subscription and operate the amendment order necessary to transition to the proposed deal immediately. The amendment order will use the due now prices returned by the [getDealInfo](/json-rpc-api-reference/json-rpc-api-6.0/api-requests/subscription/retrieve-subscription-deal-information.md) method when called with the same relevant request parameters.

## Request parameters

<table><thead><tr><th width="428.4000244140625">Parameter</th><th width="317.4666748046875">Type / Description</th></tr></thead><tbody><tr><td><code>Currency</code></td><td><p><strong>Required (string)</strong></p><p>The currency.</p></td></tr><tr><td><code>Country</code></td><td><strong>Required (string)</strong><br>The country.</td></tr><tr><td><code>Language</code></td><td><strong>Required (string)</strong><br>The language.</td></tr><tr><td><code>CustomerIp</code></td><td><strong>Optional (string)</strong><br>The customer's IP address.</td></tr><tr><td><code>Items</code></td><td><strong>Required (array)</strong><br>Each item corresponds to a subscription.</td></tr><tr><td><code>Items.DealDate</code></td><td><strong>Required (string)</strong><br>The date when the deal is set to come into effect.</td></tr><tr><td><code>Items.SubscriptionReference</code></td><td><strong>Required (string)</strong><br>The subscription code.</td></tr><tr><td><code>Items.ProductCode</code></td><td><strong>Required (string)</strong><br>The product code.</td></tr><tr><td><code>Items.Quantity</code></td><td><strong>Required (string)</strong><br>The product quantity.</td></tr><tr><td><code>Items.DealPriceScenario</code></td><td><strong>Required (string)</strong><br>The upgrade scenario to be applied. Must be one of: using_last_order_price, using_last_product_price, price_total, product_price_difference.</td></tr><tr><td><code>Items.DealSubscriptionScenario</code></td><td><strong>Required (string)</strong><br>The scenario for price calculation. Must be one of prolong, does_not_affect, disable_existing.</td></tr><tr><td><code>Items.PriceOptions</code></td><td><strong>Optional (array)</strong><br>The array of price options.</td></tr><tr><td><code>Items.PriceOptions.Code</code></td><td><strong>Required (string)</strong><br>The price options group code.</td></tr><tr><td><code>Items.PriceOptions.Options</code></td><td><strong>Required (array)</strong><br>The list of price option value (if the group is of type interval) or the price option code (otherwise).</td></tr><tr><td><code>Items.Price</code></td><td><strong>Required (object)</strong><br>The product price.</td></tr><tr><td><code>Items.Price.Amount</code></td><td><strong>Required (float)</strong><br>The actual numeric amount.</td></tr><tr><td><code>Items.Price.Type</code></td><td><strong>Required (string)</strong><br>Describes if the price type is catalog or custom. Can be only CUSTOM.</td></tr><tr><td><code>Items.Price.AmountType</code></td><td><strong>Required (string)</strong><br>Describes if the price is NET or GROSS. Can be on of NET, GROSS.</td></tr><tr><td><code>Items.SubscriptionCustomSettings</code></td><td><strong>Required (object)</strong><br>Product license custom settings.</td></tr><tr><td><code>Items.SubscriptionCustomSettings.CycleLength</code></td><td><strong>Required (int)</strong><br>The length of a single billing cycle.</td></tr><tr><td><code>Items.SubscriptionCustomSettings.CycleUnit</code></td><td><strong>Required (string)</strong><br>The unit of a single billing cycle. Can be one of MONTH, DAY.</td></tr><tr><td><code>Items.SubscriptionCustomSettings.CycleAmount</code></td><td><strong>Required (float)</strong><br>The price of a single billing cycle.</td></tr><tr><td><code>Items.SubscriptionCustomSettings.CycleAmountType</code></td><td><strong>Required (string)</strong><br>Describes the price type. Can be one of NET, GROSS.</td></tr><tr><td><code>Items.SubscriptionCustomSettings.ContractLength</code></td><td><strong>Required (int)</strong><br>The number of billing cycles contained in a single contract.</td></tr><tr><td><code>Items.SubscriptionCustomSettings.ClientDealAutoRenewal</code></td><td><strong>Optional (boolean)</strong><br>CDAR value (default false).</td></tr><tr><td><code>Items.SubscriptionCustomSettings.MerchantDealAutoRenewal</code></td><td><strong>Optional (boolean)</strong><br>MDAR value (default false).</td></tr><tr><td><code>BillingDetails</code></td><td><strong>Required (object)</strong><br>The billing details.</td></tr><tr><td><code>BillingDetails.FirstName</code></td><td><strong>Required (string)</strong><br>The first name.</td></tr><tr><td><code>BillingDetails.LastName</code></td><td><strong>Required (string)</strong><br>The last name.</td></tr><tr><td><code>BillingDetails.CountryCode</code></td><td><strong>Required (string)</strong><br>The country code. Must be one of the seller's associated country codes.</td></tr><tr><td><code>BillingDetails.State</code></td><td><strong>Optional (string)</strong><br>Required only if the business model requires it.</td></tr><tr><td><code>BillingDetails.City</code></td><td><strong>Required (string)</strong><br>The city name.</td></tr><tr><td><code>BillingDetails.Address1</code></td><td><strong>Required (string)</strong><br>The address.</td></tr><tr><td><code>BillingDetails.Zip</code></td><td><strong>Required (string)</strong><br>The zip code.</td></tr><tr><td><code>BillingDetails.Email</code></td><td><strong>Required (string)</strong><br>The email address.</td></tr><tr><td><code>BillingDetails.Phone</code></td><td><strong>Required (string)</strong><br>The phone number.</td></tr><tr><td><code>BillingDetails.Company</code></td><td><strong>Required (string)</strong><br>The company's legal name.</td></tr><tr><td><code>BillingDetails.FiscalCode</code></td><td><strong>Required (string)</strong><br>The fiscal code.</td></tr><tr><td><code>DeliveryDetails</code></td><td><strong>Required (object)</strong><br>The delivery details.</td></tr><tr><td><code>DeliveryDetails.FirstName</code></td><td><strong>Required (string)</strong><br>The first name.</td></tr><tr><td><code>DeliveryDetails.LastName</code></td><td><strong>Required (string)</strong><br>The last name.</td></tr><tr><td><code>DeliveryDetails.CountryCode</code></td><td><strong>Required (string)</strong><br>The country code. Must be one of the seller's associated country codes.</td></tr><tr><td><code>DeliveryDetails.State</code></td><td><strong>Optional (string)</strong><br>Required only if the business model requires it.</td></tr><tr><td><code>DeliveryDetails.City</code></td><td><strong>Required (string)</strong><br>The city name.</td></tr><tr><td><code>DeliveryDetails.Address1</code></td><td><strong>Required (string)</strong><br>The address.</td></tr><tr><td><code>DeliveryDetails.Zip</code></td><td><strong>Required (string)</strong><br>The zip code.</td></tr><tr><td><code>DeliveryDetails.Email</code></td><td><strong>Required (string)</strong><br>The email address.</td></tr><tr><td><code>DeliveryDetails.Phone</code></td><td><strong>Required (string)</strong><br>The phone number.</td></tr><tr><td><code>DeliveryDetails.Company</code></td><td><strong>Required (string)</strong><br>The company's legal name.</td></tr><tr><td><code>PaymentDetails</code></td><td><strong>Optional (object)</strong><br>The payment details.</td></tr><tr><td><code>PaymentDetails.Type</code></td><td><strong>Required (string)</strong><br>Payment type. Can be CC (credit card) or EES_TOKEN_PAYMENT (2payJs token).</td></tr><tr><td><code>PaymentDetails.Currency</code></td><td><strong>Required (string)</strong><br>Payment currency code.</td></tr><tr><td><code>PaymentDetails. CustomerIP</code></td><td><strong>Required (string)</strong><br>Payment customer IP.</td></tr><tr><td><code>PaymentDetails.PaymentMethod</code></td><td><strong>Required (object)</strong><br>The payment method information.</td></tr><tr><td><code>PaymentDetails.PaymentMethod.EesToken</code></td><td><strong>Optional (string)</strong><br>EES token (required when payment type is EES_TOKEN_PAYMENT).</td></tr><tr><td><code>PaymentDetails.PaymentMethod.CardNumber</code></td><td><p><strong>Optional (int)</strong></p><p>CC number (required when payment type is CC).</p></td></tr><tr><td><code>PaymentDetails.PaymentMethod.CardType</code></td><td><strong>Optional (string)</strong><br>CC type (ex: VISA, MC; required when payment type is CC).</td></tr><tr><td><code>PaymentDetails.PaymentMethod.ExpirationYear</code></td><td><strong>Optional (int)</strong><br>4 digits CC expiration year (required when payment type is CC).</td></tr><tr><td><code>PaymentDetails.PaymentMethod.ExpirationMonth</code></td><td><strong>Optional (int)</strong><br>CC expiration month (required when payment type is CC).</td></tr><tr><td><code>PaymentDetails.PaymentMethod.CCID</code></td><td><strong>Optional (string)</strong><br>CC CVV value (required when payment type is CC).</td></tr><tr><td><code>PaymentDetails.PaymentMethod.HolderName</code></td><td><strong>Optional (string)</strong><br>CC holder name.</td></tr><tr><td><code>PaymentDetails.PaymentMethod.Vendor3DSReturnURL</code></td><td><strong>Required (string)</strong><br>Merchant 3DS return URL.</td></tr><tr><td><code>PaymentDetails.PaymentMethod.Vendor3DSCancelURL</code></td><td><strong>Required (string)</strong><br>Merchant 3DS cancel URL.</td></tr><tr><td><code>PaymentDetails.PaymentMethod.RecurringEnabled</code></td><td><strong>Optional (boolean)</strong><br>Flag to enable recurring on the new license when set true.</td></tr><tr><td><code>ExtraInformation</code></td><td><strong>Optional (object)</strong><br>Order extra information.</td></tr><tr><td><code>ExtraInformation.ProposalId</code></td><td><strong>Optional (string)</strong><br>Related proposal object ID.</td></tr><tr><td><code>ExtraInformation.PurchaseOrderDownloadLink</code></td><td><strong>Optional (string)</strong><br>PO Download link.</td></tr><tr><td><code>ExtraInformation.AMEmailB2B</code></td><td><strong>Optional (string)</strong><br>AM email for B2B.</td></tr><tr><td><code>ExtraInformation.RetryFailedPaymentLink</code></td><td><strong>Optional (string)</strong><br>Retry failed payment link.</td></tr></tbody></table>

### Request sample

```php
<?php
declare(strict_types=1);
class Configuration
{
    public const MERCHANT_CODE = '1234554321';
    public const MERCHANT_KEY = 'D+~=z5R+R4])4D5&p56%';
    public const URL = 'http://api.avangate.local/rpc/6.0';
    public const ACTION = 'getDealInfo';
    //array or JSON
    public const PAYLOAD = <<<JSON
{
    "Currency": "usd",
    "Country": "us",
    "Language": "en",
    "CustomerIp": "91.220.121.21",
    "Source": "salesforce_cpq",
    "Items": [\
        {\
            "DealDate": "2021-03-18 13:36:47",\
            "SubscriptionReference": "GUC9PFSIH8",\
            "ProductCode": "PAV2019",\
            "Quantity": 1,\
            "DealPriceScenario": "using_last_order_price",\
            "DealSubscriptionScenario": "prolong",\
            "Price": {\
                "Amount": 50,\
                "Type": "CUSTOM",\
                "AmountType": "GROSS"\
            },\
            "PriceOptions": [\
                {\
                    "Code": "interval_scale_grp1",\
                    "Options": [\
                        "25"\
                    ]\
                },\
                {\
                    "Code": "OPTGRP1",\
                    "Options": [\
                        "OptGrp1Code1"\
                    ]\
                }\
            ],\
            "SubscriptionCustomSettings": {\
                "CycleLength": 1,\
                "CycleUnit": "MONTH",\
                "CycleAmount": 50,\
                "CycleAmountType": "GROSS",\
                "ContractLength": 12,\
                "ClientDealAutoRenewal": true,\
                "MerchantDealAutoRenewal": true\
            }\
        }\
    ],
    "BillingDetails": {
        "FirstName": "Donald",
        "LastName": "Wilson",
        "CountryCode": "us",
        "State": "Texas",
        "City": "Dallas",
        "Address1": "4519 BlueBridge Road",
        "Zip": "02199",
        "Email": "dwilson@test.com",
        "Phone": "6172938133",
        "Company": "Integra Wealth",
        "FiscalCode": "85421564"
    },
    "DeliveryDetails": {
        "FirstName": "Gerard",
        "LastName": "Butler",
        "CountryCode": "us",
        "State": "Texas",
        "City": "Austin",
        "Address1": "2033 Nuzum Court",
        "Zip": "14216",
        "Email": "gerard.butler@integrawealth.net",
        "Phone": "7165708136",
        "Company": "Integra Wealth"
    },
    "PaymentDetails": {
        "Type": "EES_TOKEN_PAYMENT",
        "Currency": "usd",
        "CustomerIP": "91.220.121.21",
        "PaymentMethod": {
            "EesToken": "7886eebb-0aa0-482c-8636-28394e2b714d",
            "RecurringEnabled": true
        }
    },

    "ExtraInformation": {
       "ProposalId": "1de36a0a-a7b6-4cb7-9de5-34c802e4243b",
       "PurchaseOrderDownloadLink": "http://secure.avangate.local/proposal/po/342322/dl",
       "AMEmailB2B": "test@email.org",
       "RetryFailedPaymentLink": "http://secure.avangate.local/proposal/po/342322/retry?ref=[REFNO]"
    }
}
JSON;
}
class Client
{
    private const LOGIN_METHOD = 'login';
    private $calls = 1;
    private $sessionId;
    private function generateAuth(): array
    {
        $merchantCode = Configuration::MERCHANT_CODE;
        $key = Configuration::MERCHANT_KEY;
        $date = gmdate('Y-m-d H:i:s');
        $string = strlen($merchantCode) . $merchantCode . strlen($date) . $date;
        $hash = hash_hmac('md5', $string, $key);
        return compact('merchantCode', 'date', 'hash');
    }
    public function login(string $url)
    {
        $payload = $this->generateAuth();
        $response = $this->call($url, array_values($payload), self::LOGIN_METHOD);
        $this->sessionId = $response['result'];
    }
    public function call(
        string $url = Configuration::URL,
        $payload = Configuration::PAYLOAD,
        string $action = Configuration::ACTION
    ): ?array {
        if (empty($this->sessionId) && $action !== self::LOGIN_METHOD) {
            $this->login($url);
        }
        if(is_string($payload)) {
            $payload = json_decode($payload, true);
        }
        if (!empty($this->sessionId)) {
            $payload = [$this->sessionId, $payload];
        }
        $payload = array_filter($payload);
        $request = json_encode([\
            'jsonrpc' => '2.0',\
            'method' => $action,\
            'params' => $payload,\
            'id' => $this->calls++,\
        ]);
        $curl = curl_init($url);
        curl_setopt($curl, CURLOPT_POST, 1);
        curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, 0);
        curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, 0);
        curl_setopt($curl, CURLOPT_SSLVERSION, 0);
        curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
        curl_setopt($curl, CURLOPT_HTTPHEADER, array('Content-Type: application/json', 'Accept: application/json', 'Cookie: XDEBUG_SESSION=PHPSTORM'));
        curl_setopt($curl, CURLOPT_POSTFIELDS, $request);
        $response = curl_exec($curl);
        if(empty($response)) {
            die('Server unavailable');
        }
        echo $response . '</br>';
        return json_decode($response, true);;
    }
}
$client = new Client();
$result = $client->call();
var_dump($result);
```

## Response

The **changeDeal** method has (almost) the same response parameters as the [getDealInfo](/json-rpc-api-reference/json-rpc-api-6.0/api-requests/subscription/retrieve-subscription-deal-information.md) method, plus the deal order details returned under the DealOrder key. These order details have the same structure as any **placeOrder** API method response (see [here](/json-rpc-api-reference/json-rpc-api-6.0/api-responses/order-with-catalog-products.md)).

```php
[\
    {\
        "SubscriptionReference": "GUC9PFSIH8",\
        "DealPriceScenario": "using_last_order_price",\
        "DealSubscriptionScenario": "prolong",\
        "DealDate": "2021-03-18 13:36:47",\
        "DealDueNowPriceNet": 47.06,\
        "DealDueNowPriceGross": 50,\
        "DealTaxAmount": 2.94,\
        "DealTaxPercent": 6.25,\
        "CurrentInfo": {\
            "ProductCode": "BKG20193",\
            "ProductName": "Backgammon 2019.3",\
            "ProductDescription": "",\
            "BillingPriceNet": 45,\
            "UnitBillingPriceNet": 45,\
            "BillingPriceGross": 47.81,\
            "UnitBillingPriceGross": 47.81,\
            "NoOfBillingCycles": 13,\
            "CurrentBillingCycle": 1,\
            "PayedBillingCycles": 1,\
            "RemainingBillingCycles": 11,\
            "CurrentBillingCycleEndDate": "2021-03-15 11:35:02",\
            "ClientDealAutoRenewal": false,\
            "MerchantDealAutoRenewal": false,\
            "Quantity": 1,\
            "CurrencyCode": "usd",\
            "TaxAmount": 2.81,\
            "TaxPercent": 6.25,\
            "BillingCyclesFrequency": 1,\
            "BillingCycleFrequencyUnit": "MONTH",\
            "ContractLength": 12,\
            "ContractLengthUnit": "MONTH",\
            "ProductOptions": []\
        },\
        "NewDealInfo": {\
            "ProductCode": "PAV2019",\
            "ProductName": "Pipera AntiVirus 2019",\
            "ProductDescription": "",\
            "BillingPriceNet": 47.06,\
            "BillingPriceGross": 50,\
            "NoOfBillingCycles": 12,\
            "CurrentBillingCycle": 1,\
            "PayedBillingCycles": 0,\
            "RemainingBillingCycles": 12,\
            "CurrentBillingCycleEndDate": "2021-04-18 13:36:47",\
            "TaxAmount": 2.94,\
            "TaxPercent": 6.25,\
            "CurrencyCode": "usd",\
            "BillingCyclesFrequency": 1,\
            "BillingCycleFrequencyUnit": "MONTH",\
            "ContractLength": 12,\
            "ContractLengthUnit": "MONTH",\
            "ProductOptions": [\
                {\
                    "Code": "interval_scale_grp1",\
                    "Options": [\
                        "25"\
                    ]\
                },\
                {\
                    "Code": "OPTGRP1",\
                    "Options": [\
                        "OptGrp1Code1"\
                    ]\
                }\
            ]\
        },\
        "TotalsDealInfo": {\
            "DealsNumber": 0,\
            "ContractsNumber": 1,\
            "PaidBillingCycles": 1,\
            "ElapsedBillingCycles": 1\
        },\
        "DealOrder": {\
            "RefNo": "11591805",\
            "OrderNo": 0,\
            "ExternalReference": null,\
            "ShopperRefNo": null,\
            "Status": "AUTHRECEIVED",\
            "ApproveStatus": "WAITING",\
            "VendorApproveStatus": "OK",\
            "MerchantCode": "120000589445",\
            "Language": "en",\
            "OrderDate": "2021-02-15 13:39:29",\
            "FinishDate": null,\
            "Source": null,\
            "Affiliate": {\
                "AffiliateCode": null,\
                "AffiliateSource": null,\
                "AffiliateName": null,\
                "AffiliateUrl": null\
            },\
            "HasShipping": true,\
            "BillingDetails": {\
                "FiscalCode": "85421564",\
                "TaxOffice": null,\
                "Phone": "6172938133",\
                "FirstName": "Donald",\
                "LastName": "Wilson",\
                "Company": "Integra Wealth",\
                "Email": "dwilson@test.com",\
                "Address1": "4519 BlueBridge Road",\
                "Address2": null,\
                "City": "Dallas",\
                "Zip": "02199",\
                "CountryCode": "us",\
                "State": "Texas"\
            },\
            "DeliveryDetails": {\
                "Phone": "7165708136",\
                "FirstName": "Gerard",\
                "LastName": "Butler",\
                "Company": "Integra Wealth",\
                "Email": "gerard.butler@integrawealth.net",\
                "Address1": "2033 Nuzum Court",\
                "Address2": null,\
                "City": "Austin",\
                "Zip": "14216",\
                "CountryCode": "us",\
                "State": "Texas"\
            },\
            "PaymentDetails": {\
                "Type": "CC",\
                "Currency": "usd",\
                "PaymentMethod": {\
                    "FirstDigits": "4111",\
                    "LastDigits": "1111",\
                    "CardType": "visa",\
                    "RecurringEnabled": true,\
                    "Vendor3DSReturnURL": null,\
                    "Vendor3DSCancelURL": null,\
                    "InstallmentsNumber": null\
                },\
                "CustomerIP": "91.220.121.21"\
            },\
            "DeliveryInformation": {\
                "ShippingMethod": {\
                    "Code": null,\
                    "TrackingUrl": null,\
                    "TrackingNumber": null,\
                    "Comment": null\
                }\
            },\
            "CustomerDetails": null,\
            "Origin": "API",\
            "AvangateCommission": 4.4,\
            "OrderFlow": "REGULAR",\
            "GiftDetails": null,\
            "PODetails": null,\
            "ExtraInformation": {\
                "RetryFailedPaymentLink": "http:\/\/secure.avangate.local\/proposal\/po\/342322\/retry?ref=11591805",\
                "ProposalId": "1de36a0a-a7b6-4cb7-9de5-34c802e4243b",\
                "PurchaseOrderDownloadLink": "http:\/\/secure.avangate.local\/proposal\/po\/342322\/dl",\
                "B2B": true,\
                "AMEmailB2B": "test@email.org"\
            },\
            "PartnerCode": null,\
            "PartnerMargin": null,\
            "PartnerMarginPercent": null,\
            "ExtraMargin": null,\
            "ExtraMarginPercent": null,\
            "ExtraDiscount": null,\
            "ExtraDiscountPercent": null,\
            "LocalTime": null,\
            "TestOrder": false,\
            "FxRate": 0.76357124584292,\
            "FxMarkup": 10.456,\
            "PayoutCurrency": "EUR",\
            "DeliveryFinalized": false,\
            "Errors": null,\
            "Items": [\
                {\
                    "ProductDetails": {\
                        "Name": "Pipera AntiVirus 2019",\
                        "ShortDescription": "",\
                        "Tangible": false,\
                        "IsDynamic": false,\
                        "ExtraInfo": null,\
                        "RenewalStatus": false,\
                        "Subscriptions": null,\
                        "DeliveryInformation": {\
                            "Delivery": "NO_DELIVERY",\
                            "DownloadFile": null,\
                            "DeliveryDescription": "",\
                            "CodesDescription": "",\
                            "Codes": []\
                        }\
                    },\
                    "PriceOptions": [\
                        {\
                            "Code": "OPTGRP1",\
                            "Name": "OptGrp1",\
                            "Required": false,\
                            "Options": [\
                                {\
                                    "Name": "2 users",\
                                    "Value": "OptGrp1Code1",\
                                    "Surcharge": "5.00"\
                                }\
                            ]\
                        },\
                        {\
                            "Code": "interval_scale_grp1",\
                            "Name": "Interval scale group1",\
                            "Required": false,\
                            "Options": [\
                                {\
                                    "Name": "Interval scale group1: 25",\
                                    "Value": "interval_scale_grp1=25",\
                                    "Surcharge": "125.00"\
                                }\
                            ]\
                        }\
                    ],\
                    "Price": {\
                        "UnitNetPrice": 47.06,\
                        "UnitGrossPrice": 50,\
                        "UnitVAT": 2.94,\
                        "UnitDiscount": 0,\
                        "UnitNetDiscountedPrice": 47.06,\
                        "UnitGrossDiscountedPrice": 50,\
                        "UnitAffiliateCommission": 0,\
                        "ItemUnitNetPrice": null,\
                        "ItemUnitGrossPrice": null,\
                        "ItemNetPrice": null,\
                        "ItemGrossPrice": null,\
                        "VATPercent": 6.25,\
                        "HandlingFeeNetPrice": 0,\
                        "HandlingFeeGrossPrice": 0,\
                        "Currency": "usd",\
                        "NetPrice": 47.06,\
                        "GrossPrice": 50,\
                        "NetDiscountedPrice": 47.06,\
                        "GrossDiscountedPrice": 50,\
                        "Discount": 0,\
                        "VAT": 2.94,\
                        "AffiliateCommission": 0\
                    },\
                    "LineItemReference": "f703af791bca619bbd42cc6964192456dc243f27",\
                    "PurchaseType": "PRODUCT",\
                    "Code": "PAV2019",\
                    "ExternalReference": "PAV2019QWE",\
                    "Quantity": 1,\
                    "SKU": null,\
                    "CrossSell": null,\
                    "Trial": null,\
                    "AdditionalFields": null,\
                    "Promotion": null,\
                    "RecurringOptions": null,\
                    "SubscriptionStartDate": null,\
                    "SubscriptionCustomSettings": {\
                        "CycleUnit": "MONTH",\
                        "CycleLength": 1,\
                        "CycleAmount": 50,\
                        "CycleAmountType": "GROSS",\
                        "ContractLength": 12,\
                        "MerchantDealAutoRenewal": true,\
                        "ClientDealAutoRenewal": true\
                    }\
                }\
            ],\
            "Promotions": [],\
            "AdditionalFields": null,\
            "CustomParameters": null,\
            "Currency": "usd",\
            "NetPrice": 47.06,\
            "GrossPrice": 50,\
            "NetDiscountedPrice": 47.06,\
            "GrossDiscountedPrice": 50,\
            "Discount": 0,\
            "VAT": 2.94,\
            "AffiliateCommission": 0\
        }\
    }\
]
```

### Error handling

Whenever there is a validation error, an error response is returned, for example:

```php
{
    "error_code": "INVALID_EES_TOKEN",
    "message": "The token is not valid. In order to proceed with the place order a valid token is required"
}
```

In this case, the deal order is not created, and you must correct the request parameters and retry the API call.

Most of the validation errors are common with the ones listed for the getDealInfo method (see the [Errors handling](/json-rpc-api-reference/json-rpc-api-6.0/api-requests/subscription/retrieve-subscription-deal-information.md)).

Whenever there is a payment level error encountered, the amendment order is still created, and the payment processing error will be returned in the DealOrder.Errors element, in the usual format used by the placeOrder response. Example:

```php
[\
    {\
        "SubscriptionReference": "GUC9PFSIH8",\
        ……\
        "DealOrder": {\
            "RefNo": "11662596",\
            ……\
            "Errors": {\
                  "ORDER_PAYMENT_METHOD_CARD_PROCESS_ERROR": "Couldn't complete the payment validation process: Error processing the credit card transaction. Please contact the issuer bank for more details, or enter another card."\
            }\
        }\
    }\
]
```

You can check the list of possible order-level errors on [this](broken://pages/xsqI41AfgrdFGJg9SVPT) page.


---

# 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/json-rpc-api-reference/json-rpc-api-6.0/api-requests/subscription/subscription-change-deal.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.
