{"id":18817603,"url":"https://github.com/skatkov/carriage","last_synced_at":"2025-04-13T23:24:44.623Z","repository":{"id":62555142,"uuid":"240015478","full_name":"skatkov/carriage","owner":"skatkov","description":"Carriage is a Ruby wrapper to Amazon's Cart Form functionality","archived":false,"fork":false,"pushed_at":"2020-07-05T23:13:13.000Z","size":791,"stargazers_count":9,"open_issues_count":1,"forks_count":2,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-03-27T13:41:12.450Z","etag":null,"topics":["amazon","amazon-associates","amazon-cart","paapi5","product-advertising-api"],"latest_commit_sha":null,"homepage":"https://skatkov.github.io/carriage/","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/skatkov.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-02-12T13:09:10.000Z","updated_at":"2024-05-22T00:23:24.000Z","dependencies_parsed_at":"2022-11-03T05:15:51.027Z","dependency_job_id":null,"html_url":"https://github.com/skatkov/carriage","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skatkov%2Fcarriage","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skatkov%2Fcarriage/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skatkov%2Fcarriage/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skatkov%2Fcarriage/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/skatkov","download_url":"https://codeload.github.com/skatkov/carriage/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248795232,"owners_count":21162735,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["amazon","amazon-associates","amazon-cart","paapi5","product-advertising-api"],"created_at":"2024-11-08T00:12:13.665Z","updated_at":"2025-04-13T23:24:44.574Z","avatar_url":"https://github.com/skatkov.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Gem Version](https://badge.fury.io/rb/carriage.svg)](https://badge.fury.io/rb/carriage)\n[![Maintainability](https://api.codeclimate.com/v1/badges/79ddcbeb02fe9447cd0d/maintainability)](https://codeclimate.com/github/skatkov/carriage/maintainability)\n[![Build Status](https://travis-ci.org/skatkov/carriage.svg?branch=master)](https://travis-ci.org/skatkov/carriage)\n\n# Carriage\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"./vendor/logo.jpg\" alt=\"Carriage project logo\" width=\"400\"\u003e\n\u003c/p\u003e\n\nCarriage is a Ruby wrapper to [Amazon's Cart Form](https://webservices.amazon.com/paapi5/documentation/add-to-cart-form.html) functionality. Gem helps add any number of items to customer's shopping cart and direct him to Amazon website to complete order. \n\nTo use this gem, you will eventually require Amazon's **AssociateTag**, so consider to [register first](https://webservices.amazon.com/paapi5/documentation/register-for-pa-api.html) with Amazon Associate program and become more familiar with it.\n\nProgrammatic access to product data is out of scope for this gem, but I recommend to use [vacuum gem](https://github.com/hakanensari/vacuum) if there is such a need.\n\n[Battle tested at aShop](https://www.ashop.co/?utm_source=carriage-gem)\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n```ruby\ngem 'carriage'\n```\n\nAnd then execute:\n\n    $ bundle install\n\nOr install it yourself as:\n\n    $ gem install carriage\n\n## Usage\n\nA lot of examples could be found [in tests](https://github.com/skatkov/carriage/blob/master/test/carriage_test.rb)\n\nThere are basically two ways to use this gem `bare metal` and with `builder`. Let's start off with baremetal:\n\n### Bare metal\n```\nCarriage.call(:us, {\n  AssociateTag:'tag', \n  \"OfferListingId.1\": \"B00WR23X5I\", \n  \"Quantity.1\": 1 \n }\n)\n```\nThe 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!\n\n### Builder\nLibrary also offers a simpler interface that tries to valide data with convinince methods on top.\n\n```\nitems = [\n {Id: '123123'}.\n {ASIN: '1231234', quantity: 2}\n]\n\nCarriage.build(items, tag: 'my_attribution_tag', locale: :uk)\n```\n\n* Every item should be a hash, with `ASIN` or `ID` (short for `OfferListingId`) key provided. All keys are _case insensitive_.\n* By default quantity is 1, feel free to rewrite that. \n* `Carriage.build` also requires `:tag` attribute (short for `AssociateTag`)\n*  Defaults to `locale: :us`, if no other locale was provided.\n\n### Locale\nAll locale are based on a two letter country codes - **ISO 3166-1 alpha-2**. Here is an exact mapping:\n\nhttps://github.com/skatkov/carriage/blob/master/lib/carriage/locale.rb#L7-L23\n\n## Getting help\n\n* Ask specific questions about the API on the [Amazon forum](https://forums.aws.amazon.com/forum.jspa?forumID=9).\n* Report bugs and discuss potential features in [GitHub issues](https://github.com/skatkov/carriage/issues).\n\n## Credits\nLogo was done by [Max Kazmin](https://dribbble.com/maxpainter)\n\n## License\n\nThe gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).\n\n## Code of Conduct\n\nEveryone interacting in the Carriage project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/skatkov/carriage/blob/master/CODE_OF_CONDUCT.md).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fskatkov%2Fcarriage","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fskatkov%2Fcarriage","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fskatkov%2Fcarriage/lists"}