API_KEY = '9fb1d3774a34b2704a464d9cc2bd86db'
PASSWORD = 'a931fdeff8d1de0426695286910fecec'
SHOPNAME = 'gimmietest'
url = "https://#{API_KEY}:#{PASSWORD}@#{SHOPNAME}.myshopify.com/admin"
ShopifyAPI::Base.site = url
- Create new product
new_product = ShopifyAPI::Product.new new_product.title = "Burton Custom Freestlye 151" new_product.product_type = "Snowboard" new_product.vendor = "Burton" new_product.save
- Create new Order pending
order = { "line_items": [ { "title": "Red Leather Coat", "price": 129.99, "grams": "1700", "quantity": 1 }, { "title": "Blue Suede Shoes", "price": 85.95, "grams": "750", "quantity": 1, "taxable": false }, { "title": "Raspberry Beret", "price": 19.99, "grams": "320", "quantity": 2 } ], "tax_lines": [ { "price": 10.2, "rate": 0.06, "title": "State tax" }, { "price": 4.25, "rate": 0.025, "title": "County tax" } ], "total_tax": 14.45, "financial_status": "pending" } ShopifyAPI::Order.create(order)