No commit activity in last 3 years
No release in over 3 years
Aliexpress SDK for ruby
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.17
~> 10.0
~> 3.0

Runtime

~> 4.0
 Project Readme

AliexpressAPI

Aliexpress SDK for Ruby. 了解更多信息请访问 Aliexpress API 文档.

安装

添加 aliexpress-ruby-sdk 到你的 Gemfile:

gem 'aliexpress-ruby-sdk'

或通过gem安装 gem install aliexpress-ruby-sdk

require 'aliexpress_api'

Usage

1) 设置 App key 和 App secret

在 Rails initializer 中创建文件:config/initializers/omniauth.rb, 并加入以下代码

AliexpressAPI.configure do |config|
  config.app_key = "your App key"
  config.app_secret = "your App secret"

  # eg: config.service_endpoint = https://eco.taobao.com/router/rest
  config.service_endpoint = "SERVICE_ENDPOINT"
end

2) 向 Aliexpress 发送请求

调用 API 之前必须先激活 session:

# 成功授权后拿到的 token
AliexpressAPI::Base.activate_session "token"

调用 API

# 创建订单
AliexpressAPI::DsOrder.create!(
    logistics_address: {
      address: "china"
    },
    product_items: {
      product_count: 1,
      product_id: "4000518642376",
      sku_attr: "N",
      logistics_service_name: "EMS"
    }
)

# 获取订单信息
AliexpressAPI::DsOrder.find(300518642)

# 获取物流信息
AliexpressAPI::DsLogistic.tracking_info(
  logistics_no: "330211",
  out_ref: "300518642",
  service_name: "EMS",
  to_area: "US"
) 

3) API List

  • 功能实现
  • 功能未实现

-> Dropshipping

  • Dropshipping get product info
  • Dropshipping place order
  • Dropshipping obtain shipping info
  • Dropshipping get order info
  • Query simple information of product for dropshipper
  • Dropshipping get tracking info
  • Dropshipping sync sales data

-> other

  • all

License

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