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
Item
Required (object)
Details below.
Item.Code
Required (string)
Unique product identifier you control. Max length 256 characters.
Item.Quantity
Required (string)
Number of units.
Item.PriceOptions
Optional (array of objects)
Array of price option groups.
Item.PriceOptions.Options
Optional (array of objects)
Array of pricing options.
Item.PriceOptions.Options.Value
Optional (string)
Pricing option code.
Billing details
Optional (object)
Details below. Can be null.
Billing details.FirstName
Optional (string)
Shopper name.
Billing details.LastName
Optional (string)
Shopper surname.
Billing details.CountryCode
Optional (string)
Shopper country. ISO 3166 two-letter code. Include CountryCode in your request in combination with a null value for Currency, to receive the price in the default currency of the country you set.
Billing details.State
Optional (string)
Required for US, Brazil, and Romania
The state in the shopper's country. Mandatory when you set the Billing Country to the US, Brazil, and Romania. Use case insensitive utf8 strings for the full name, or just the two-letter code.
Billing details.City
Optional (string)
Shopper city.
Billing details.Address1
Optional (string)
Shopper address.
Billing details.Address2
Optional (string)
Shopper address.
Billing details.Zip
Optional (string)
ZIP/ Postal code.
Billing details.Email
Optional (string)
Shopper email address.
Billing details.Phone
Optional (string)
Shopper phone number. Mandatory when you set Brazil as the Billing Country. Can be NULL.
Billing details.Company
Optional (string)
Company name. Can be null for end users. When present, you also need to provide the FiscalCode.
Billing details.FiscalCode
Optional (string)
Required for Brazil
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.Mandatory when you set Brazil as the Billing Country. For Brazilian customers, it represents the Fiscal Code (CPF/CNPJ).
Can be NULL for end users.
Currency
Required (string)
The currency ISO code for the payment - ISO 4217. Example: “usd.”
CouponCode
Optional (string)
Promotion coupon/voucher.
PayType
Optional (string)
The payment method:
CC (credit/debit card - including local Brazilian cards).
ENCRYPTED_PAYMENT_DATA (client-side encryption)
PAYPAL
PAYPAL_EXPRESS
TEST (for test orders).
PREVIOUS_ORDER
EXISTING_PAYMENT_DATA (use a card one of your customers already used to purchase from your account).
WIRE – the placeOrder response includes Wire payment details.
CHECK – the placeOrder response includes Check payment details.
PURCHASEORDER - use for orders with POs.
FREE – for 0 value orders for which you’re not requiring customers to provide payment details.
Request sample
Response parameters
ItemPrice
Object
Details below.
UnitNetPrice
Float
The value per product unit, excluding sales tax/VAT expressed in the payment currency.
UnitGrossPrice
Float
Total value per product unit, including sales tax/VAT expressed in the payment currency. UnitGrossPrice does not reflect any discounts.
UnitVAT
Integer
Sales tax/VAT per product unit expressed in the payment currency.
UnitDiscount
Integer
Value of the discount per product unit expressed in the payment currency.
UnitNetDiscountedPrice
Float
The value per product unit, expressed in the payment currency, excluding sales tax/VAT, from which 2Checkout deducts the unit discount.
UnitGrossDiscountedPrice
Float
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.
UnitAffiliateCommission
Integer
Value of the affiliate commission per product unit calculated expressed in the payment currency. 2Checkout deducts discounts from the costs incurred by shoppers before calculating affiliate commissions. 2Checkout does not take into account shipping costs when calculating affiliate commissions. NULL when 2Checkout does not apply an affiliate commission.
VATPercent
Integer
VAT percentage applied to purchase.
HandlingFeeNetPrice
Integer
Handling fee applied to your NET price configuration.
HandlingFeeGrossPrice
Integer
Handling fee applied to your GROSS price configuration.
AffiliateCommission
Optional (double)
Value of the affiliate commission for the order calculated from the NetDiscountedPrice expressed in the payment currency. Or NULL. 2Checkout does not take into account shipping costs when calculating affiliate commissions.
Currency
Optional (string)
The currency ISO code for the payment - ISO 4217. Example: “usd.” Use null as value when you include CountryCode in your request, to receive the price in the default currency of the country you set.
Discount
Optional (double)
Value of the discounts for an order expressed in the payment currency.
GrossDiscountedPrice
Optional (double)
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.
GrossPrice
Optional (double)
Total order value, including sales tax/VAT expressed in the payment currency. GrossPrice does not reflect any discounts.
NetDiscountedPrice
Optional (double)
The NetPrice order value excluding sales tax/VAT, from which 2Checkout deducts discounts. NetDiscountedPrice is expressed in the payment currency.
NetPrice
Optional (double)
Order value excluding sales tax/VAT expressed in the payment currency.
VAT
Optional (double)
Value of sales tax/VAT expressed in the payment currency.
Last updated
Was this helpful?