Ebayka
Overview
Ebayka is a small library which makes it a little easier to use the eBay Trading API with Elixir.
Getting Started
- Add this to the
defp deps dolist in your mix.exs file:
{:ebayka, "~> 0.2"}
Also in mix.exs, add
:ebaykaand:xml_builder(for creating XML requests) to the:applicationslist indef application.In config/dev.exs, configure
ebayka:config :ebayka, Ebayka,sandbox: true,app_id: "your Ebay app ID",dev_id: "your Ebay dev ID",cert_id: "your Ebay cert ID",auth_token: "your Ebay auth token",site_id: 0, # Your site id, 0 - USAlevel: 995, # API versiongateway: Ebayka.Gateway # gateway for execute requests. By default: Ebayka.GatewayPrepare Ebay request (full example you can see in /examples directory):
defmodule ReviseItemRequest do
import XmlBuilder
defp build(product) do
[
element(:Title, product.title),
element(:Description, product.description),
element(:PrimaryCategory, [ element(:CategoryID, product.category_id) ]),
element(:StartPrice, product.price),
...
element(:Site, "US")
]
end
end
- Make the request:
Ebayka.Request.make("VerifyAddItem", ReviseItemRequest.build(product))
# .. XML RESPONSE ..
Check out /examples directory as a quick intro.
Contributing
If you feel like porting or fixing something, please drop a pull request or issue tracker at GitHub! Check out the CONTRIBUTING.md for more details.
License
Ebayka source code is released under Apache 2 License.
Check LICENSE and NOTICE files for more details. The project HEAD is https://github.com/GaussGroup/ebayka.