- 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
- Inventory
- Events
- MarketingEvent
- Metafield
- Plus
- Store properties
- TenderTransaction
Retrieves a single price rule
GET
/admin/api/{api_version}/price_rules/{price_rule_id}.json
请求参数
Path 参数
api_version
string
必需
price_rule_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 GET 'https://demo.myshopify.com//admin/api//price_rules/.json'
返回响应
🟢200Retrieves a single price rule
application/json
Body
price_rule
object (PriceRule)
可选
allocation_method
string
可选
- each: The discount is applied to each of the entitled items. For example, for a price rule that takes 15off,eachentitledlineiteminacheckoutwillbediscountedby15.
- across: The calculated discount amount will be applied across the entitled items. For example, for a price rule
that takes $15 off, the discount will be applied across all the entitled items.
target_type
is shipping_line
, then this value must be each
.created_at
string
只读可选
updated_at
string
只读可选
customer_selection
enum<string>
可选
枚举值:
allprerequisite
ends_at
string
可选
starts_at
.entitled_collection_ids
string
可选
target_type
set to line_item
and target_selection
set to entitled
.It can't be used in combination with
entitled_product_ids
or entitled_variant_ids
.示例值:
45646548698979761006
entitled_country_ids
string
可选
target_type
set to shipping_line
and target_selection
set to entitled
.entitled_product_ids
string
可选
target_type
set to line_item
and
target_selection
set to entitled
.entitled_variant_ids
, then entitled_product_ids
can't include the ID of the product associated with that variant.示例值:
789739775542382368242
entitled_variant_ids
string
可选
target_type
set to line_item
and
target_selection
set to entitled
.entitled_product_ids
, then entitled_variant_ids
can't include the ID of any variants associated with that product.示例值:
67987987985675765905
id
string
只读可选
once_per_customer
string
可选
prerequisite_customer_ids
string
可选
prerequisite_customer_ids
is populated, then customer_segment_prerequisite_ids
must be empty.示例值:
3840283490053492039843
prerequisite_quantity_range
string
可选
- greater_than_or_equal_to: The quantity of an entitled cart item must be greater than or equal to this value.
customer_segment_prerequisite_ids
string
可选
customer_segment_prerequisite_ids
is populated, then prerequisite_customer_ids
must be empty.示例值:
112234543243535360314
prerequisite_shipping_price_range
string
可选
- less_than_or_equal_to: The shipping price must be less than or equal to this value.
prerequisite_subtotal_range
string
可选
- greater_than_or_equal_to: The subtotal of the entitled cart items must be greater than or equal to this value for the discount to apply.
prerequisite_to_entitlement_purchase
string
可选
- prerequisite_amount: The minimum purchase amount required to be entitled to the discount.
starts_at
string
可选
The date and time (ISO 8601 format) when the price rule starts.
target_selection
enum<string>
可选
枚举值:
allentitled
target_type
enum<string>
可选
枚举值:
line_itemshipping_line
title
string
可选
title
as the code
property of the associated discount code.usage_limit
string
可选
prerequisite_product_ids
string
可选
prerequisite_product_ids
can be used only with:target_type
set toline_item
,target_selection
set toentitled
,allocation_method
set toeach
andprerequisite_to_entitlement_quantity_ratio
defined.
Caution
prerequisite_variant_ids
, then prerequisite_product_ids
can't include the ID of the product associated with that variant.示例值:
789739775542382368242
prerequisite_variant_ids
string
可选
entitled_variant_ids
can be used only with:target_type
set toline_item
,target_selection
set toentitled
,allocation_method
set toeach
andprerequisite_to_entitlement_quantity_ratio
defined.
Caution
prerequisite_product_ids
, then prerequisite_variant_ids
can't include the ID of any variants associated with that product.示例值:
67987987985675765905
prerequisite_collection_ids
string
可选
List of collection ids that will be a prerequisites for a Buy X Get Y discount. The entitled_collection_ids
can be used only with:
target_type
set toline_item
,target_selection
set toentitled
,allocation_method
set toeach
andprerequisite_to_entitlement_quantity_ratio
defined.
prerequisite_product_ids
or prerequisite_variant_ids
.示例值:
45646548698979761006
value
string
可选
target_type
is shipping_line
, then only -100
is accepted.The value must be negative.
value_type
enum<string>
可选
枚举值:
percentage
prerequisite_to_entitlement_quantity_ratio
string
可选
prerequisite_quantity
defines the necessary 'buy' quantity and entitled_quantity
the offered 'get' quantity.prerequisite_to_entitlement_quantity_ratio
can be used only with:value_type
set topercentage
,target_type
set toline_item
,target_selection
set toentitled
,allocation_method
set toeach
,prerequisite_product_ids
orprerequisite_variant_ids
orprerequisite_collection_ids
defined andentitled_product_ids
orentitled_variant_ids
orentitled_collection_ids
defined.
Caution
prerequisite_subtotal_range
, prerequisite_quantity_range
or prerequisite_shipping_price_range
.allocation_limit
string
可选
allocation_limit
is 3. Empty (null
) allocation_limit
means unlimited number of allocations.Caution
allocation_limit
is only working with Buy X Get Y discount. The default value on creation will be null
(unlimited).示例
{
"price_rule": {
"id": 507328175,
"value_type": "fixed_amount",
"value": "-10.0",
"customer_selection": "all",
"target_type": "line_item",
"target_selection": "all",
"allocation_method": "across",
"allocation_limit": null,
"once_per_customer": false,
"usage_limit": null,
"starts_at": "2022-12-28T12:05:09-05:00",
"ends_at": "2023-01-09T12:05:09-05:00",
"created_at": "2023-01-03T12:05:09-05:00",
"updated_at": "2023-01-03T12:05:09-05:00",
"entitled_product_ids": [],
"entitled_variant_ids": [],
"entitled_collection_ids": [],
"entitled_country_ids": [],
"prerequisite_product_ids": [],
"prerequisite_variant_ids": [],
"prerequisite_collection_ids": [],
"customer_segment_prerequisite_ids": [],
"prerequisite_customer_ids": [],
"prerequisite_subtotal_range": null,
"prerequisite_quantity_range": null,
"prerequisite_shipping_price_range": null,
"prerequisite_to_entitlement_quantity_ratio": {
"prerequisite_quantity": null,
"entitled_quantity": null
},
"prerequisite_to_entitlement_purchase": {
"prerequisite_amount": null
},
"title": "SUMMERSALE10OFF",
"admin_graphql_api_id": "gid://shopify/PriceRule/507328175"
}
}
修改于 2023-01-29 12:00:31