Shopify have a RESTful API and a handy shopify_api ruby gem that I already use for updating inventory levels.
Today I have to do something new, creating a new product with image, and I'd like to use the shopify_api gem instead of using something like rest-client or httparty to interact with the API.
The Shopify API supports the simultanious creation of a new product with the default variant and a product image which will be downloaded by Shopify using this call:
POST /admin/products.json
With a JSON request string of:
{
"product": {
"title": "Burton Custom Freestlye 151",
"body_html": "<strong>Good snowboard!</strong>",
"vendor": "Burton",
"product_type": "Snowboard",
"images": [
{
"src": "http://example.com/rails_logo.gif"
}
]
}
}
The question is how do I do this using the shopify_api gem?
Cheers,
Marcus