- 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
Receive a single Product Variant
GET
/admin/api/{api_version}/variants/{variant_id}.json
请求参数
Path 参数
api_version
string
必需
variant_id
string
必需
Query 参数
fields
string
可选
示例代码
Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
请求示例请求示例
Shell
JavaScript
Java
Swift
curl --location --request GET 'https://demo.myshopify.com//admin/api//variants/.json'
返回响应
🟢200Receive a single Product Variant
application/json
Body
variant
object (Product Variant)
可选
barcode
string
可选
compare_at_price
string
可选
created_at
string
可选
fulfillment_service
string
可选
manual
or the handle of afulfillment service.
Multi-managed inventory introduced a breaking change to this field.
Fulfillment services will all be opted into SKU sharing in 2023-04.
This field is due to be deprecated and will no longer be supported.
Please refer to InventoryLevel to see how variants are associated to multiple fulfillment services.
grams
string
可选
id
string
可选
image_id
string
可选
The image must be associated to the same product as the variant.
inventory_item_id
string
可选
inventory_management
string
可选
Valid values:
shopify
: You are tracking inventory yourself using the admin.null
: You aren't tracking inventory on the variant.- the handle of a fulfillment service that has inventory management enabled: This must be the same fulfillment service referenced by the
fulfillment_service
property.
inventory_policy
string
可选
Whether customers are allowed to place an order for the product variant when it's out of stock. Valid values:
deny
: Customers are not allowed to place orders for the product variant if it's out of stock.continue
: Customers are allowed to place orders for the product variant if it's out of stock.
deny
.inventory_quantity
string
只读可选
InventoryLevel resource.
old_inventory_quantity
string
已废弃
InventoryLevel resource instead.
inventory_quantity_adjustment
string
已废弃
InventoryLevel resource instead.
option
string
可选
You can define three options for a product variant:
option1
, option2
, option3
.Default value:
Default Title
.The
title
field is a concatenation of the option1
, option2
, andoption3
fields. Updating the option
fields updates the title
field.presentment_prices
string
只读可选
currency_code
: The three-letter code (ISO 4217 format) for one of the shop's enabled presentment currencies.amount
: The variant's price or compare-at price in the presentment currency.
'X-Shopify-Api-Features': 'include-presentment-prices'
.position
string
只读可选
The first position in the list is
1
.The position of variants is indicated by the order in which they are listed.
price
string
可选
product_id
string
可选
requires_shipping
string
已废弃
requires_shipping
property on the InventoryItem resource instead.sku
string
可选
taxable
string
可选
tax_code
string
可选
title
string
只读可选
title
field is a concatenation of the option1
, option2
, and option3
fields. You can only update title
indirectly using the option
fields.updated_at
string
可选
Gets returned in ISO 8601 format.
weight
string
可选
weight_unit
.weight_unit
string
可选
If you don't specify a value for
weight_unit
, then the shop's default unit of measurement is applied.Valid values:
g
, kg
, oz
, and lb
.示例
{
"variant": {
"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:21:36-05:00",
"updated_at": "2023-01-03T12:21:36-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
}
],
"tax_code": "DA040000",
"requires_shipping": true,
"admin_graphql_api_id": "gid://shopify/ProductVariant/808950810"
}
}
修改于 2023-01-29 12:00:34