Shopify/omniauth-shopify-oauth2

Some question about create product api

slince opened this issue · 1 comments

Hi

I'm developing a shopify app and I request api with parameters like this:

[
    'title' => 'Red Square Neck Rayon Woman's Party Dress',
    'sku' => '1414829809',
    'body_html' => 'Red Square Neck Rayon Woman's Party Dress',
    'vendor' => '自营品牌',
    'product_type' => '其他产品',
    'image' => 'http://slshop.qimuyu.com/files/images/2016/goods/test/Party---Occasions/Red-Square-Neck-Rayon-Womans-Party-Dress-191862-2262485.jpg',
    'images' => [
        (int) 0 => [
            'src' => 'http://slshop.qimuyu.com/files/images/2016/goods/test/Party---Occasions/Red-Square-Neck-Rayon-Womans-Party-Dress-191862-2262485.jpg'
        ],
        (int) 1 => [
            'src' => 'http://slshop.qimuyu.com/files/images/2016/goods/test/Party---Occasions/Red-Square-Neck-Rayon-Womans-Party-Dress-191862-784024.jpg'
        ]
    ],
    'variants' => [
        (int) 0 => [
            'price' => (float) 112.79,
            'sku' => '1414829809-0',
            'option1' => 'Grey',
            'option2' => 'M'
        ],
        (int) 1 => [
            'price' => (float) 112.79,
            'sku' => '1414829809-1',
            'option1' => 'Grey',
            'option2' => 'L'
        ],
        (int) 2 => [
            'price' => (float) 112.79,
            'sku' => '1414829809-2',
            'option1' => 'Red',
            'option2' => 'XS'
        ],
        (int) 3 => [
            'price' => (float) 112.79,
            'sku' => '1414829809-3',
            'option1' => 'Black',
            'option2' => 'L'
        ]
    ]
]

Response like:

[
    'id' => (float) 7938748041,
    'title' => 'Red Square Neck Rayon Woman's Party Dress',
    'body_html' => 'Red Square Neck Rayon Woman's Party Dress',
    'vendor' => '自营品牌',
    'product_type' => '其他产品',
    'created_at' => '2016-09-29T05:58:19Z',
    'handle' => 'red-square-neck-rayon-womans-party-dress-1',
    'updated_at' => '2016-09-29T05:58:19Z',
    'published_at' => '2016-09-29T05:58:19Z',
    'template_suffix' => null,
    'published_scope' => 'global',
    'tags' => '',
    'variants' => [
        (int) 0 => [
            'id' => (float) 25563613193,
            'product_id' => (float) 7938748041,
            'title' => 'Default Title',
            'price' => '0.00',
            'sku' => '',
            'position' => (int) 1,
            'grams' => (int) 0,
            'inventory_policy' => 'deny',
            'compare_at_price' => null,
            'fulfillment_service' => 'manual',
            'inventory_management' => null,
            'option1' => 'Default Title',
            'option2' => null,
            'option3' => null,
            'created_at' => '2016-09-29T05:58:19Z',
            'updated_at' => '2016-09-29T05:58:19Z',
            'taxable' => true,
            'barcode' => null,
            'image_id' => null,
            'inventory_quantity' => (int) 1,
            'weight' => (float) 0,
            'weight_unit' => 'kg',
            'old_inventory_quantity' => (int) 1,
            'requires_shipping' => true
        ]
    ],
    'options' => [
        (int) 0 => [
            'id' => (float) 9505479881,
            'product_id' => (float) 7938748041,
            'name' => 'Title',
            'position' => (int) 1,
            'values' => [
                (int) 0 => 'Default Title'
            ]
        ]
    ],
    'images' => [],
    'image' => null
]

As you know, the product I created does not have price,image and variants. Any parameter are missing.
Look forward to your reply.

Tao

Hey Tao,

This repo should be reserved for issues specifically related to the omniauth-shopify-oauth2 gem. I would suggest directing this question to the Shopify API & Technologies forum.