Why do I get a parameter error when adding multiple buy buttons on the same page?

Each button added to the page needs to have its own opening and closing form field. This tells the browser that each form is separate, and not part of the same one.

The following correct example generated two separate buy buttons:

<form action="https://www.2checkout.com/2co/buyer/purchase" method="post">
<input type="hidden" name="sid" value="XXXXXX" />
<input type="hidden" name="product_id" value="10" />
<input type="text" name="quantity" size="5" value="1" />
<input type="submit" name="submit" value="Buy from 2CO" />
</form><form action=”https://www.2checkout.com/2co/buyer/purchase” method=”post”>
<input type=”hidden” name=”sid” value=”XXXXXX” />
<input type=”hidden” name=”product_id” value=”10″ />
<input type=”text” name=”quantity” size=”5″ value=”1″ />
<input type=”submit” name=”submit” value=”Buy from 2CO” />
</form>

** Notice that there are two opening tags ( <form> ) and two closing tags ( </form> ).

Another possibility, if you are using an HTML editor, is the editor may be adding extra numbers to the parameters, thinking each identical one is part of the same form, and not a separate form. Look at the parameters in the forms, and make sure there are not extra numbers added to it.
Incorrect Example:

<form action="https://www.2checkout.com/2co/buyer/purchase" method="post">
<input type="hidden" name="sid1" value="XXXXXX" />
<input type="hidden" name="product_id" value="10" />
<input type="text" name="quantity" size="5" value="1" />
<input type="submit" name="submit" value="Buy from 2CO" />
</form>

** Notice that the in second line from the name=”sid1″, this should always be name=”sid”

Can I have extra fields on the form?

Most of our Vendors that need extra details about the buyer usually have the buyer sent back to a form on their site after the sale. This way, the buyer could send all extra details directly to them.

Do you offer an API?

An API (Application Programming Interface) is used in many different contexts in this industry. To clear this up with our service, read below:

We offer a Common Gateway Interface (CGI). This means your site will need to contain an HTML form or link with cgi parameters appended that passes the correct parameters (and the customer) to our site for checkout. Passing in the Proper Parameters will result in the customer going through the rest of our checkout process (such as entering their credit card information), and after verification, a successful sale.

The following Knowledge Base articles provide more information about the specific parameter sets 2CO uses:

What are the parameters for the Plug n Play cart?

Does your system have it’s own parameters? If so, what are they?

Does your system support Authorize.net parameters? If so, what are they?

What are the New Cart Purchase Parameters? *Required if not using the plug-and-play cart parameter set*

Recent Posts from the Community:

calculation

posted by: everfresh

Reserve Release

posted by: vaisal
More from the community »

Spotlight Supplier

Spotlight Supplier

Vacation Rental Software

Spotlight Product

Spotlight Product

Visualizer Photo FX


Popular Tags