Skip to content

Commit df32b09

Browse files
[PR-25200] [DOCS] Update Shopfiy coupon auto-sync documentation (#414)
1 parent febb4b8 commit df32b09

File tree

1 file changed

+69
-66
lines changed

1 file changed

+69
-66
lines changed
Lines changed: 69 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
.. _advanced_features/shopify_coupons_auto_sync:
22

33
.. meta::
4-
:description: Talkable supports coupon auto-sync for Shopify. This feature allows to avoid manual coupon uploads and/or Shopify Price Rule management.
4+
:description: Talkable supports coupon auto-sync for Shopify. This feature allows to avoid manual coupon uploads and/or Shopify Discount management.
55

66
Shopify coupon auto-sync
77
========================
88

9-
Talkable supports coupon auto-sync for Shopify. This feature allows the automation of code creation and management of Shopify Price Rules, rather than manual code creation and upload to the Talkable Platform.
9+
Talkable supports coupon auto-sync for Shopify. This feature allows the automation of code creation and management of Shopify Discounts, rather than manual code creation and upload to the Talkable Platform.
1010

1111
.. note::
1212
Shopify coupon auto-sync and :ref:`Coupon Webhook <web_hooks/create_coupon>` can be enabled simultaneously.
@@ -21,56 +21,58 @@ To enable coupon auto-sync in a coupon list, go to the coupon list edit/create p
2121
If this checkbox is disabled (you are unable to check/uncheck it), it means that your user doesn't have rights for this site or Shopify Integration is not authorized.
2222

2323
.. note::
24-
Talkable uses a Shopify Price Rule ID (if present) to determine where to upload newly generated coupons. It is recommended to leave it blank when creating coupon lists. If blank, Talkable will create a Price Rule based on coupon list configuration and store its ID in the coupon list.
25-
When you try to create a coupon list with a 100% discount you have to provide a Price Rule ID manually. That was made for preventing mistakes in the PriceRule setup.
24+
Talkable uses a Shopify Discount ID (if present) to determine where to upload newly generated coupons. It is recommended to leave it blank when creating coupon lists. If blank, Talkable will create a Discount based on coupon list configuration and store its ID in the coupon list.
25+
When you try to create a coupon list with a 100% discount you have to provide a Discount ID manually. That was made for preventing mistakes in the Discount setup.
2626

27-
Please see **Advanced features** for more information about Shopify Price Rule ID.
27+
Please see **Advanced features** for more information about Shopify Discount ID.
2828

2929

30-
What is Price Rule?
30+
What is a Discount?
3131
~~~~~~~~~~~~~~~~~~~
3232

33-
A price rule is the closest thing to Talkable coupon lists in Shopify. It defines the properties and applicability of associated coupon codes. You can read more on the Shopify site `here <https://shopify.dev/docs/admin-api/rest/reference/discounts/pricerule>`_.
33+
A Discount is the closest thing to Talkable coupon lists in Shopify. It defines the properties and applicability of associated coupon codes. You can read more on the Shopify site `here <https://shopify.dev/docs/api/admin-graphql/latest/objects/DiscountCodeBasic>`_.
3434

35-
What attributes will the auto-generated Price Rule have?
36-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
35+
What attributes will the auto-generated Discount have?
36+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3737

38-
Talkable applies the below coupon list settings onto Price Rule:
38+
Talkable applies the below coupon list settings onto the Discount:
3939

4040
.. container:: ptable
4141

42-
===================== =================================== ======================================
43-
Coupon list attribute Price rule attribute (as in API) Price rule attribute (as in interface)
44-
===================== =================================== ======================================
45-
**Amount** `value` Value
46-
**Discount type** `value_type` Type
47-
**Expiration date** `ends_at` End date
48-
**Minimum subtotal** `prerequisite_subtotal_range` Minimum purchase amount
49-
===================== =================================== ======================================
42+
===================== ======================================== ======================================
43+
Coupon list attribute Discount attribute (as in API) Discount attribute (as in interface)
44+
===================== ======================================== ======================================
45+
**Amount** `customerGets.value` Value
46+
**Discount type** `customerGets.value.percentage` or Type
47+
`customerGets.value.discountAmount`
48+
**Expiration date** `endsAt` End date
49+
**Minimum subtotal** `minimumRequirement.subtotal` Minimum purchase amount
50+
`.greaterThanOrEqualToSubtotal`
51+
===================== ======================================== ======================================
5052

51-
Some other Price Rule attributes that we set when generating Price Rule:
53+
Some other Discount attributes that we set when generating the Discount:
5254

5355
.. container:: ptable
5456

55-
======================== ======================= =============================================
56-
Price Rule attribute Value Attribute effect
57-
======================== ======================= =============================================
58-
`title` e.g. "Talkable Describes Price Rule.
59-
single-use coupons $10"
60-
`target_type` `line_item` The price rule applies to the cart's line
61-
items.
62-
`target_selection` `all` The price rule applies the discount to all
63-
line items in the checkout.
64-
`allocation_method` `across` The calculated discount amount will be
65-
applied across the entitled items.
66-
For example, for a price rule that takes
67-
$15 off, the discount will be applied across
68-
all the entitled items.
69-
`usage_limit` `1` Each discount code can be used exactly once.
70-
`customer_selection` `all` The price rule is valid for all customers.
71-
`starts_at` Time of coupon list The date and time when the price rule starts.
72-
creation
73-
======================== ======================= =============================================
57+
============================= ============================= =============================================
58+
Discount attribute Value Attribute effect
59+
============================= ============================= =============================================
60+
`title` e.g. "Talkable Describes the Discount.
61+
single-use coupons $10"
62+
`customerGets.items` `{ all: true }` The discount applies to all items in
63+
the cart. Can be restricted to specific
64+
products or collections.
65+
`customerGets.value` `{ percentage: 0.1 }` or Discount value - either percentage
66+
`{ discountAmount: {...} }` (0.0-1.0) or fixed amount.
67+
`appliesOncePerCustomer` `false` Allows the customer to use discount
68+
multiple times.
69+
`usageLimit` `1` Each discount code can be used exactly once.
70+
`customerSelection` `{ all: true }` The discount is valid for all customers.
71+
Can be restricted to specific customers
72+
or customer segments.
73+
`startsAt` Time of coupon list The date and time when the discount starts.
74+
creation
75+
============================= ============================= =============================================
7476

7577

7678
Why aren't there any coupons created for my auto-synced list?
@@ -81,61 +83,62 @@ Auto-sync generates and uploads coupons when there is demand for them. That mean
8183
Advanced features
8284
-----------------
8385

84-
Shopify Price Rule ID
85-
~~~~~~~~~~~~~~~~~~~~~
86+
Shopify Discount ID
87+
~~~~~~~~~~~~~~~~~~~
8688

87-
Talkable allows you to assign a custom Price Rule ID to a coupon list. This might be helpful if you want to deviate from our default Price Rule settings, e.g. restrict codes to a group of customers or group of products.
89+
Talkable allows you to assign a custom Discount ID to a coupon list. This might be helpful if you want to deviate from our default Discount settings, e.g. restrict codes to a group of customers or group of products.
8890

89-
It is recommended to create a new Price Rule in Shopify if there is a need to use a custom one, instead of editing the Price Rule generated by Talkable.
91+
It is recommended to create a new Discount in Shopify if there is a need to use a custom one, instead of editing the Discount generated by Talkable.
9092

9193
.. warning::
92-
Talkable validates the Price Rule attached to a coupon list. There are certain Price Rule attributes that must match the coupon list configuration.
94+
Talkable validates the Discount attached to a coupon list. There are certain Discount attributes that must match the coupon list configuration.
9395
These include:
9496

95-
`allocation_method` - must be "across"
97+
`Applies once per customer` - must be `false` (amount split across items)
9698

97-
`value` - must correspond to coupon list amount
99+
`Value` - must correspond to coupon list amount
98100

99-
`value_type` - must correspond to coupon list type
101+
`Type` - must correspond to coupon list type
100102

101-
`ends_at` - must be greater than or equal to coupon list expiration (and absent if coupon list has no expiration)
103+
`Ends At` - must be greater than or equal to coupon list expiration (and absent if coupon list has no expiration)
102104

103-
`prerequisite_subtotal_range` - must match coupon list minimum subtotal
105+
`Minimum Subtotal` - must match coupon list minimum subtotal
104106

105-
If the Price Rule passes validation, it can be attached to a coupon list and will be used as a new destination for all the coupons created from that moment on.
107+
If the Discount passes validation, it can be attached to a coupon list and will be used as a new destination for all the coupons created from that moment on.
106108

107109
.. note::
108-
All previously generated coupons will retain the attributes of the Price Rule that was used at the point at which they were created (auto-synced).
110+
All previously generated coupons will retain the attributes of the Discount that was used at the point at which they were created (auto-synced).
109111

110-
Shopify Price Rule Changed Email Notification
111-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
112+
Shopify Discount Changed Email Notification
113+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
112114

113-
If you modify a Price Rules on Shopify, it could make them incompatible with the coupon lists they are attached to. In order to find out about such changes as early as possible, we have a daily monitoring job that checks that Price Rules have no critical differences from respective coupon lists.
115+
If you modify a Discount on Shopify, it could make them incompatible with the coupon lists they are attached to. In order to find out about such changes as early as possible, we have a daily monitoring job that checks that Discounts have no critical differences from respective coupon lists.
114116

115117
Attributes that are checked in this job are the following:
116-
117-
- `allocation_method` - must always be "across"
118-
- `usage_limit` - must always be 1
119-
- `value` - must correspond to coupon list amount
120-
- `value_type` - must correspond to coupon list type
121-
- `ends_at` - must be greater than or equal to coupon list expiration (and absent if coupon list has no expiration)
122-
- `prerequisite_subtotal_range` - must match coupon list minimum subtotal
118+
119+
- `customerGets.value.appliesOnEachItem` - must always be `false`
120+
- `usageLimit` - must always be 1
121+
- `customerGets.value` - must correspond to coupon list amount
122+
- `customerGets.value.percentage` or `customerGets.value.discountAmount` - must correspond to coupon list type
123+
- `endsAt` - must be greater than or equal to coupon list expiration (and absent if coupon list has no expiration)
123124

124125
If any of these attributes differ from what they are expected to be and Talkable cannot fix that by updating a coupon list (see **Coupon list sync**), Talkable sends an email notification.
125126

126-
Once the Price Rule becomes critically different from the coupon list it is assigned to, the coupon list is no longer editable. Please fix the issues listed in the email notification to remedy this situation.
127+
Once the Discount becomes critically different from the coupon list it is assigned to, the coupon list is no longer editable. Please fix the issues listed in the email notification to remedy this situation.
127128

128129
Coupon list sync
129130
~~~~~~~~~~~~~~~~
130131

131-
Talkable tries to keep up with the Price Rules assigned to coupon lists when/if Price Rules change.
132+
Talkable tries to keep up with the Discounts assigned to coupon lists when/if Discounts change.
132133

133-
As long as the Price Rule is otherwise valid for a coupon list, we update the coupon lists:
134+
As long as the Discount is otherwise valid for a coupon list, we update the coupon list's:
134135

135-
- **expiration date** - only if Price Rule end date is further in the future (or absent)
136+
- **expiration date** - only if Discount end date is further in the future (or absent)
136137
- **minimum subtotal**
138+
- **entitled products**
139+
- **entitled collections**
137140

138141
.. note::
139-
If there are any other changes in the Price Rule that make it not suitable for a certain coupon list, we wont sync the coupon list. In this case, a Shopify Price Rule Changed Email Notification will be delivered and action will be required to fix the issue.
142+
If there are any other changes in the Discount that make it not suitable for a certain coupon list, we won't sync the coupon list. In this case, a Shopify Discount Changed Email Notification will be delivered and action will be required to fix the issue.
140143

141-
This sync is performed daily. Do not expect an immediate change to be reflected after a Price Rule update.
144+
This sync is performed daily. Do not expect an immediate change to be reflected after a Discount update.

0 commit comments

Comments
 (0)