My favorites | English | Sign in

Google Checkout

Choosing Between HTML and XML API for Custom Carts

Google Checkout provides two ways to do an integration of Google Checkout with your custom cart: HTML API, which is simpler to program but less secure, and XML, which involves more programming but is more secure. Merchants overcome security issues in the HTML API by double-checking the purchased items before shipping and charging to ensure they have not been tampered with.

With the HTML API, the cart that you post to Google Checkout is an HTML form or HTTP request. With XML API, the cart you post is digitally signed XML. A main difference between the HTML and XML API is that the XML cart needs to be generated by server-side code, while the HTML API can either be plain static HTML or generated by Javascript (or written by server-side code).

Note: For a short description of custom shopping cart, see Quick Overview of Custom Cart.

HTML API

Features - HTML API enables merchants to send information to Google Checkout and receive information from Google Checkout using name/value pairs in HTML forms rather than XML. Merchants can also use the HTML API to submit name/value pairs via a server-to-server HTTP POST request. HTML API does not support Merchant Calculations API.

Technical skills required - The programmer responsible for integrating your website or shopping cart with Google Checkout via the API should have a strong working knowledge of:

  • HTML
  • Server-side code that can access items in the custom shopping cart and write out the required HTML. The computer language is dictated by what the rest of your website is written in, which could be PHP, Perl, Python, ASP, ASP.NET, Java or equivalent.

Recommendation - HTML implementations are particularly recommended for small merchants who do not want to invest the extra effort it takes to generate XML. Merchants cannot digitally sign carts in HTML implementations, so merchants who use this implementation and do not submit server-to-server requests should plan to review orders manually.

Next step: How to integrate Google Checkout with your custom shopping cart using the HTML API

XML API

Features - XML API enables merchants to access all Google Checkout features, including, most significantly, digitally signed carts. While the XML API requires more programming, it has client libraries and sample code to help you automatically generate and handle the posting of the XML for you.

Technical skills required: - More programming skill is required for an XML than an HTML integration. The programmer responsible for integrating your website or shopping cart with Google Checkout via the API should have a strong working knowledge of:

  • HTML and XML
  • Server-side code that can access items in the custom shopping cart and write out the required XML. This requires encoding and signing the cart. Checkout provides client libraries and sample code which make it easier to build the XML for the cart post, encode and sign the cart, build the infrastructure for posting carts and receiving notifications, perform merchant calculations, and more. The computer language is dictated by what the rest of your website is written in, which could be PHP, Perl, Python, ASP, ASP.NET, Java or equivalent.

Recommendation - XML implementations are recommended for merchants who need to be able to digitally sign carts before sending them to Google. XML implementations are also recommended for merchants who want to offer merchant calculated coupons or discounts and for merchants who plan to integrate Google Checkout with their internal order processing and billing systems.

Next step: How to integrate Google Checkout with your custom shopping cart using the XML API