Requires read_discounts access scope.
For more info , refer to:
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 string
    Return object created a certain time ago
  • created_at_min string
    Returns objects created after a certain time
  • ends_at_max string
    Return Discount rules for ending time at some time
  • ends_at_min string
    Return Discount rules after a certain time
  • limit string
    Query of query quantity , default 50 , can not exceed 1000
  • page_info string
    Paging information, can be used with limit, but is mutually exclusive with other conditions
  • since_id string
    Returns the object "after" a certain ID
  • starts_at_max string
    Returns discount rules with start time before a certain time
  • starts_at_min string
    Returns discount rules with start time after a certain time
  • times_used integer
    Show the price rule for the number of uses
  • update_at_max string
    Return object updated a certain time ago
  • update_at_min string
    Return object updated after a certain time
Request Headers
  • Content-Type required
    The value of this field is fixed to application/json; charset=utf-8
  • Authorization string required
    The 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
For more information about status codes, see Http status code.

Response Headers
  • link
    Upper and lower page connections
  • traceId
    traceId
Response Body
  • price_rulesobject[]
    Discount rules
  • allocation_limit string
    When 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 3
  • allocation_method string
    The 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 across
  • create_at string
    Creation time
  • ends_at string
    End 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 above
  • entitled_collection_ids array
    A 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 array
    Multiple countries / regional ids acceptable
    Example: ``
  • entitled_product_ids array
    A 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 string
    product id
  • variant_id string
    variant id
  • id string
    Discount rule ID
  • joint_discount boolean
    Overlay Discount ● default value for false
  • overlay_discount_code boolean
    Overlay Discount-discount code Discount allowing multiple promo code activities to be superimposed Discount
  • prerequisite_collection_ids array
    For 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_ids
    Example: ``
  • prerequisite_product_ids array
    For 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_ids
    Example: ``
  • 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 quantity
  • greater_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 quantity
  • greater_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.12
  • prerequisite_to_entitlement_purchaseobject
    When buying x get y , x Product needs to meet the amount threshold
  • prerequisite_amount string
    X Product required amount threshold , not the same as prerequisite_quantity
  • prerequisite_to_entitlement_quantity_ratioobject
    When buying x get y , the number threshold and number of y Product required by x Product
  • entitled_quantity integer
    Meets the number of y Product s when you get 1 threshold
  • prerequisite_quantity integer
    The number of x Product that is required when 1 threshold is met , and cannot be used at the same time as prerequisite_quantity
  • prerequisite_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_ids
  • product_id string
    product id
  • variant_id string
    variant id
  • starts_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 time
  • target_selection string
    Discount 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 all
  • title string
    The name of the discount rules
  • update_at string
    Update time
  • usage_limit integer
    Limit 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 value
  • usage_per_customer integer
    Limited 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 use
  • value string
    Discount 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 string
    The 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
https://openapiceshidianpu.myshopline.com/admin/openapi/v20210901

ParamOptions

— header required
— query
— query
— query
— query
— query
— query
— query
— query
— query
— query
— query
— query

Language

curl --request GET \
--url https://openapiceshidianpu.myshopline.com/admin/openapi/v20210901/sales/price_rules.json \
--header 'Authorization: Bearer eyJhbGciOiJIUzUxMiJ9.eyJhcHBLZXkiOiJmMjM3OWQyMTYyOGMzM2QxMWRiMWZkYjY5N2EzZjdjMjZlNGMwYTA5Iiwic2VsbGVySWQiOiIyMDAwMjM0ODgwIiwic3RvcmVJZCI6IjE2NzIzNjk3Mjk2MDYiLCJ2ZXJzaW9uIjoiVjIiLCJkb21haW4iOiJodHRwczovL3NsLW9wZW4tc2cubXlzaG9wbGluZS5jb20iLCJ0aW1lc3RhbXAiOjE2NzUzMTk0OTI0MzksImlzcyI6Inlzb3VsIiwiZXhwIjoxNzY5OTI3NDkyfQ.UwQzomM2veGCUaOZ0paUxq5dpc7DXuhHYFvsQ_uIAKduzWcb_j2E4q_36El83sp145D4cKbpcE5KCeeIz-JNQw' \
--header 'Content-Type: application/json; charset=utf-8' \
--header 'accept: application/json'
Examples
By creating time and end time query price rules
Response
{
"price_rules": [
{
"allocation_method": "each",
"create_at": "2022-12-06T17:27:56+08:00",
"ends_at": "2022-12-26T23:59:10+08:00",
"entitled_country_ids": [],
"id": "5704098540064086134",
"joint_discount": false,
"overlay_discount_code": false,
"starts_at": "2022-12-15T09:00:00+08:00",
"target_selection": "all",
"title": "5OFFCUSTOMERGROUP",
"update_at": "2022-12-06T17:28:26+08:00",
"value": "-5.00",
"value_type": "fixed_amount"
},
{
"allocation_method": "each",
"create_at": "2022-12-06T17:29:25+08:00",
"ends_at": "2022-12-26T23:59:10+08:00",
"entitled_country_ids": [],
"id": "5704100042145011839",
"joint_discount": false,
"overlay_discount_code": false,
"starts_at": "2022-12-15T09:00:00+08:00",
"target_selection": "all",
"title": "5OFFCUSTOMERGROUP",
"update_at": "2022-12-06T17:29:25+08:00",
"value": "-5.00",
"value_type": "fixed_amount"
},
{
"allocation_method": "each",
"create_at": "2022-12-06T17:31:43+08:00",
"ends_at": "2022-12-26T23:59:10+08:00",
"entitled_country_ids": [],
"id": "5704102345841320072",
"joint_discount": false,
"overlay_discount_code": false,
"starts_at": "2022-12-15T09:00:00+08:00",
"target_selection": "all",
"title": "FREESHIPPING MAX3000BENEFIT",
"update_at": "2022-12-06T17:32:02+08:00",
"value": "100",
"value_type": "percentage"
},
{
"allocation_method": "each",
"create_at": "2022-12-06T17:32:46+08:00",
"ends_at": "2022-12-26T23:59:10+08:00",
"entitled_country_ids": [],
"id": "5704103409449705617",
"joint_discount": false,
"overlay_discount_code": false,
"starts_at": "2022-12-15T09:00:00+08:00",
"target_selection": "all",
"title": "FREESHIPPINGMAX3000BENEFIT",
"update_at": "2022-12-06T17:32:46+08:00",
"value": "100",
"value_type": "percentage"
},
{
"allocation_method": "each",
"create_at": "2022-12-06T17:36:19+08:00",
"ends_at": "2022-12-26T23:59:10+08:00",
"entitled_country_ids": [],
"id": "5704106981872640162",
"joint_discount": false,
"overlay_discount_code": false,
"starts_at": "2022-12-15T09:00:00+08:00",
"target_selection": "all",
"title": "FREESHIPPINGMAX3000BENEFIT",
"update_at": "2022-12-06T17:36:19+08:00",
"value": "100",
"value_type": "percentage"
},
{
"allocation_method": "across",
"create_at": "2022-12-06T17:46:20+08:00",
"ends_at": "2022-12-26T23:59:10+08:00",
"entitled_collection_ids": [
"12251760568874446429080593"
],
"entitled_country_ids": [],
"id": "5704117058436341939",
"joint_discount": false,
"overlay_discount_code": false,
"starts_at": "2022-12-15T09:00:00+08:00",
"target_selection": "entitled",
"title": "20%OFF EACH ORDER",
"update_at": "2022-12-06T17:46:59+08:00",
"value": "20",
"value_type": "percentage"
},
{
"allocation_method": "across",
"create_at": "2022-12-06T17:47:53+08:00",
"ends_at": "2022-12-26T23:59:10+08:00",
"entitled_collection_ids": [
"12251760568874446429080593"
],
"entitled_country_ids": [],
"id": "5704118631250010309",
"joint_discount": false,
"overlay_discount_code": false,
"starts_at": "2022-12-15T09:00:00+08:00",
"target_selection": "entitled",
"title": "20%OFFEACHORDER",
"update_at": "2022-12-06T17:47:53+08:00",
"value": "20",
"value_type": "percentage"
},
{
"allocation_limit": 1,
"allocation_method": "each",
"create_at": "2022-12-06T18:05:19+08:00",
"ends_at": "2022-12-26T23:59:10+08:00",
"entitled_country_ids": [],
"entitled_product_ids": [
"16051760572299179531080593"
],
"id": "5704136171258910870",
"joint_discount": false,
"overlay_discount_code": false,
"prerequisite_product_ids": [
"16056751166104257221380593"
],
"prerequisite_to_entitlement_quantity_ratio": {
"entitled_quantity": 1,
"prerequisite_quantity": 2
},
"starts_at": "2022-12-15T09:00:00+08:00",
"target_selection": "entitled",
"title": "Buy2iPodsGetiPodTouchForFree",
"update_at": "2022-12-06T18:05:36+08:00",
"value": "100",
"value_type": "percentage"
},
{
"allocation_limit": 1,
"allocation_method": "each",
"create_at": "2022-12-06T18:06:26+08:00",
"ends_at": "2022-12-26T23:59:10+08:00",
"entitled_country_ids": [],
"entitled_product_ids": [
"16051760572299179531080593"
],
"id": "5704137290903199978",
"joint_discount": false,
"overlay_discount_code": false,
"prerequisite_product_ids": [
"16056751166104257221380593"
],
"prerequisite_to_entitlement_quantity_ratio": {
"entitled_quantity": 1,
"prerequisite_quantity": 2
},
"starts_at": "2022-12-15T09:00:00+08:00",
"target_selection": "entitled",
"title": "Buy2iPodsGetiPodTouchForFree",
"update_at": "2022-12-06T18:06:26+08:00",
"value": "100",
"value_type": "percentage"
}
]
}
Was this article helpful to you?

Error loading component.

Error loading component.