HomeGuidesAPI ReferenceChangelogDiscussions
HomeLog In
Guides

Add Product Images

🚧

只可上傳10MB以下的JPEG或PNG格式圖片

Can only upload JPEG or PNG with maximum 10MB.

Function

Add or replace product images to an existing product.
透過open API對現有商品進行新增或覆蓋圖片。

URL

POST <<api_domain>>/v1/products/:id/add_images

Request Parameters

ParameterValueDescriptionExample
id
*Required
StringProduct ID
欲新增圖片之商品ID
5d3594c276e7ec003b7021c0
urlsArrayUrls of the Images
新增圖片之url
-
Supports multiple urls
支援多個url在陣列中

Limitation:數量限制
Main Pictures 主商品圖片 - 12
Detail Pictures 更多商品圖片 - 20
ruby "urls":["http://i.imgur.com/4CV6QpV.jpg"]
image_typeStringImage Type
圖片種類
-
main - 主商品圖片

detail - 更多商品圖片

*Default: main
ruby "image_type": "main" "image_type": "detail"
is_replcaeBooleanWhether replacing the original images
是否取代原本數量
-
*Default: false
ruby "is_replace": true "is_replace": false

Request Example

{
    "urls": ["http://i.imgur.com/4CV6QpV.jpg","http://i.imgur.com/4CV6QpV.jpg"],
    "image_type": "main",
    "is_replcae": true
}

Response Example

Same with Get Product

{
    "id": "5d3594c276e7ec003b7021c0",
    "status": "active",
    "title_translations": {
        "en": "testing SL-8049",
        "zh-hant": "測試 SL-8049 round 2"
    },
    "price": {
        "cents": 3444,
        "currency_symbol": "NT$",
        "currency_iso": "TWD",
        "label": "NT$3,444",
        "dollars": 3444
    },
    "price_sale": {
        "cents": 689,
        "currency_symbol": "NT$",
        "currency_iso": "TWD",
        "label": "NT$689",
        "dollars": 689
    },
    "lowest_price": {
        "cents": 689,
        "currency_symbol": "NT$",
        "currency_iso": "TWD",
        "label": "NT$689",
        "dollars": 689
    },
    "hide_price": false,
    "same_price": true,
    "cost": {
        "cents": 609,
        "currency_symbol": "NT$",
        "currency_iso": "TWD",
        "label": "NT$609",
        "dollars": 609
    },
    "member_price": {
        "cents": 500,
        "currency_symbol": "NT$",
        "currency_iso": "TWD",
        "label": "NT$500",
        "dollars": 500
    },
    "is_preorder": false,
    "preorder_note_translations": {
        "en": "Shipping starts April 20th, 1971, preorder NOW!",
        "zh-hant": "1971/04/20 開始出貨, 立即訂購!"
    },
    "weight": 123.99,
    "quantity": 87,
    "unlimited_quantity": false,
    "medias": [
        {
            "images": {
                "original": {
                    "width": 580,
                    "height": 580,
                    "url": "https://img.shoplineapp.com/media/image_clips/5d47b4b8c9922900234d5527/original.jpg?1564980407"
                },
                "source": {
                    "width": 580,
                    "height": 580,
                    "url": "https://img.shoplineapp.com/media/image_clips/5d47b4b8c9922900234d5527/source.jpg?1564980407"
                },
                "thumb": {
                    "width": 200,
                    "height": 200,
                    "url": "https://img.shoplineapp.com/media/image_clips/5d47b4b8c9922900234d5527/thumb.jpg?1564980407"
                },
                "large": {
                    "width": 500,
                    "height": 500,
                    "url": "https://img.shoplineapp.com/media/image_clips/5d47b4b8c9922900234d5527/large.jpg?1564980407"
                },
                "xlarge": {
                    "width": 580,
                    "height": 580,
                    "url": "https://img.shoplineapp.com/media/image_clips/5d47b4b8c9922900234d5527/xlarge.jpg?1564980407"
                },
                "favicon_small": {
                    "width": 200,
                    "height": 200,
                    "url": "https://img.shoplineapp.com/media/image_clips/5d47b4b8c9922900234d5527/thumb.jpg?1564980407"
                },
                "favicon": {
                    "width": 200,
                    "height": 200,
                    "url": "https://img.shoplineapp.com/media/image_clips/5d47b4b8c9922900234d5527/thumb.jpg?1564980407"
                },
                "favicon_large": {
                    "width": 200,
                    "height": 200,
                    "url": "https://img.shoplineapp.com/media/image_clips/5d47b4b8c9922900234d5527/thumb.jpg?1564980407"
                },
                "transparent_thumb": {
                    "width": 200,
                    "height": 200,
                    "url": "https://img.shoplineapp.com/media/image_clips/5d47b4b8c9922900234d5527/thumb.jpg?1564980407"
                },
                "transparent_large": {
                    "width": 500,
                    "height": 500,
                    "url": "https://img.shoplineapp.com/media/image_clips/5d47b4b8c9922900234d5527/large.jpg?1564980407"
                },
                "transparent_xlarge": {
                    "width": 580,
                    "height": 580,
                    "url": "https://img.shoplineapp.com/media/image_clips/5d47b4b8c9922900234d5527/xlarge.jpg?1564980407"
                }
            },
            "_id": "5d47b4b8c9922900234d5527",
            "alt_translations": {}
        },
        {
            "images": {
                "original": {
                    "width": 580,
                    "height": 580,
                    "url": "https://img.shoplineapp.com/media/image_clips/5d47b4ba82c2a9001d56fd81/original.jpg?1564980409"
                },
                "source": {
                    "width": 580,
                    "height": 580,
                    "url": "https://img.shoplineapp.com/media/image_clips/5d47b4ba82c2a9001d56fd81/source.jpg?1564980409"
                },
                "thumb": {
                    "width": 200,
                    "height": 200,
                    "url": "https://img.shoplineapp.com/media/image_clips/5d47b4ba82c2a9001d56fd81/thumb.jpg?1564980409"
                },
                "large": {
                    "width": 500,
                    "height": 500,
                    "url": "https://img.shoplineapp.com/media/image_clips/5d47b4ba82c2a9001d56fd81/large.jpg?1564980409"
                },
                "xlarge": {
                    "width": 580,
                    "height": 580,
                    "url": "https://img.shoplineapp.com/media/image_clips/5d47b4ba82c2a9001d56fd81/xlarge.jpg?1564980409"
                },
                "favicon_small": {
                    "width": 200,
                    "height": 200,
                    "url": "https://img.shoplineapp.com/media/image_clips/5d47b4ba82c2a9001d56fd81/thumb.jpg?1564980409"
                },
                "favicon": {
                    "width": 200,
                    "height": 200,
                    "url": "https://img.shoplineapp.com/media/image_clips/5d47b4ba82c2a9001d56fd81/thumb.jpg?1564980409"
                },
                "favicon_large": {
                    "width": 200,
                    "height": 200,
                    "url": "https://img.shoplineapp.com/media/image_clips/5d47b4ba82c2a9001d56fd81/thumb.jpg?1564980409"
                },
                "transparent_thumb": {
                    "width": 200,
                    "height": 200,
                    "url": "https://img.shoplineapp.com/media/image_clips/5d47b4ba82c2a9001d56fd81/thumb.jpg?1564980409"
                },
                "transparent_large": {
                    "width": 500,
                    "height": 500,
                    "url": "https://img.shoplineapp.com/media/image_clips/5d47b4ba82c2a9001d56fd81/large.jpg?1564980409"
                },
                "transparent_xlarge": {
                    "width": 580,
                    "height": 580,
                    "url": "https://img.shoplineapp.com/media/image_clips/5d47b4ba82c2a9001d56fd81/xlarge.jpg?1564980409"
                }
            },
            "_id": "5d47b4ba82c2a9001d56fd81",
            "alt_translations": {}
        }
    ],
    "detail_medias": [],
    "category_ids": [
        "5be90603d1270b4032bed8b4"
    ],
    "sku": "sku_123345",
    "barcode": null,
    "field_titles": [
        {
            "key": "custom",
            "label": "Custom",
            "name_translations": {
                "en": "custom1 en",
                "zh-hant": "自訂 中文"
            }
        },
        {
            "key": "custom",
            "label": "Custom",
            "name_translations": {
                "en": "Custom",
                "zh-hant": "自訂"
            }
        }
    ],
    "variations": [
        {
            "id": "5d3594c2e95d2f000642e011",
            "fields_translations": {
                "en": [
                    "green",
                    "L1"
                ],
                "zh-hant": [
                    "綠",
                    "大1"
                ]
            },
            "price": {
                "cents": 999999999,
                "currency_symbol": "NT$",
                "currency_iso": "TWD",
                "label": "NT$999,999,999",
                "dollars": 999999999
            },
            "price_sale": {
                "cents": 689,
                "currency_symbol": "NT$",
                "currency_iso": "TWD",
                "label": "NT$689",
                "dollars": 689
            },
            "member_price": {
                "cents": 899,
                "currency_symbol": "NT$",
                "currency_iso": "TWD",
                "label": "NT$899",
                "dollars": 899
            },
            "quantity": 100,
            "unlimited_quantity": null,
            "media": {},
            "sku": "green_l1",
            "location_id": "LaB123",
            "variant_option_ids": [
                "5d3594c2622a56618082c99f",
                "5d3594c2622a56618082c9a0"
            ],
            "barcode": null
        },
        {
            "id": "5d3594c2e95d2f000642e012",
            "fields_translations": {
                "en": [
                    "green",
                    "S1"
                ],
                "zh-hant": [
                    "綠",
                    "小1"
                ]
            },
            "price": {
                "cents": 999999999,
                "currency_symbol": "NT$",
                "currency_iso": "TWD",
                "label": "NT$999,999,999",
                "dollars": 999999999
            },
            "price_sale": {
                "cents": 689,
                "currency_symbol": "NT$",
                "currency_iso": "TWD",
                "label": "NT$689",
                "dollars": 689
            },
            "member_price": {
                "cents": 0,
                "currency_symbol": "NT$",
                "currency_iso": "TWD",
                "label": "",
                "dollars": 0
            },
            "quantity": 10,
            "unlimited_quantity": null,
            "media": {},
            "sku": "green_s1",
            "location_id": null,
            "variant_option_ids": [
                "5d3594c2622a56618082c99f",
                "5d3594c2622a56618082c9a1"
            ],
            "barcode": null
        },
        {
            "id": "5d3594c2e95d2f000642e013",
            "fields_translations": {
                "en": [
                    "Red",
                    "L1"
                ],
                "zh-hant": [
                    "紅",
                    "大1"
                ]
            },
            "price": {
                "cents": 999999999,
                "currency_symbol": "NT$",
                "currency_iso": "TWD",
                "label": "NT$999,999,999",
                "dollars": 999999999
            },
            "price_sale": {
                "cents": 689,
                "currency_symbol": "NT$",
                "currency_iso": "TWD",
                "label": "NT$689",
                "dollars": 689
            },
            "member_price": {
                "cents": 0,
                "currency_symbol": "NT$",
                "currency_iso": "TWD",
                "label": "",
                "dollars": 0
            },
            "quantity": 10,
            "unlimited_quantity": null,
            "media": {},
            "sku": "red_l1",
            "location_id": null,
            "variant_option_ids": [
                "5d3594c2622a56618082c9a2",
                "5d3594c2622a56618082c9a0"
            ],
            "barcode": null
        },
        {
            "id": "5d3594c2e95d2f000642e014",
            "fields_translations": {
                "en": [
                    "Red",
                    "S1"
                ],
                "zh-hant": [
                    "紅",
                    "小1"
                ]
            },
            "price": {
                "cents": 0,
                "currency_symbol": "NT$",
                "currency_iso": "TWD",
                "label": "",
                "dollars": 0
            },
            "price_sale": {
                "cents": 689,
                "currency_symbol": "NT$",
                "currency_iso": "TWD",
                "label": "NT$689",
                "dollars": 689
            },
            "member_price": {
                "cents": 0,
                "currency_symbol": "NT$",
                "currency_iso": "TWD",
                "label": "",
                "dollars": 0
            },
            "quantity": 10,
            "unlimited_quantity": null,
            "media": {},
            "sku": "red_s1",
            "location_id": null,
            "variant_option_ids": [
                "5d3594c2622a56618082c9a2",
                "5d3594c2622a56618082c9a1"
            ],
            "barcode": null
        }
    ],
    "variant_options": [
        {
            "id": "5d3594c2622a56618082c99f",
            "name_translations": {
                "en": "green",
                "zh-hant": "綠"
            },
            "type": "custom",
            "media": {},
            "index": 0
        },
        {
            "id": "5d3594c2622a56618082c9a0",
            "name_translations": {
                "en": "L1",
                "zh-hant": "大1"
            },
            "type": "custom",
            "media": {},
            "index": 1
        },
        {
            "id": "5d3594c2622a56618082c9a1",
            "name_translations": {
                "en": "S1",
                "zh-hant": "小1"
            },
            "type": "custom",
            "media": {},
            "index": 1
        },
        {
            "id": "5d3594c2622a56618082c9a2",
            "name_translations": {
                "en": "Red",
                "zh-hant": "紅"
            },
            "type": "custom",
            "media": {},
            "index": 0
        }
    ],
    "categories": [
        {
            "id": "5be90603d1270b4032bed8b4",
            "name_translations": {
                "en": "Featured Products",
                "zh-hant": "精選商品"
            },
            "seo_title_translations": {},
            "seo_description_translations": {},
            "seo_keywords": null,
            "key": "featured_products",
            "status": "active",
            "banner_medias": [],
            "parent_id": null,
            "priority": 1,
            "children": [
                {
                    "id": "5c8a1722b3c511002051da64",
                    "name_translations": {
                        "en": "測試prod",
                        "zh-hant": "測試prod"
                    },
                    "seo_title_translations": {
                        "en": "22222",
                        "zh-hant": "SEO優化 change"
                    },
                    "seo_description_translations": {
                        "en": "SEO description11",
                        "zh-hant": "SEO 內文2"
                    },
                    "seo_keywords": "關鍵字修改222",
                    "key": null,
                    "status": "active",
                    "banner_medias": [],
                    "parent_id": "5be90603d1270b4032bed8b4",
                    "priority": 2,
                    "children": [
                        {
                            "id": "5c8a184190207b003e650034",
                            "name_translations": {
                                "en": "測試2"
                            },
                            "seo_title_translations": {
                                "en": "Seasonal sale",
                                "zh-hant": "測試"
                            },
                            "seo_description_translations": {
                                "en": "Winter clothes- inventory clearance of clothes, shoes, boots, purses and other seasonal items.",
                                "zh-hant": "冬季清倉特賣"
                            },
                            "seo_keywords": "特賣, 冬季",
                            "key": null,
                            "status": "active",
                            "banner_medias": [],
                            "parent_id": "5c8a1722b3c511002051da64",
                            "priority": 3
                        }
                    ]
                }
            ]
        }
    ],
    "location_id": "shoplineabc",
    "description_translations": {
        "en": "No transaction fees. No design or technical skills required. Integrated with multiple payment and logistic options. With over 120,000 merchants online. Everything you need for your e-commerce store.",
        "zh-hant": "我們是一家以產品設計為主導的公司, 旨在打造款式簡潔時尚且關注社會大眾需求的產品。 公司聚集了一批來自哈佛大學設計學院 以及麻省理工商學院的優秀設計團隊。 我們致力於設計獨特新穎的創新產品, 適合不同年齡,性別人士使用。 在執著追求產品優化同時,注重履行企業社會責任。"
    },
    "seo_title_translations": {
        "en": "SHOPLINE",
        "zh-hant": "商線科技"
    },
    "seo_description_translations": {
        "en": "No transaction fees. No design or technical skills required. Integrated with multiple payment and logistic options. With over 120,000 merchants online. Everything you need for your e-commerce store.",
        "zh-hant": "我們是一家以產品設計為主導的公司, 旨在打造款式簡潔時尚且關注社會大眾需求的產品。 公司聚集了一批來自哈佛大學設計學院 以及麻省理工商學院的優秀設計團隊。 我們致力於設計獨特新穎的創新產品, 適合不同年齡,性別人士使用。 在執著追求產品優化同時,注重履行企業社會責任。"
    },
    "seo_keywords": "電商, 開店, 創業",
    "is_reminder_active": true,
    "show_custom_related_products": false,
    "related_product_ids": [
        "5d3593cd5722660032e8fbed",
        "5d355b7b0e5da9001741ac2c",
        "5d2fec200c3806061516b222",
        "5cfe2ff0b92d2000327495c5"
    ],
    "tags": [
        "shopline",
        "123",
        "abc"
    ],
    "blacklisted_delivery_option_ids": [],
    "blacklisted_payment_ids": [],
    "max_order_quantity": 4,
    "out_of_stock_orderable": false,
    "subscription_enabled": false,
    "subscription_period_duration": 30,
    "filter_tags": []
}