Requires read_price_rules access scope.
For more info , refer to:
GET https://{handle}.myshopline.com/admin/openapi/v20210901/sales/price_rules/:price_rule_id.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 .
Genju for id
Path Parameters
  • price_rule_id string required
    Discount rule ID
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
  • traceId
    traceId
Response Body
  • price_ruleobject
    Discount rules
  • allocation_limit string
    When buying x get y , 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 process is the same as ● ends_at time cannot be earlier than starts_at time
  • 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 regular 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_customer_ids array
    Specify customer conditions : customers must belong to one of the search ( customer grouping ) requisite_saved_search_ids , or one of the customers specify by requisite_customer_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_saved_search_ids array
    Specify the customer group is a priority : customers must belong to one of the search ( customer grouping ) requisite_saved_search_ids , which is saved by specify or one of the customers specify by requisite_customer_ids .
    Example: ``
  • prerequisite_shipping_price_rangeobject
    Shipping must be less than or equal to the value . * non-required , default null .* 1 ) content * 2 ) is only available in target_type=shipping_line , and the accuracy is consistent with the store currency
  • less_than_or_equal_to string
    Shipping must be less than or equal to the value . * non-required , default null .* 1 ) content 2 ) is only available in target_type=shipping_line , and the accuracy is consistent with the store currency
  • 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
    The start time ● is in ISO 8601 time format , and the 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
  • target_type string
    Price rules applicable target type . rms : line_item : price rules applicable to shopping order Product item . shipping_line : price rules applicable to shopping order shipping item .
  • 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

— path required
— header required

Language

curl --request GET \
--url https://openapiceshidianpu.myshopline.com/admin/openapi/v20210901/sales/price_rules/price_rule_id.json \
--header 'Authorization: Bearer eyJhbGciOiJIUzUxMiJ9.eyJhcHBLZXkiOiJmMjM3OWQyMTYyOGMzM2QxMWRiMWZkYjY5N2EzZjdjMjZlNGMwYTA5Iiwic2VsbGVySWQiOiIyMDAwMjM0ODgwIiwic3RvcmVJZCI6IjE2NzIzNjk3Mjk2MDYiLCJ2ZXJzaW9uIjoiVjIiLCJkb21haW4iOiJodHRwczovL3NsLW9wZW4tc2cubXlzaG9wbGluZS5jb20iLCJ0aW1lc3RhbXAiOjE2NzUzMTk0OTI0MzksImlzcyI6Inlzb3VsIiwiZXhwIjoxNzY5OTI3NDkyfQ.UwQzomM2veGCUaOZ0paUxq5dpc7DXuhHYFvsQ_uIAKduzWcb_j2E4q_36El83sp145D4cKbpcE5KCeeIz-JNQw' \
--header 'Content-Type: application/json; charset=utf-8' \
--header 'accept: application/json'
Examples
Get the price rules through the id of the price rules
Response
{
"price_rule": {
"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",
"target_type": "line_item",
"title": "Buy2iPodsGetiPodTouchForFree",
"update_at": "2022-12-06T18:05:36+08:00",
"value": "100",
"value_type": "percentage"
}
}
Was this article helpful to you?

Error loading component.

Error loading component.