# Retrieve price based on specific options

Use **getPrice** to extract cost information for a product/subscription plan, based on a specific list of options.

## Request parameters

<table><thead><tr><th width="299">Parameter</th><th>Type / Description</th></tr></thead><tbody><tr><td><code>Item</code></td><td><strong>Required (object)</strong><br>Details below.</td></tr><tr><td><code>Item.Code</code></td><td><strong>Required (string)</strong><br>Unique product identifier your control. Max length 256 characters.</td></tr><tr><td><code>Item.Quantity</code></td><td><strong>Required (string)</strong><br>Number of units.</td></tr><tr><td><code>Item.PriceOptions</code></td><td><strong>Optional (array of objects)</strong><br>Array of price option groups.</td></tr><tr><td><code>Item.PriceOptions.Options</code></td><td><strong>Optional (array of objects)</strong><br>Array of pricing options.</td></tr><tr><td><code>Item.PriceOptions.Options.Value</code></td><td><strong>Optional (string)</strong><br>Pricing option code.</td></tr><tr><td><code>BillingDetails</code></td><td><strong>Optional (object)</strong><br>Details below. Can be null.</td></tr><tr><td><code>BillingDetails.FirstName</code></td><td><strong>Optional (string)</strong><br>Shopper name.</td></tr><tr><td><code>BillingDetails.LastName</code></td><td><strong>Optional (string)</strong><br>Shopper surname.</td></tr><tr><td><code>BillingDetails.CountryCode</code></td><td><strong>Optional (string)</strong><br>Shopper country. ISO 3166 two-letter code. Include <code>CountryCode</code> in your request in combination with a null value for <code>Currency</code>, to receive the price in the default currency of the country you set. </td></tr><tr><td><code>BillingDetails.State</code></td><td><strong>Optional (string)</strong> – Required for US, Brazil and Romania<br>The state in the shopper's country. Mandatory when you set the Billing Country to US, Brazil and Romania. Use case insensitive utf8 strings for the full name, or just the two letter code.</td></tr><tr><td><code>BillingDetails.City</code></td><td><strong>Optional (string)</strong><br>Shopper city.</td></tr><tr><td><code>BillingDetails.Address1</code></td><td><strong>Optional (string)</strong><br>Shopper address.</td></tr><tr><td><code>BillingDetails.Address2</code></td><td><strong>Optional (string)</strong><br>Shopper address.</td></tr><tr><td><code>BillingDetails.Zip</code></td><td><strong>Optional (string)</strong><br>ZIP/ Postal code.</td></tr><tr><td><code>BillingDetails.Email</code></td><td><strong>Optional (string)</strong><br>Shopper email address.</td></tr><tr><td><code>BillingDetails.Phone</code></td><td><strong>Optional (string)</strong><br>Shopper phone number. Mandatory when you set Brazil as the Billing Country. Can be NULL.</td></tr><tr><td><code>BillingDetails.Company</code></td><td><strong>Optional (string)</strong><br>Company name. Can be null for end users. When present, you also need to provide the FiscalCode.</td></tr><tr><td><code>BillingDetails.FiscalCode</code></td><td><p><strong>Optional (string)</strong> – Required for Brazil</p><ul><li>For companies, it needs to be the VAT ID. 2Checkout will validate the value provided and throw an error if the VAT ID is invalid/incorrect when calling setPaymentDetails. When present, you also need to provide the Company name.</li><li>Mandatory when you set Brazil as the Billing Country. For Brazilian customers it represents the Fiscal Code (CPF/CNPJ).</li></ul><p>Can be NULL for end users.</p></td></tr><tr><td><code>Currency</code></td><td><strong>Required (string)</strong><br>The currency ISO code for the payment - ISO 4217. Example: “usd.”</td></tr><tr><td><code>CouponCode</code></td><td><strong>Optional (string)</strong><br>Promotion coupon/voucher.</td></tr><tr><td><code>PayType</code></td><td><p><strong>Optional (string)</strong><br>The payment method:</p><ul><li><strong>CC</strong> (credit/debit card - including local Brazilian cards).</li><li><strong>ENCRYPTED_PAYMENT_DATA</strong> (client-side encryption)</li><li><strong>PAYPAL</strong></li><li><strong>PAYPAL_EXPRESS</strong></li><li><strong>TEST</strong> (for test orders).</li><li><strong>PREVIOUS_ORDER</strong></li><li><strong>EXISTING_PAYMENT_DATA</strong> (use a card one of your customers already used to purchase from your account).</li><li><strong>WIRE</strong> – the <code>placeOrder</code> response includes Wire payment details.</li><li><strong>CHECK</strong> – the <code>placeOrder</code> response includes Check payment details.</li><li><strong>PURCHASEORDER</strong> - use for orders with POs.</li><li><strong>FREE –</strong> for 0 value orders for which you’re not requiring customers to provide payment details.</li></ul></td></tr></tbody></table>

### Request sample

```php
<?php

require ('PATH_TO_AUTH');

$CartItem = new stdClass();

$CartItem->Code = 'my_subscription_1';
$CartItem->Quantity = 1;
$CartItem->PriceOptions = array();

/* $CartItem->Trial = new stdClass();
$CartItem->Trial->Period = 8;
$CartItem->Trial->Price = 0; */

$BillingDetails = NULL;
$Currency = 'USD';
$CouponCode = '123';
$PayType = 'CC';

try {
    $itemPrice = $client->getPrice($sessionID, $CartItem, $BillingDetails, $Currency, $CouponCode, $PayType);
}
catch (SoapFault $e) {
    echo "itemPrice: " . $e->getMessage();
    exit;
}
var_dump("itemPrice", $itemPrice);
```

## Response parameters

<table><thead><tr><th width="237">Parameter</th><th>Type / Description</th></tr></thead><tbody><tr><td><code>ItemPrice</code></td><td><strong>Object</strong><br>Details below.</td></tr><tr><td><code>UnitNetPrice</code></td><td><strong>Float</strong><br>The value per product unit, excluding sales tax/VAT expressed in the payment currency.</td></tr><tr><td><code>UnitGrossPrice</code></td><td><strong>Float</strong><br>Total value per product unit, including sales tax/VAT expressed in the payment currency. UnitGrossPrice does not reflect any discounts.</td></tr><tr><td><code>UnitVAT</code></td><td><strong>Integer</strong><br>Sales tax/VAT per product unit expressed in the payment currency.</td></tr><tr><td><code>UnitDiscount</code></td><td><strong>Integer</strong><br>Value of the discount per product unit expressed in the payment currency.</td></tr><tr><td><code>UnitNetDiscountedPrice</code></td><td><strong>Float</strong><br>The value per product unit, expressed in the payment currency, excluding sales tax/VAT, from which 2Checkout deducts the unit discount.</td></tr><tr><td><code>UnitGrossDiscountedPrice</code></td><td><strong>Float</strong><br>Total costs shoppers incur per product unit, expressed in the payment currency. This value includes sales tax/VAT, 2Checkout and affiliate commissions, but 2Checkout deducts the value of any discounts.</td></tr><tr><td><code>UnitAffiliateCommission</code></td><td><strong>Integer</strong><br>Value of the affiliate commission per product unit calculated expressed in the payment currency.<br>2Checkout deducts discounts from the costs incurred by shoppers before calculating affiliate commissions.<br>2Checkout does not take into account shipping costs when calculating affiliate commissions.<br>NULL when 2Checkout does not apply an affiliate commission.</td></tr><tr><td><code>VATPercent</code></td><td><strong>Integer</strong><br>VAT percentage applied to purchase.</td></tr><tr><td><code>HandlingFeeNetPrice</code></td><td><strong>Integer</strong><br>Handling fee applied to your NET price configuration.</td></tr><tr><td><code>HandlingFeeGrossPrice</code></td><td><strong>Integer</strong><br>Handling fee applied to your GROSS price configuration.</td></tr><tr><td><code>AffiliateCommission</code></td><td><strong>Optional (double)</strong><br>Value of the affiliate commission for the order calculated from the <code>NetDiscountedPrice</code> expressed in the payment currency. Or NULL. 2Checkout does not take into account shipping costs when calculating affiliate commissions.</td></tr><tr><td><code>Currency</code></td><td><strong>Optional (string)</strong><br>The currency ISO code for the payment - ISO 4217. Example: “usd.” Use null as value when you include <code>CountryCode</code> in your request, to receive the price in the default currency of the country you set.</td></tr><tr><td><code>Discount</code></td><td><strong>Optional (double)</strong><br>Value of the discounts for an order expressed in the payment currency.</td></tr><tr><td><code>GrossDiscountedPrice</code></td><td><strong>Optional (double)</strong><br>Total costs shoppers incur, expressed in the payment currency. This value includes sales tax/VAT, 2Checkout and affiliate commissions, but 2Checkout deducts the value of any discounts.</td></tr><tr><td><code>GrossPrice</code></td><td><strong>Optional (double)</strong><br>Total order value, including sales tax/VAT expressed in the payment currency. GrossPrice does not reflect any discounts.</td></tr><tr><td><code>NetDiscountedPrice</code></td><td><strong>Optional (double)</strong><br>The NetPrice order value excluding sales tax/VAT, from which 2Checkout deducts discounts. NetDiscountedPrice is expressed in the payment currency.</td></tr><tr><td><code>NetPrice</code></td><td><strong>Optional (double)</strong><br>Order value excluding sales tax/VAT expressed in the payment currency.</td></tr><tr><td><code>VAT</code></td><td><strong>Optional (double)</strong><br>Value of sales tax/VAT expressed in the payment currency.</td></tr></tbody></table>


---

# 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/order-session-contents/retrieve-price-based-on-specific-options.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.
