Image are not created with product

New Member
1 0 0

Hi everyone!

I'm trying to create a Product through the REST API version 2020-07.

I do a POST to the endpoint: 

https://{shop}.myshopify.com/admin/api/2020-07/products/{productId}.json

with the next payload:

{
    "product": {
        "title": "Cubrebocas Lavable Reusable Tapaboca Neopreno",
        "body_html": "Cubrebocas Lavable Reusable Tapaboca Neopreno\nCubrebocas de Neopreno\nLavable y Re utilizable, protector de bacterias y enfermedades.\nEMPACADO INDIVIDUALMENTE CON ETIQUETA\n\nFICHA TÉCNICA\nMáscara protectora , reutilizable y lavable , Diseño cómo y con ajuste reticular de manera cómoda y resistente a líquidos , hipoalergénico y antiestático.\n* SEGURO\n* REUTILIZABLES\n* LAVABLE\n* CÓMODO\n* TRASNPIRABLE\n* LIGERO\n* FRESCO\n\nAPLICACIONES:\nBarrera para el paso de fluidos corporales , reduce el riesgo de contagio al absorber partículas del aire.\n\nCOMPOSICIÓN:\n90.5% POLIESTER\n9.5 % ELASTANO\n\nTELA SUAVE QUE NO LASTIMA\nUNITALLA ADULTO\n\nSomo Mercado Lider Platino",
        "variants": [
            {
                "price": 35,
                "sku": "cubreneo1",
                "inventory_management": "shopify",
                "compare_at_price": null,
                "inventory_quantity": 50,
                "option1": "#000000"
            }
        ],
        "product_type": "Sin asignar",
        "tags": [
            "20 cm",
            "ZOE",
            "Neopreno",
            "15 cm",
            "Nuevo",
            "ZOE CUBREBOCAS",
            "NEOPRENO"
        ],
        "images": [
            {
                "position": 1,
                "src": "https://s3-us-west-2.amazonaws.com/elasticbeanstalk-us-west-2-168454723890/img/articles/920455-MLM42506688268_072020-O.jpg"
            },
            {
                "position": 2,
                "src": "https://s3-us-west-2.amazonaws.com/elasticbeanstalk-us-west-2-168454723890/img/articles/840315-MLM42506692160_072020-O.jpg"
            },
            {
                "position": 3,
                "src": "https://s3-us-west-2.amazonaws.com/elasticbeanstalk-us-west-2-168454723890/img/articles/813764-MLM42506669800_072020-O.jpg"
            },
            {
                "position": 4,
                "src": "https://s3-us-west-2.amazonaws.com/elasticbeanstalk-us-west-2-168454723890/img/articles/982031-MLM42506688276_072020-O.jpg"
            }
        ],
        "options": [
            {
                "name": "Color",
                "values": []
            }
        ]
    }
}

The product is created correctly but the images don't. In the Shopify response the images array comes null:

{
    "id": 4971135696982,
    "title": "Cubrebocas Lavable Reusable Tapaboca Neopreno",
    "body_html": "Cubrebocas Lavable Reusable Tapaboca Neopreno\nCubrebocas de Neopreno\nLavable y Re utilizable, protector de bacterias y enfermedades.\nEMPACADO INDIVIDUALMENTE CON ETIQUETA\n\nFICHA TÉCNICA\nMáscara protectora , reutilizable y lavable , Diseño cómo y con ajuste reticular de manera cómoda y resistente a líquidos , hipoalergénico y antiestático.\n* SEGURO\n* REUTILIZABLES\n* LAVABLE\n* CÓMODO\n* TRASNPIRABLE\n* LIGERO\n* FRESCO\n\nAPLICACIONES:\nBarrera para el paso de fluidos corporales , reduce el riesgo de contagio al absorber partículas del aire.\n\nCOMPOSICIÓN:\n90.5% POLIESTER\n9.5 % ELASTANO\n\nTELA SUAVE QUE NO LASTIMA\nUNITALLA ADULTO\n\nSomo Mercado Lider Platino",
    "vendor": "Zoe Store",
    "product_type": "Sin asignar",
    "created_at": "2020-11-24T14:58:36-06:00",
    "handle": "cubrebocas-lavable-reusable-tapaboca-neopreno-21",
    "updated_at": "2020-11-24T14:58:37-06:00",
    "published_at": "2020-11-24T14:58:36-06:00",
    "template_suffix": null,
    "published_scope": "web",
    "tags": "15 cm, 20 cm, Neopreno, Nuevo, ZOE, ZOE CUBREBOCAS",
    "admin_graphql_api_id": "gid://shopify/Product/4971135696982",
    "variants": [
        {
            "id": 33378386640982,
            "product_id": 4971135696982,
            "title": "#000000",
            "price": "35.00",
            "sku": "cubreneo1",
            "position": 1,
            "inventory_policy": "deny",
            "compare_at_price": null,
            "fulfillment_service": "manual",
            "inventory_management": "shopify",
            "option1": "#000000",
            "option2": null,
            "option3": null,
            "created_at": "2020-11-24T14:58:37-06:00",
            "updated_at": "2020-11-24T14:58:37-06:00",
            "taxable": true,
            "barcode": null,
            "grams": 0,
            "image_id": null,
            "weight": 0,
            "weight_unit": "kg",
            "inventory_item_id": 36307856064598,
            "inventory_quantity": 50,
            "old_inventory_quantity": 50,
            "requires_shipping": true,
            "admin_graphql_api_id": "gid://shopify/ProductVariant/33378386640982"
        }
    ],
    "options": [
        {
            "id": 6563922542678,
            "product_id": 4971135696982,
            "name": "Color",
            "position": 1,
            "values": [
                "#000000"
            ]
        }
    ],
    "images": [],
    "image": null
}

Can anybody help me with that?

Thanks!

Regards, 

Diego.

 

0 Likes