Knowledge Base - 2Checkout - What are the parameters for 2Checkout's Plug and Play cart?
Like

What are the parameters for 2Checkout's Plug and Play cart?

Answer:

Below are the parameters supported by the Plug and Play Cart. These parameters can only be used if you have created your products in your account. You are using the Plug and Play cart if you are passing in the three parameters listed under the Required section below.

Checkout URL:

https://www.2checkout.com/checkout/purchase

Required Parameters:
sid – Your 2Checkout account number. (64 characters max)
product_id – The 2CO ID for the product or service in your 2Checkout account.
quantity – The quantity of the product. (99 max value)

Additional Parameters:
demo – Y to enable demo mode, do not pass this in for live sales.
fixed – Y to remove the Continue Shopping button and lock the quantity fields.
lang – Chinese – zh, Danish – da, Dutch – nl, French – fr, German – gr, Greek – el, Italian – it, Japanese – jp, Norwegian – no, Portuguese – pt, Slovenian – sl, Spanish – es_ib, Spanish – es_la, Swedish – sv, defaults to English if this is absent, but en may be used for English as well.
return_url – Used to control where the Continue Shopping button will send the customer when clicked. (255 characters max)
merchant_order_id – Specify your order number with this parameter. It will also be included in the confirmation emails to yourself and the customer. (50 characters max)
pay_method – CC for Credit Card, PPI for PayPal. This will set the default selection on the payment method step during the checkout process.
purchase_step – Sets the purchase step that the buyer will land on when being directed to the checkout page. Possible values are ‘review-cart’, ‘shipping-information’, ‘shipping-method’, ‘billing-information’ and ‘payment-method’. Please Note: To skip a purchase step(s), all of the required fields for the skipped step(s) must be pre-populated. This can be accomplished by passing in the values for any required fields using the parameters discussed below. If a required field is not pre-populated, the buyer will revert back to the skipped step that needs to be completed.
x_Receipt_Link_URL -Used to specify an approved URL on-the-fly. This is limited to the same domain that is used for your 2Checkout account, otherwise it will be ignored. (no limit):

  • This parameter will override any URL set in your 2Checkout account.
  • If the Return Method is set to “Given links back to my Website”: This parameter will control where the buyer and sale parameters will be directed to after clicking the “Finalize your Order” button on the Order Processed page.
  • If Return Method is set to “Direct Return” or “Header Redirect” : This parameter will define the URL that the buyer and sale parameters will be directed to when the sale is completed.

coupon – Specify a 2Checkout created coupon code. If applicable, the coupon will be automatically applied to the sale.

To populate the billing information page you may pass in
card_holder_name – Card holder’s name. (128 characters max)

The card holder’s name can also be populated using the first_namemiddle_initial, and last_name parameters. IMPORTANT: If you use these three parameters, the data will be combined into and returned as card_holder_name to your Approved URL script.

street_address – Card holder’s street address. (64 characters max) Important: If a buyer selects China or Japan as their billing country this field name will display as 'District'
street_address2 – The second line for the street address, typically suburb or apartment number information. (64 characters max) Important: If a buyer selects China or Japan as their billing country this field name will display as 'Address' and will be a required field. If a buyer selects Russian Federation as their billing address the field will be required.
city – Card holder’s city. (64 characters max)
state – Card holder’s state. (64 characters max)
zip – Card holder’s zip or postal code. (16 characters max)
country – Card holder’s country. (64 characters max)
email – Card holder’s email address. (64 characters max)
phone – Card holder’s phone number. (16 characters max)
phone_extension – Card holder’s phone extension. (9 characters max)

To populate the shipping information page you may pass in
ship_name
ship_street_address
ship_street_address2
ship_city
ship_state
ship_zip
ship_country

Please note that shipping information will only be collected for items that are defined as tangible in our system, or if a tangible 'product' or 'shipping' line item is passed in with the Hosted Checkout parameter set. Shipping is also only charged for tangible items.

The billing information fields will also be populated with the information from the shipping page if the shipping information is collected on that sale and the billing information is not passed in.

Custom Parameters:
You may pass in any additional parameters that you may need and they will be returned to you at the end of the sale. The only restrictions on custom parameters are that they can not share the name of ANY parameter that our system uses, even from the other sets. Please note that you WILL need a return script set up on the Site Management page to receive any of these parameters back as they are not included in the confirmation emails.

Passing Multiple Plug and Play Products:
You may also pass multiple plug and play products in one form. To do this, add a corresponding digit to the quantity and product_id parameters to group them for each product. For example, if we wanted to pass two products into the system we would be passing in first the sid parameter, then product_id1 and quantity1, and then product_id2 and quantity2.

Example:

<form action='https://www.2checkout.com/checkout/purchase' method='post'><input type='hidden' name='sid' value='123' ><input type='hidden' name='quantity1' value='1' ><input type='hidden' name='product_id1' value='1008' /><input type='hidden' name='quantity2' value='1' ><input type='hidden' name='product_id2' value='1014' ><input type='hidden' name='quantity3' value='1' ><input type='hidden' name='product_id3' value='1011' ><input name="submit" type='submit' value='Buy from 2CO' ></form>

You can receive back all of the parameters that were passed in as well as the following parameters:
order_number – 2Checkout.com order number
total – the total amount of the purchase
ship_method – the shipping method that was selected for this order (if applicable)
credit_card_processed – Y if successful (Approved).
merchant_product_id – your product ID for purchased item
key – the MD5 hash that can be used to verify that the sale came from one of our servers

Important: You cannot mix the four parameter sets. This will cause problems during payment or may prevent the payment pages from working at all.

Important Note: When you are testing parameters, please be certain to clear the cookies in your browser between tests to ensure the changes you have made are applied.

Was this article helpful?

Your feedback helps us improve our site.

Feedback

Please tell us how we can make this article more useful.

Characters Remaining: 255