- Customers
- Customer Address
- Retrieves a list of addresses for a customer
- Creates a new address for a customer
- Retrieves details for a single customer address
- Updates an existing customer address
- Removes an address from a customer’s address list
- Performs bulk operations for multiple customer addresses
- Sets the default address for a customer
- CustomerSavedSearch
- Customer
- Retrieves a list of customers
- Creates a customer
- Searches for customers that match a supplied query
- Retrieves a single customer
- Updates a customer
- Deletes a customer
- Creates an account activation URL for a customer
- Sends an account invite to a customer
- Retrieves a count of customers
- Retrieves all orders that belong to a customer
- Sales channels
- Checkout
- CollectionListing
- Retrieve collection listings that are published to your app
- Retrieve product_ids that are published to a collection_id
- Retrieve a specific collection listing that is published to your app
- Create a collection listing to publish a collection to your app
- Delete a collection listing to unpublish a collection from your app
- Product ResourceFeedback
- MobilePlatformApplication
- ProductListing
- Retrieve product listings that are published to your app
- Retrieve product_ids that are published to your app
- Retrieve a count of products that are published to your app
- Retrieve a specific product listing that is published to your app
- Create a product listing to publish a product to your app
- Delete a product listing to unpublish a product from your app
- ResourceFeedback
- Payment
- Products
- Collect
- Collection
- CustomCollection
- Product
- Product Image
- Product Variant
- SmartCollection
- Orders
- Abandoned checkouts
- DraftOrder
- Order Risk
- Transaction
- Order
- Refund
- Access
- Billing
- Online store
- Asset
- Blog
- Article
- Retrieves a list of all articles from a blog
- Creates an article for a blog
- Retrieves a count of all articles from a blog
- Receive a single Article
- Updates an article
- Deletes an article
- Retrieves a list of all article authors
- Retrieves a list of all article tags
- Retrieves a list of all article tags from a specific blog
- Redirect
- Comment
- ScriptTag
- Page
- Theme
- Shipping and fulfillment
- CancellationRequest
- CarrierService
- AssignedFulfillmentOrder
- FulfillmentEvent
- Fulfillment
- Retrieves fulfillments associated with an order
- Retrieves fulfillments associated with a fulfillment order
- Retrieves a count of fulfillments associated with a specific order
- Receive a single Fulfillment
- Creates a fulfillment for one or many fulfillment orders
- Updates the tracking information for a fulfillment
- Cancels a fulfillment
- FulfillmentOrder
- Retrieves a list of fulfillment orders for a specific order
- Retrieves a specific fulfillment order
- Cancel a fulfillment order
- Marks a fulfillment order as incomplete
- Moves a fulfillment order to a new location
- Marks the fulfillment order as open
- Reschedules the fulfill_at time of a scheduled fulfillment order
- Applies a fulfillment hold on an open fulfillment order
- Sets deadline for fulfillment orders
- Releases the fulfillment hold on a fulfillment order
- LocationsForMove
- FulfillmentRequest
- FulfillmentService
- Shopify Payments
- Analytics
- Deprecated API calls
- Discounts
- DiscountCode
- Creates a discount code
- Retrieves a list of discount codes
- Updates an existing discount code
- Retrieves a single discount code
- Deletes a discount code
- Retrieves the location of a discount code
- Retrieves a count of discount codes for a shop
- Creates a discount code creation job
- Retrieves a discount code creation job
- Retrieves a list of discount codes for a discount code creation job
- PriceRule
- DiscountCode
- Inventory
- Events
- MarketingEvent
- Metafield
- Plus
- Store properties
- TenderTransaction
Updates a product
PUT
/admin/api/{api_version}/products/{product_id}.json
请求参数
Path 参数
api_version
string
必需
product_id
string
必需
示例代码
Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
请求示例请求示例
Shell
JavaScript
Java
Swift
curl --location --request PUT 'https://demo.myshopify.com//admin/api//products/.json'
返回响应
🟢200Updates a product
application/json
Body
product
object (Product)
可选
body_html
string
可选
created_at
string <ISO_8601>
只读可选
handle
string
可选
title
. Used by the Liquid templating language to refer to objects.id
string <int64>
只读可选
id
is unique across the Shopify system. No two products will have the same id
, even if they're from different shops.images
string
可选
示例值:
{"id":850703190,"product_id":632910392,"position":1,"created_at":"2018-01-08T12:34:47-05:00","updated_at":"2018-01-08T12:34:47-05:00","width":110,"height":140,"src":"http://example.com/burton.jpg","variant_ids":[{}]}
options
string
可选
product_type
string
可选
published_at
string <ISO_8601>
可选
published. Can be set to
null
to unpublish the product from the Online Store channel.published_scope
string
可选
web
: The product isn't published to the Point of Sale channel.global
: The product is published to the Point of Sale channel.
status
string
可选
active
: The product is ready to sell and is available to customers on the online store, sales channels, and apps. By default, existing products are set to active.archived
: The product is no longer being sold and isn't available to customers on sales channels and apps.draft
: The product isn't ready to sell and is unavailable to customers on sales channels and apps. By default, duplicated and unarchived products are set to draft.
tags
string
可选
A product can have up to 250 tags. Each tag can have up to 255 characters.
template_suffix
string
可选
""
or null
, then the product page uses the default template "product.liquid". (default: null
)title
string
必需
updated_at
string <ISO_8601>
只读可选
A product's
updated_at
value can change for different reasons. For example, if an order is placed for a product thathas inventory tracking set up, then the inventory adjustment is counted as an update.
variants
string
可选
position
property is read-only. The position of variants is indicated by the order in which they are listed.示例值:
{"barcode":"1234_pink","compare_at_price":null,"created_at":"2012-08-24T14:01:47-04:00","fulfillment_service":"manual","grams":567,"weight":0.2,"weight_unit":"kg","id":808950810,"inventory_item_id":341629,"inventory_management":"shopify","inventory_policy":"continue","inventory_quantity":10,"option1":"Pink","position":1,"price":199.99,"product_id":632910392,"requires_shipping":true,"sku":"IPOD2008PINK","taxable":true,"title":"Pink","updated_at":"2012-08-24T14:01:47-04:00"}
vendor
string
可选
示例
{
"product": {
"id": 632910392,
"title": "IPod Nano - 8GB",
"body_html": "<p>It's the small iPod with one very big idea: Video. Now the world's most popular music player, available in 4GB and 8GB models, lets you enjoy TV shows, movies, video podcasts, and more. The larger, brighter display means amazing picture quality. In six eye-catching colors, iPod nano is stunning all around. And with models starting at just $149, little speaks volumes.</p>",
"vendor": "Apple",
"product_type": "Cult Products",
"created_at": "2023-01-03T12:56:35-05:00",
"handle": "ipod-nano",
"updated_at": "2023-01-03T12:59:19-05:00",
"published_at": "2007-12-31T19:00:00-05:00",
"template_suffix": null,
"status": "active",
"published_scope": "web",
"tags": "Emotive, Flash Memory, MP3, Music",
"admin_graphql_api_id": "gid://shopify/Product/632910392",
"variants": [
{
"id": 808950810,
"product_id": 632910392,
"title": "Pink",
"price": "199.00",
"sku": "IPOD2008PINK",
"position": 1,
"inventory_policy": "continue",
"compare_at_price": null,
"fulfillment_service": "manual",
"inventory_management": "shopify",
"option1": "Pink",
"option2": null,
"option3": null,
"created_at": "2023-01-03T12:56:35-05:00",
"updated_at": "2023-01-03T12:56:35-05:00",
"taxable": true,
"barcode": "1234_pink",
"grams": 567,
"image_id": 562641783,
"weight": 1.25,
"weight_unit": "lb",
"inventory_item_id": 808950810,
"inventory_quantity": 10,
"old_inventory_quantity": 10,
"presentment_prices": [
{
"price": {
"amount": "199.00",
"currency_code": "USD"
},
"compare_at_price": null
}
],
"requires_shipping": true,
"admin_graphql_api_id": "gid://shopify/ProductVariant/808950810"
},
{
"id": 49148385,
"product_id": 632910392,
"title": "Red",
"price": "199.00",
"sku": "IPOD2008RED",
"position": 2,
"inventory_policy": "continue",
"compare_at_price": null,
"fulfillment_service": "manual",
"inventory_management": "shopify",
"option1": "Red",
"option2": null,
"option3": null,
"created_at": "2023-01-03T12:56:35-05:00",
"updated_at": "2023-01-03T12:56:35-05:00",
"taxable": true,
"barcode": "1234_red",
"grams": 567,
"image_id": null,
"weight": 1.25,
"weight_unit": "lb",
"inventory_item_id": 49148385,
"inventory_quantity": 20,
"old_inventory_quantity": 20,
"presentment_prices": [
{
"price": {
"amount": "199.00",
"currency_code": "USD"
},
"compare_at_price": null
}
],
"requires_shipping": true,
"admin_graphql_api_id": "gid://shopify/ProductVariant/49148385"
},
{
"id": 39072856,
"product_id": 632910392,
"title": "Green",
"price": "199.00",
"sku": "IPOD2008GREEN",
"position": 3,
"inventory_policy": "continue",
"compare_at_price": null,
"fulfillment_service": "manual",
"inventory_management": "shopify",
"option1": "Green",
"option2": null,
"option3": null,
"created_at": "2023-01-03T12:56:35-05:00",
"updated_at": "2023-01-03T12:56:35-05:00",
"taxable": true,
"barcode": "1234_green",
"grams": 567,
"image_id": null,
"weight": 1.25,
"weight_unit": "lb",
"inventory_item_id": 39072856,
"inventory_quantity": 30,
"old_inventory_quantity": 30,
"presentment_prices": [
{
"price": {
"amount": "199.00",
"currency_code": "USD"
},
"compare_at_price": null
}
],
"requires_shipping": true,
"admin_graphql_api_id": "gid://shopify/ProductVariant/39072856"
},
{
"id": 457924702,
"product_id": 632910392,
"title": "Black",
"price": "199.00",
"sku": "IPOD2008BLACK",
"position": 4,
"inventory_policy": "continue",
"compare_at_price": null,
"fulfillment_service": "manual",
"inventory_management": "shopify",
"option1": "Black",
"option2": null,
"option3": null,
"created_at": "2023-01-03T12:56:35-05:00",
"updated_at": "2023-01-03T12:56:35-05:00",
"taxable": true,
"barcode": "1234_black",
"grams": 567,
"image_id": null,
"weight": 1.25,
"weight_unit": "lb",
"inventory_item_id": 457924702,
"inventory_quantity": 40,
"old_inventory_quantity": 40,
"presentment_prices": [
{
"price": {
"amount": "199.00",
"currency_code": "USD"
},
"compare_at_price": null
}
],
"requires_shipping": true,
"admin_graphql_api_id": "gid://shopify/ProductVariant/457924702"
}
],
"options": [
{
"id": 594680422,
"product_id": 632910392,
"name": "Color",
"position": 1,
"values": [
"Pink",
"Red",
"Green",
"Black"
]
}
],
"images": [
{
"id": 850703190,
"product_id": 632910392,
"position": 1,
"created_at": "2023-01-03T12:56:35-05:00",
"updated_at": "2023-01-03T12:56:35-05:00",
"alt": null,
"width": 123,
"height": 456,
"src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672768595",
"variant_ids": [],
"admin_graphql_api_id": "gid://shopify/ProductImage/850703190"
},
{
"id": 562641783,
"product_id": 632910392,
"position": 2,
"created_at": "2023-01-03T12:56:35-05:00",
"updated_at": "2023-01-03T12:56:35-05:00",
"alt": null,
"width": 123,
"height": 456,
"src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano-2.png?v=1672768595",
"variant_ids": [
808950810
],
"admin_graphql_api_id": "gid://shopify/ProductImage/562641783"
},
{
"id": 378407906,
"product_id": 632910392,
"position": 3,
"created_at": "2023-01-03T12:56:35-05:00",
"updated_at": "2023-01-03T12:56:35-05:00",
"alt": null,
"width": 123,
"height": 456,
"src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672768595",
"variant_ids": [],
"admin_graphql_api_id": "gid://shopify/ProductImage/378407906"
}
],
"image": {
"id": 850703190,
"product_id": 632910392,
"position": 1,
"created_at": "2023-01-03T12:56:35-05:00",
"updated_at": "2023-01-03T12:56:35-05:00",
"alt": null,
"width": 123,
"height": 456,
"src": "https://cdn.shopify.com/s/files/1/0005/4838/0009/products/ipod-nano.png?v=1672768595",
"variant_ids": [],
"admin_graphql_api_id": "gid://shopify/ProductImage/850703190"
}
}
}
修改于 2023-01-29 12:00:34