{"method":"POST","path":"https://api.revcent.com/v2/sales/estimate","summary":"Estimate A Sale","description":"Estimate the total cost with itemized results including products, shipping, tax, coupons and discounts.<br><br>The request object is the same as the the sale create request object, except no payment is processed.<br><br> The response object contains detailed information that can be useful for displaying to a customer during checkout, including how much the customer will save due to discounts. View markdown documentation at https://revcent.com/documentation/markdown/mcp/operation/EstimateSale.md for an in-depth overview of this operation.","operationId":"EstimateSale","requestBody":{"content":{"application/json":{"schema":{"title":"Sale Estimate Request Object","description":"Provide the same request object as a normal sale, or the sale_id for a previously created pending sale.","properties":{"sale_id":{"description":"An optional RevCent sale ID if estimating a previously created pending sale. If provided, all other properties are optional.","type":"string"},"campaign":{"type":"string","title":"Campaign ID","description":"A 20 character campaign ID.","minLength":20,"maxLength":20},"iso_currency":{"description":"The three digit ISO 4217 currency code.","type":"string","minLength":3,"maxLength":3},"include_gateway":{"description":"Only provide if you wish to return a specific gateway to be used in a future sale request. Must include payment type of credit card and a next-gen payment profile ID. Default is false.","type":"boolean"},"payment_type":{"description":"If include_gateway is true, the payment type for the sale. Must be credit_card.","type":"string","enum":["credit_card"]},"payment_profile":{"description":"If include_gateway is true, provide the payment profile ID for a next-gen profile. Only next-gen profiles are supported.","type":"string","minLength":20,"maxLength":20},"customer_id":{"description":"An optional RevCent customer ID if estimating a sale on behalf of a specific customer.","type":"string"},"credit_card":{"additionalProperties":false,"description":"If include_gateway is true and not providing an existing customer ID for a customer with a saved card.","properties":{"card_number":{"description":"The full credit card number.","type":"string"},"exp_month":{"description":"The credit card expiration month as a one or two digit integer, i.e. MM.","type":"integer"},"exp_year":{"description":"The credit card expiration year as a two digit integer, i.e. YY.","type":"integer"},"card_code":{"description":"The credit card code as a string. Depending on the card type this can be different lengths.","type":"string"}},"type":"object","required":["card_number","exp_month","exp_year"]},"customer":{"description":"The customer object.","additionalProperties":false,"properties":{"first_name":{"type":"string","description":"The customer first name."},"last_name":{"type":"string","description":"The customer last name."},"address_line_1":{"type":"string","description":"The customer first address line."},"address_line_2":{"type":"string","description":"The customer second address line."},"city":{"type":"string","description":"The customer city."},"state":{"type":"string","description":"The customer state."},"zip":{"type":"string","description":"The customer ZIP and or postal code."},"country":{"type":"string","description":"The customer country in three letter ISO 3166-1 alpha-3 format."},"company":{"type":"string","description":"The customer company."},"email":{"type":"string","format":"email","description":"The customer email."},"phone":{"type":"string","description":"The customer phone."}},"type":"object","required":["first_name","last_name","email"]},"bill_to":{"description":"To use as the billing information. If not present the customer object will be used.","additionalProperties":false,"properties":{"first_name":{"type":"string","description":"The bill to first name."},"last_name":{"type":"string","description":"The bill to last name."},"address_line_1":{"type":"string","description":"The bill to first address line."},"address_line_2":{"type":"string","description":"The bill to second address line."},"city":{"type":"string","description":"The bill to city."},"state":{"type":"string","description":"The bill to state."},"zip":{"type":"string","description":"The bill to ZIP and or postal code."},"country":{"type":"string","description":"The bill to country in three letter ISO 3166-1 alpha-3 format."},"company":{"type":"string","description":"The bill to company."},"email":{"type":"string","format":"email","description":"The bill to email."},"phone":{"type":"string","description":"The bill to phone."}},"type":"object","required":["first_name","last_name","email"]},"ship_to":{"description":"To use as the ship to information. If not present the customer object, or bill_to object will be used if either present in respective order.","additionalProperties":false,"properties":{"first_name":{"type":"string","description":"The shipping first name."},"last_name":{"type":"string","description":"The shipping last name."},"address_line_1":{"type":"string","description":"The shipping first address line."},"address_line_2":{"type":"string","description":"The shipping second address line."},"city":{"type":"string","description":"The shipping city."},"state":{"type":"string","description":"The shipping state."},"zip":{"type":"string","description":"The shipping ZIP and or postal code."},"country":{"type":"string","description":"The shipping country in three letter ISO 3166-1 alpha-3 format."},"company":{"type":"string","description":"The shipping company."},"email":{"type":"string","format":"email","description":"The shipping email."},"phone":{"type":"string","description":"The shipping phone."}},"type":"object","required":["first_name","last_name","email"]},"product":{"description":"The products to include in the sale request.","items":{"description":"An individual product","additionalProperties":false,"properties":{"id":{"title":"Product ID","type":"string","description":"A 20 character product ID.","minLength":20,"maxLength":20},"quantity":{"description":"The quantity being purchased. Default is 1.","type":"integer"},"price":{"description":"The price you wish to charge, if different from the product default price in RevCent.","type":"number","format":"float"}},"type":"object","required":["id"]},"type":"array"},"shipping":{"description":"Shipping to include in the sale request. Please refer to our <a href=\"https://kb.revcent.com/en/revenue/shipping#provider-method-table\" target=\"_blank\">Provider Method Table</a> at our knowledge base for the provider and method IDs.","items":{"description":"An individual shipping entry.","additionalProperties":false,"properties":{"amount":{"description":"The amount to charge for the specific shipping entry. A shipping amount can be 0.","type":"number","format":"float"},"provider":{"description":"The shipping provider. This will be included when creating a shipment at a fulfillment center. Please refer to our <a href=\"https://kb.revcent.com/en/revenue/shipping#provider-method-table\" target=\"_blank\">Provider Method Table</a> at our knowledge base for the correct provider id.","type":"string"},"provider_method":{"description":"The shipping provider method. This will be included when creating a shipment at a fulfillment center. Please refer to our <a href=\"https://kb.revcent.com/en/revenue/shipping#provider-method-table\" target=\"_blank\">Provider Method Table</a> at our knowledge base for the correct method id corresponding to the provider.","type":"string"},"name":{"description":"An optional name for the shipping entry.","type":"string"},"description":{"description":"An optional description for the shipping entry.","type":"string"}},"type":"object","required":["amount"]},"type":"array"},"tax":{"description":"Tax to charge in the sale request. Can create multiple tax entries to itemize separate taxes.","items":{"description":"An individual tax entry.","additionalProperties":false,"properties":{"amount":{"description":"The amount to charge for the specific tax entry.","type":"number","format":"float"},"name":{"description":"An optional name for the tax entry.","type":"string"},"description":{"description":"An optional description for the tax entry.","type":"string"}},"type":"object","required":["amount"]},"type":"array"},"coupon":{"description":"Include one or more coupon codes which will be used to automatically apply discounts to a sale.","items":{"description":"An individual tax entry.","additionalProperties":false,"properties":{"coupon_code":{"description":"A coupon code which exists in RevCent.","type":"string"}},"type":"object","required":["coupon_code"]},"type":"array"},"discount":{"description":"Include one or more discount entries which will be used to automatically apply discounts to a sale. Can be a fixed amount or a percentage of the sales total.","items":{"description":"An individual discount entry.","additionalProperties":false,"properties":{"discount_value":{"description":"The coupon discount value relative to the discount_type.","type":"number","format":"float"},"discount_type":{"description":"The coupon discount type, either percent or amount. RevCent will calculate the discount if percent.","type":"string","enum":["percent","amount"]},"name":{"description":"An optional name for the discount entry.","type":"string"},"description":{"description":"An optional description for the discount entry.","type":"string"},"apply_to_product":{"description":"Whether to apply the discount to products purchased. Default is true. Set to false if discount should only apply to shipping.","type":"boolean"},"apply_to_shipping":{"description":"Whether to apply the discount to shipping. Default is true. Set to false if discount should only apply to products purchased.","type":"boolean"}},"type":"object","required":["discount_value","discount_type"]},"type":"array"}},"type":"object","additionalProperties":false,"required":["product"]}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"api_call_id":{"type":"string","description":"A 20 character API call ID.","minLength":20,"maxLength":20},"api_call_unix":{"description":"Unix timestamp of when the API call was initiated.","type":"integer","format":"unix-time"},"code":{"type":"integer"},"coupons":{"description":"A breakdown of both valid and invalid coupons if one or more coupon codes are submitted in the request.","type":"object","additionalProperties":false,"properties":{"valid":{"description":"An array of valid coupons if one or more coupon codes are submitted in the request.","type":"array","items":{"description":"","type":"object","additionalProperties":false,"properties":{"uuid":{"description":"A unique ID for the item. This is useful for identifying and matching this particular item with other related items in the response and vice versa.","type":"string"},"coupon_code":{"description":"The coupon code submitted.","type":"string"},"coupon_id":{"description":"The ID of the coupon you created in RevCent.","type":"string"},"coupon_profile_id":{"description":"The ID of the related coupon profile you created in RevCent.","type":"string"},"discount":{"description":"Potential discounts as a result of the coupon.","type":"object","additionalProperties":false,"properties":{"uuid":{"description":"A unique ID for the item. This is useful for identifying and matching this particular item with other related items in the response and vice versa.","type":"string"},"discount_amount":{"description":"The discount amount.","type":"number","format":"float"},"discount_percent":{"description":"The discount percentage (discount_multiplier * 100) rounded to max two decimal places.","type":"number","format":"float"},"discount_multiplier":{"description":"The discount multiplier, i.e. the mathematical number to apply to the total amount.","type":"number","format":"float"},"discount_value":{"description":"The discount value relative to the discount type.","type":"number","format":"float"},"discount_type":{"description":"The discount type relative to the discount value.","type":"string"}}}}}},"invalid":{"description":"n array of invalid coupons if one or more coupon codes are submitted in the request.","type":"array","items":{"type":"object","additionalProperties":false,"properties":{"uuid":{"description":"A unique ID for the item. This is useful for identifying and matching this particular item with other related items in the response and vice versa.","type":"string"},"coupon_code":{"description":"The coupon code submitted.","type":"string"},"errors":{"description":"An array of error messages as to why the coupon code is invalid.","type":"array","items":{"type":"string"}}}}}}},"discounts":{"description":"An array of individual discount items, which will be created if the sale is successfully processed.","type":"array","items":{"type":"object","additionalProperties":false,"properties":{"uuid":{"description":"A unique ID for the item. This is useful for identifying and matching this particular item with other related items in the response and vice versa.","type":"string"},"discount_amount":{"description":"The discount amount.","type":"number","format":"float"},"discount_percent":{"description":"The discount percentage (discount_multiplier * 100) rounded to max two decimal places.","type":"number","format":"float"},"discount_multiplier":{"description":"The discount multiplier, i.e. the mathematical number to apply to the total amount.","type":"number","format":"float"},"discount_type":{"description":"The discount type relative to the discount value.","type":"string"},"discount_value":{"description":"The discount value relative to the discount type.","type":"number","format":"float"},"is_coupon":{"description":"Whether the discount is a result of a coupon code or a static discount submitted.","type":"boolean"},"coupon_id":{"description":"If the discount is the result of a coupon, the coupon ID.","type":"string"},"coupon_uuid":{"description":"The unique ID of the coupon in the coupons array.","type":"string"},"products":{"description":"An array of product entries that the discount is being applied to if applicable.","type":"array","items":{"description":"","type":"object","additionalProperties":false,"properties":{"id":{"title":"Product ID","type":"string","description":"A 20 character product ID.","minLength":20,"maxLength":20},"uuid":{"description":"A unique ID for the item. This is useful for identifying and matching this particular item with other related items in the response and vice versa.","type":"string"},"discount_amount":{"description":"The discount amount.","type":"number","format":"float"},"discount_multiplier":{"description":"The discount multiplier, i.e. the mathematical number to apply to the total amount.","type":"number","format":"float"},"discount_percent":{"description":"The discount percentage (discount_multiplier * 100) rounded to max two decimal places.","type":"number","format":"float"},"total_amount_with_discount":{"description":"The total amount the customer will pay for the specific product after the discount has been applied.","type":"number","format":"float"}}}},"shipping":{"description":"An array of shipping entries that the discount is being applied to if applicable.","type":"array","items":{"type":"object","additionalProperties":false,"properties":{"uuid":{"description":"A unique ID for the item. This is useful for identifying and matching this particular item with other related items in the response and vice versa.","type":"string"},"discount_amount":{"description":"The discount amount.","type":"number","format":"float"},"discount_multiplier":{"description":"The discount multiplier, i.e. the mathematical number to apply to the total amount.","type":"number","format":"float"},"discount_percent":{"description":"The discount percentage (discount_multiplier * 100) rounded to max two decimal places.","type":"number","format":"float"},"total_amount_with_discount":{"description":"The total amount the customer will pay for shipping after discounts have been applied.","type":"number","format":"float"}}}}}}},"products":{"description":"An array of individual product items, which will be created if the sale is successfully processed.","type":"array","items":{"type":"object","additionalProperties":false,"properties":{"uuid":{"description":"A unique ID for the item. This is useful for identifying and matching this particular item with other related items in the response and vice versa.","type":"string"},"id":{"title":"Product ID","type":"string","description":"A 20 character product ID.","minLength":20,"maxLength":20},"name":{"description":"The products' name.","type":"string"},"description":{"description":"The products' description.","type":"string"},"quantity":{"description":"The product quantity.","type":"integer"},"price":{"description":"The product price.","type":"number","format":"float"},"total_amount":{"description":"The total amount before any discounts are applied.","type":"number","format":"float"},"is_trial":{"description":"Whether the product will create a trial when sold.","type":"boolean"},"is_trial_ship_now":{"description":"If the product is a trial product, whether the product will ship immediately upon sale completion.","type":"boolean"},"is_free_product":{"description":"Whether the product is a free product.","type":"boolean"},"discount_uuid":{"type":"array","items":{"description":"An array of UUID's linking the product to associated discounts.","type":"string"}},"discount_amount":{"description":"The discount amount.","type":"number","format":"float"},"discount_multiplier":{"description":"The discount multiplier, i.e. the mathematical number to apply to the total amount.","type":"number","format":"float"},"discount_percent":{"description":"The discount percentage (discount_multiplier * 100) rounded to max two decimal places.","type":"number","format":"float"},"total_amount_with_discount":{"description":"The total product amount after discounts are applied.","type":"number","format":"float"},"max_quantity_allowed":{"description":"The maximum quantity of the product the customer is able to purchase based on product settings.","type":"integer"}}}},"shipping":{"description":"","type":"array","items":{"description":"","type":"object","additionalProperties":false,"properties":{"uuid":{"description":"A unique ID for the item. This is useful for identifying and matching this particular item with other related items in the response and vice versa.","type":"string"},"amount":{"description":"The individual shipping amount.","type":"number","format":"float"},"products":{"description":"An array of products which will be associated with the specific shipping item.","type":"array","items":{"type":"object","additionalProperties":false,"properties":{"id":{"title":"Product ID","type":"string","description":"A 20 character product ID.","minLength":20,"maxLength":20},"uuid":{"description":"A unique ID for the item. This is useful for identifying and matching this particular item with other related items in the response and vice versa.","type":"string"},"quantity":{"description":"The product quantity.","type":"integer"}}}},"provider":{"description":"The shipping provider.","type":"string"},"provider_method":{"description":"The shipping provider method.","type":"string"},"total_amount_with_discount":{"description":"The total shipping amount after any discounts are applied.","type":"number","format":"float"}}}},"tax":{"description":"An array of individual tax items, which will be created if the sale is successfully processed.","type":"array","items":{"type":"object","additionalProperties":false,"properties":{"rate":{"description":"The calculated tax rate.","type":"number","format":"float"},"amount":{"description":"The total tax amount.","type":"number","format":"float"}}}},"totals":{"description":"The totals object, containing the sum of all related products, shipping, discounts and tax. Ultimate amounts are based on any delayed trial amounts, which the customer will not pay immediately.","type":"object","additionalProperties":false,"properties":{"amount_total":{"description":"The total amount the customer will ultimately pay for all items including any discounts applied.","type":"number","format":"float"},"amount_bill_now":{"description":"The total amount the customer will immediately pay upon initial sale purchase.","type":"number","format":"float"},"products":{"description":"The breakdown of ultimate and immediate amounts for all products the customer will pay.","type":"object","additionalProperties":false,"properties":{"amount_total":{"description":"The ultimate amount the customer will pay for products.","type":"number","format":"float"},"amount_bill_now_with_discount":{"description":"The immediate amount the customer will pay for products after any applicable discounts are applied.","type":"number","format":"float"},"amount_bill_now":{"description":"The immediate amount the customer will pay for products before any applicable discounts are applied.","type":"number","format":"float"}}},"shipping":{"description":"The breakdown of ultimate and immediate amounts for all shipping the customer will pay.","type":"object","additionalProperties":false,"properties":{"amount_total":{"description":"The ultimate amount the customer will pay for shipping.","type":"number","format":"float"},"amount_bill_now_with_discount":{"description":"The immediate amount the customer will pay for shipping after any applicable discounts are applied.","type":"number","format":"float"},"amount_bill_now":{"description":"The immediate amount the customer will pay for shipping before any applicable discounts are applied.","type":"number","format":"float"}}},"discount":{"description":"The breakdown of the total discount amount.","type":"object","additionalProperties":false,"properties":{"amount_total":{"description":"The immediate discount amount being applied to purchase.","type":"number","format":"float"}}},"tax":{"description":"The breakdown of ultimate and immediate amounts for all tax the customer will pay.","type":"object","additionalProperties":false,"properties":{"amount_total":{"description":"The ultimate amount the customer will pay for tax.","type":"number","format":"float"},"amount_bill_now":{"description":"The immediate amount the customer will pay for tax.","type":"number","format":"float"}}}}}}}}},"description":"Successful response."},"default":{"content":{"application/json":{"schema":{"description":"","properties":{"api_call_id":{"type":"string","description":"A 20 character API call ID.","minLength":20,"maxLength":20},"api_call_unix":{"description":"Unix timestamp of when the API call was initiated.","type":"integer","format":"unix-time"},"code":{"description":"This value indicates that there is an error. Will always be 0.","type":"integer","enum":[0]},"error_code":{"description":"The specific error code.","type":"string"},"message":{"description":"A human readable description of the error.","type":"string"},"result":{"description":"A description of the API call result.","type":"string"}},"title":"APIStandardErrors","type":"object","additionalProperties":false}}},"description":"Error response."}}}