/ebayka

Manage Ebay products via API with Elixir

Primary LanguageElixir

Ebayka

Build Status

Overview

Ebayka is a small library which makes it a little easier to use the eBay Trading API with Elixir.

Getting Started

  1. Add this to the defp deps do list in your mix.exs file:
{:ebayka, "~> 0.2"}
  1. Also in mix.exs, add :ebayka and :xml_builder (for creating XML requests) to the :applications list in def application.

  2. 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 - USA
      level: 995, # API version
      gateway: Ebayka.Gateway # gateway for execute requests. By default: Ebayka.Gateway
  3. Prepare 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
  1. 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/ssnickolay/ebayka.