MONEI / Shopify-api-node

Node Shopify connector sponsored by MONEI
https://monei.com/shopify-payment-gateway/
MIT License
946 stars 278 forks source link

Create product with one image (some times work incorrectly) #498

Closed adrianflda closed 3 years ago

adrianflda commented 3 years ago

Environment:

shopify-api-node: "^3.6.14" node: 14 apiVersion: /admin/api/2021-07

Code:

shopifyClient.product.create(product)

Product:

{
    "variants": [
        {
            "inventory_quantity": 2,
            "inventory_management": "shopify",
            "fulfillment_service": "manual",
            "price": "69.99",
            "erpId": 420,
            "option1": "3.25 - 4.25\"",
            "option2": 1,
            "sku": "XYZ"
        }
    ],
    "published_scope": "web",
    "status": "active",
    "vendor": "Quality Marine",
    "body_html": "Tusk, Harlequin :: Eastern Asia",
    "product_type": "Fish",
    "images": [
        {
            "src": "http://nas02.qualitymarine.com/pictures/ItemsLarge/1335437.jpg"
        }
    ],
    "options": [
        {
            "name": "Dimension",
            "values": [
                "3.25 - 4.25\""
            ]
        },
        {
            "name": "Lot",
            "values": [
                1
            ]
        }
    ],
    "tags": "Wrasses, Choerodon, Eastern Asia, Wild",
    "title": "Choerodon fasciatus"
}

Shopify response:

{
        "id": 6709872984272,
        "title": "Choerodon fasciatus",
        "body_html": "Tusk, Harlequin :: Eastern Asia",
        "vendor": "Quality Marine",
        "product_type": "Fish",
        "created_at": "2021-07-30T23:15:38-04:00",
        "handle": "choerodon-fasciatus",
        "updated_at": "2021-07-30T23:15:38-04:00",
        "published_at": "2021-07-30T23:15:38-04:00",
        "template_suffix": "fd",
        "status": "active",
        "published_scope": "web",
        "tags": "Choerodon, Eastern Asia, Wild, Wrasses",
        "admin_graphql_api_id": "gid://shopify/Product/6709872984272",
        "variants": [
            {
                "id": 39979032576208,
                "product_id": 6709872984272,
                "title": "3.25 - 4.25\" / 1",
                "price": "69.99",
                "sku": "XYZ",
                "position": 1,
                "inventory_policy": "deny",
                "compare_at_price": null,
                "fulfillment_service": "manual",
                "inventory_management": "shopify",
                "option1": "3.25 - 4.25\"",
                "option2": "1",
                "option3": null,
                "created_at": "2021-07-30T23:15:38-04:00",
                "updated_at": "2021-07-30T23:15:38-04:00",
                "taxable": true,
                "barcode": null,
                "grams": 0,
                "image_id": null,
                "weight": 0,
                "weight_unit": "lb",
                "inventory_item_id": 42073152454864,
                "inventory_quantity": 2,
                "old_inventory_quantity": 2,
                "requires_shipping": true,
                "admin_graphql_api_id": "gid://shopify/ProductVariant/39979032576208"
            }
        ],
        "options": [
            {
                "id": 8615822983376,
                "product_id": 6709872984272,
                "name": "Dimension",
                "position": 1,
                "values": [
                    "3.25 - 4.25\""
                ]
            },
            {
                "id": 8615823016144,
                "product_id": 6709872984272,
                "name": "Lot",
                "position": 2,
                "values": [
                    "1"
                ]
            }
        ],
        "images": [],
        "image": null
    }

Questions

Thanks

lpinca commented 3 years ago

I don't know and this is not caused by a bug in this library as you get a proper HTTP response. Try to ask this in the Shopify forum.

raghav17083 commented 1 year ago

@adrianflda was this resolved? I am facing the same issue