Carriage is a Ruby wrapper to Amazon's Cart Form functionality

View the Project on GitHub skatkov/carriage

Gem Version Maintainability Build Status


Carriage project logo

Carriage is a Ruby wrapper to Amazon’s Cart Form functionality. Gem helps add any number of items to customer’s shopping cart and direct him to Amazon website to complete order.

To use this gem, you will eventually require Amazon’s AssociateTag, so consider to register first with Amazon Associate program and become more familiar with it.

Programmatic access to product data is out of scope for this gem, but I recommend to use vacuum gem if there is such a need.

Battle tested at aShop


Add this line to your application’s Gemfile:

gem 'carriage'

And then execute:

$ bundle install

Or install it yourself as:

$ gem install carriage


A lot of examples could be found in tests

There are basically two ways to use this gem bare metal and with builder. Let’s start off with baremetal:

Bare metal, {
  "OfferListingId.1": "B00WR23X5I", 
  "Quantity.1": 1 

The only thing it will validate, is a presence of locale. All other parameters will be converted by URI.encode_www_form without any verification. Be carefull!


Library also offers a simpler interface that tries to valide data with convinince methods on top.

items = [
 {Id: '123123'}.
 {ASIN: '1231234', quantity: 2}
], tag: 'my_attribution_tag', locale: :uk)


All locale are based on a two letter country codes - ISO 3166-1 alpha-2. Here is an exact mapping:

Getting help


Logo was done by Max Kazmin


The gem is available as open source under the terms of the MIT License.

Code of Conduct

Everyone interacting in the Carriage project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the code of conduct.