Retrieve price rules list
GET https://{handle}.myshopline.com/admin/openapi/v20210901/sales/price_rules.json
handle
: The store's unique identifier, which is the prefix of the store's domain name. For example, if a store's domain name is open001.myshopline.com
, the store handle is open001
.With a door of the door to ask PRICERULE
Query Parameters
- created_at_max stringReturn object created a certain time ago
- created_at_min stringReturns objects created after a certain time
- ends_at_max stringReturn Discount rules for ending time at some time
- ends_at_min stringReturn Discount rules after a certain time
- limit stringQuery of query quantity , default 50 , can not exceed 1000
- page_info stringPaging information, can be used with limit, but is mutually exclusive with other conditions
- since_id stringReturns the object "after" a certain ID
- starts_at_max stringReturns discount rules with start time before a certain time
- starts_at_min stringReturns discount rules with start time after a certain time
- times_used integerShow the price rule for the number of uses
- update_at_max stringReturn object updated a certain time ago
- update_at_min stringReturn object updated after a certain time
Request Headers
- Content-Type requiredThe value of this field is fixed to
application/json; charset=utf-8
- Authorization string requiredThe access token for the API. Please refer to App authorization to obtain the access token, and then put the obtained access token into the API request header in Bearer Token.Example:
Bearer eyJhbGciOiJIUzUxMiJ9.eyJhcHBLZXkiOiJmMjM3OWQyMTYyOGMzM2QxMWRiMWZkYjY5N2EzZjdjMjZlNGMwYTA5Iiwic2VsbGVySWQiOiIyMDAwMjM0ODgwIiwic3RvcmVJZCI6IjE2NzIzNjk3Mjk2MDYiLCJ2ZXJzaW9uIjoiVjIiLCJkb21haW4iOiJodHRwczovL3NsLW9wZW4tc2cubXlzaG9wbGluZS5jb20iLCJ0aW1lc3RhbXAiOjE2NzUzMTk0OTI0MzksImlzcyI6Inlzb3VsIiwiZXhwIjoxNzY5OTI3NDkyfQ.UwQzomM2veGCUaOZ0paUxq5dpc7DXuhHYFvsQ_uIAKduzWcb_j2E4q_36El83sp145D4cKbpcE5KCeeIz-JNQw
Response
- 200
- 401
- 429
For more information about status codes, see Http status code.
Response Headers
link
Upper and lower page connectionstraceId
traceId
Response Body
price_rulesobject[]
Discount rulesallocation_limit stringWhen buying x-d , you can distribute the limited to of the Discount in the shopping cart in the eligible situation . for example , if you are full of 1 piece x and get 1 piece of y discount , set up allocation_limit=2 , when the shopping cart has 3 pieces x Product , and 3allocation_method stringThe distribution method of price rules , the acceptable value has ● each discount , which is suitable for Product in every participation . for example , for Discount price rules of $ 15 , each eligible Product at checkout will be matched Discount $ 15. at this time , the price is about $The discount amount calculated by across will be applied to the entire eligible Product for the price policy of Discount 15 dollars , for example , the discount will be distributed to the Product of each participation event , which is equivalent to $ 15 for the total Discount .When the target_type value is shipping_line , allocation_method must be each. default value acrosscreate_at stringCreation timeends_at stringEnd time ● default value is empty ● if not filled , it is determined that there is no end time , Discount rules indefinitely ● the date processing method is the same as aboveentitled_collection_ids arrayA list of IDs of products that will be entitled to this discount. ● If target_selection is entitled, then one of entitled_product_ids, entitled_collection_ids, entitled_variant_ids must be defined ● entitled_product_ids, entitled_collection_ids, and entitled_variant_ids are mutually exclusive, only one of them can be defined at the same time. ● A list of IDs of products that will be entitled for a Buy X Get Y type discount (which means list of Y products).Example: ``entitled_country_ids arrayMultiple countries / regional ids acceptableExample: ``entitled_product_ids arrayA list of IDs of collections that can be applied to the discount. ● If target_selection is entitled, then one of entitled_product_ids, entitled_collection_ids, entitled_variant_ids must be defined ● entitled_product_ids, entitled_collection_ids, and entitled_variant_ids are mutually exclusive, only one of them can be defined at the same time.Example: ``entitled_variant_idsobject[]
A list of IDs of variants that can be applied to the discount. ● If target_selection is entitled, then one of entitled_product_ids, entitled_collection_ids, entitled_variant_ids must be defined ● entitled_product_ids, entitled_collection_ids, and entitled_variant_ids are mutually exclusive, only one of them can be defined at the same time. ● A list of IDs of product variants that will be entitled for a Buy X Get Y type discount (which means list of Y products).product_id stringproduct idvariant_id stringvariant idid stringDiscount rule IDjoint_discount booleanOverlay Discount ● default value for falseoverlay_discount_code booleanOverlay Discount-discount code Discount allowing multiple promo code activities to be superimposed Discountprerequisite_collection_ids arrayFor a Buy X Get Y type discount, a list of IDs of collections for X products (prerequisites for this discount) cannot be used in combination with prerequisite_product_ids or prerequisite_variant_idsExample: ``prerequisite_product_ids arrayFor a Buy X Get Y type discount, a list of IDs of products for X products (prerequisites for this discount) cannot be used in combination with prerequisite_collection_ids or prerequisite_variant_idsExample: ``prerequisite_quantity_rangeobject
Promotion triggers the minimum quantity of items ● prerequisite_quantity_range and prerequisite_subtotal_range are mutually exclusive ● If both are empty, it is the trigger condition for no price or quantitygreater_than_or_equal_to integer● nullable ● must be >0 ● only integers are acceptable (integer)prerequisite_subtotal_rangeobject
Promotion triggers the minimum order amount ● prerequisite_quantity_range and prerequisite_subtotal_range are mutually exclusive ● If both are empty, it is the trigger condition for no price or quantitygreater_than_or_equal_to string● Can be null ● Rounded to two decimal places Example: ● If 11.116666 is passed in, it will be processed as 11.12prerequisite_to_entitlement_purchaseobject
When buying x get y , x Product needs to meet the amount thresholdprerequisite_amount stringX Product required amount threshold , not the same as prerequisite_quantityprerequisite_to_entitlement_quantity_ratioobject
When buying x get y , the number threshold and number of y Product required by x Productentitled_quantity integerMeets the number of y Product s when you get 1 thresholdprerequisite_quantity integerThe number of x Product that is required when 1 threshold is met , and cannot be used at the same time as prerequisite_quantityprerequisite_variant_idsobject[]
For a Buy X Get Y type discount, a list of IDs of product variants for X products (prerequisites for this discount) cannot be used in combination with prerequisite_collection_ids or prerequisite_product_idsproduct_id stringproduct idvariant_id stringvariant idstarts_at string● using ISO 8601 time format , standard format is 2021-10-20T09 : 59 : 10+08 : 00 ●if the time zone is not transmitted , it is recognized as gmt standard timetarget_selection stringDiscount rule application range , acceptable value has ● all , defined as all Product ●Entitled , defined as the specify range ( specify Product / specify classification ) when this field is obtained for entitled , the two choices of entitled_product_ids and entitled_collection_ids must be worthwhile ;When target_type=shipping_line , all . default value is alltitle stringThe name of the discount rulesupdate_at stringUpdate timeusage_limit integerLimit the total number of uses of all discount codes bound to this discount rule ● If not filled, the default value is null or empty, which means unlimited use times ● Only empty and natural numbers are acceptable; ● If the upper limit value is exceeded, it will be automatically processed as upper limit valueusage_per_customer integerLimited to each customer can use the number of times per code under the price rule ● if not filled , the default value is lol or empty , refer to the number of times without limited to ● only acceptable to empty and natural ; ● exceeds the upper limit automatic number of times , the number of times to usevalue stringDiscount amount or percentage , ● if the value_type value is percentage , it indicates the Discount percentage , rounding up the reserved whole number , for example : Discount 10 % , filling 10 ; ●If the value_type value is fixed_amount , it means the Discount amount , the unit is yuan , rounded up to retain the two decimal points , such as : Discount 10.23 yuan , fill in the required field of -10.23.value_type stringThe Discount type , the acceptable value has ● the percentage of percentage , when target_type=shipping_line , you must fill in percentage , buy x and get y type activities must fill in percentage ; ●Fixed_amount fixed amount ; required field
API Explorer
Debugger
Examples
Was this article helpful to you?
Error loading component.