@spree/docs 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (183) hide show
  1. package/README.md +54 -0
  2. package/dist/api-reference/platform/authentication.md +38 -0
  3. package/dist/api-reference/store-api/authentication.md +188 -0
  4. package/dist/api-reference/store-api/errors.md +277 -0
  5. package/dist/api-reference/store-api/idempotency.md +129 -0
  6. package/dist/api-reference/store-api/introduction.md +34 -0
  7. package/dist/api-reference/store-api/localization.md +279 -0
  8. package/dist/api-reference/store-api/metadata.md +160 -0
  9. package/dist/api-reference/store-api/monetary-amounts.md +65 -0
  10. package/dist/api-reference/store-api/querying.md +399 -0
  11. package/dist/api-reference/store-api/rate-limitting.md +103 -0
  12. package/dist/api-reference/store-api/relations.md +185 -0
  13. package/dist/api-reference/storefront/authentication.md +88 -0
  14. package/dist/api-reference/tutorials/adyen-integration-guide-for-android.md +165 -0
  15. package/dist/api-reference/tutorials/adyen-integration-guide-for-ios.md +194 -0
  16. package/dist/api-reference/tutorials/quick-checkout-with-stripe.md +248 -0
  17. package/dist/api-reference/v2/fetching-multiple-resources.md +26 -0
  18. package/dist/api-reference/v2/filtering-and-sorting.md +53 -0
  19. package/dist/api-reference/v2/introduction.md +22 -0
  20. package/dist/api-reference/v2/pagination.md +37 -0
  21. package/dist/api-reference/webhooks-events.md +883 -0
  22. package/dist/developer/admin/admin.md +205 -0
  23. package/dist/developer/admin/authentication.md +59 -0
  24. package/dist/developer/admin/components.md +711 -0
  25. package/dist/developer/admin/custom-css.md +243 -0
  26. package/dist/developer/admin/custom-javascript.md +116 -0
  27. package/dist/developer/admin/extending-ui.md +1964 -0
  28. package/dist/developer/admin/form-builder.md +444 -0
  29. package/dist/developer/admin/helper-methods.md +531 -0
  30. package/dist/developer/admin/navigation.md +805 -0
  31. package/dist/developer/admin/tables.md +491 -0
  32. package/dist/developer/advanced/adding_spree_to_rails_app.md +106 -0
  33. package/dist/developer/cli/quickstart.md +137 -0
  34. package/dist/developer/contributing/creating-an-extension.md +258 -0
  35. package/dist/developer/contributing/developing-spree.md +339 -0
  36. package/dist/developer/contributing/quickstart.md +32 -0
  37. package/dist/developer/contributing/updating-extensions.md +67 -0
  38. package/dist/developer/core-concepts/addresses.md +265 -0
  39. package/dist/developer/core-concepts/adjustments.md +107 -0
  40. package/dist/developer/core-concepts/architecture.md +177 -0
  41. package/dist/developer/core-concepts/calculators.md +323 -0
  42. package/dist/developer/core-concepts/customers.md +230 -0
  43. package/dist/developer/core-concepts/events.md +624 -0
  44. package/dist/developer/core-concepts/imports-exports.md +698 -0
  45. package/dist/developer/core-concepts/inventory.md +191 -0
  46. package/dist/developer/core-concepts/markets.md +250 -0
  47. package/dist/developer/core-concepts/media.md +167 -0
  48. package/dist/developer/core-concepts/metafields.md +187 -0
  49. package/dist/developer/core-concepts/orders.md +328 -0
  50. package/dist/developer/core-concepts/payments.md +710 -0
  51. package/dist/developer/core-concepts/pricing.md +163 -0
  52. package/dist/developer/core-concepts/products.md +360 -0
  53. package/dist/developer/core-concepts/promotions.md +322 -0
  54. package/dist/developer/core-concepts/reports.md +206 -0
  55. package/dist/developer/core-concepts/search-filtering.md +237 -0
  56. package/dist/developer/core-concepts/shipments.md +212 -0
  57. package/dist/developer/core-concepts/slugs.md +111 -0
  58. package/dist/developer/core-concepts/staff-roles.md +123 -0
  59. package/dist/developer/core-concepts/store-credits-gift-cards.md +317 -0
  60. package/dist/developer/core-concepts/stores.md +117 -0
  61. package/dist/developer/core-concepts/taxes.md +135 -0
  62. package/dist/developer/core-concepts/translations.md +120 -0
  63. package/dist/developer/core-concepts/users.md +299 -0
  64. package/dist/developer/core-concepts/webhooks.md +378 -0
  65. package/dist/developer/create-spree-app/quickstart.md +158 -0
  66. package/dist/developer/customization/api.md +93 -0
  67. package/dist/developer/customization/authentication.md +88 -0
  68. package/dist/developer/customization/checkout.md +204 -0
  69. package/dist/developer/customization/configuration.md +55 -0
  70. package/dist/developer/customization/decorators.md +523 -0
  71. package/dist/developer/customization/dependencies.md +232 -0
  72. package/dist/developer/customization/emails.md +21 -0
  73. package/dist/developer/customization/extensions.md +92 -0
  74. package/dist/developer/customization/metadata.md +236 -0
  75. package/dist/developer/customization/model-preferences.md +130 -0
  76. package/dist/developer/customization/permissions.md +265 -0
  77. package/dist/developer/customization/quickstart.md +229 -0
  78. package/dist/developer/customization/routes.md +24 -0
  79. package/dist/developer/customization/v4/admin-panel.md +78 -0
  80. package/dist/developer/customization/v4/authentication.md +210 -0
  81. package/dist/developer/customization/v4/checkout.md +212 -0
  82. package/dist/developer/customization/v4/deface.md +251 -0
  83. package/dist/developer/customization/v4/images.md +86 -0
  84. package/dist/developer/customization/v4/storefront.md +450 -0
  85. package/dist/developer/deployment/assets.md +87 -0
  86. package/dist/developer/deployment/aws.md +335 -0
  87. package/dist/developer/deployment/caching.md +27 -0
  88. package/dist/developer/deployment/cdn.md +39 -0
  89. package/dist/developer/deployment/database.md +155 -0
  90. package/dist/developer/deployment/docker.md +128 -0
  91. package/dist/developer/deployment/emails.md +77 -0
  92. package/dist/developer/deployment/environment_variables.md +111 -0
  93. package/dist/developer/deployment/heroku.md +51 -0
  94. package/dist/developer/deployment/render.md +95 -0
  95. package/dist/developer/getting-started/quickstart.md +82 -0
  96. package/dist/developer/how-to/custom-payment-method.md +374 -0
  97. package/dist/developer/how-to/custom-promotion.md +373 -0
  98. package/dist/developer/how-to/custom-report.md +387 -0
  99. package/dist/developer/how-to/custom-search-provider.md +230 -0
  100. package/dist/developer/multi-store/quickstart.md +71 -0
  101. package/dist/developer/multi-store/setup.md +38 -0
  102. package/dist/developer/multi-tenant/configuration.md +41 -0
  103. package/dist/developer/multi-tenant/core-concepts.md +75 -0
  104. package/dist/developer/multi-tenant/installation.md +96 -0
  105. package/dist/developer/multi-tenant/quickstart.md +20 -0
  106. package/dist/developer/multi-vendor/installation.md +45 -0
  107. package/dist/developer/multi-vendor/quickstart.md +17 -0
  108. package/dist/developer/sdk/admin/quickstart.md +22 -0
  109. package/dist/developer/sdk/authentication.md +89 -0
  110. package/dist/developer/sdk/configuration.md +225 -0
  111. package/dist/developer/sdk/quickstart.md +82 -0
  112. package/dist/developer/sdk/store/account.md +67 -0
  113. package/dist/developer/sdk/store/cart-checkout.md +140 -0
  114. package/dist/developer/sdk/store/markets.md +151 -0
  115. package/dist/developer/sdk/store/payments.md +96 -0
  116. package/dist/developer/sdk/store/products.md +149 -0
  117. package/dist/developer/sdk/store/wishlists.md +52 -0
  118. package/dist/developer/security/pci_compliance.md +15 -0
  119. package/dist/developer/security/security_policy.md +68 -0
  120. package/dist/developer/storefront/blocks.md +285 -0
  121. package/dist/developer/storefront/custom-css.md +260 -0
  122. package/dist/developer/storefront/custom-javascript.md +166 -0
  123. package/dist/developer/storefront/helper-methods.md +1288 -0
  124. package/dist/developer/storefront/links.md +298 -0
  125. package/dist/developer/storefront/nextjs/architecture.md +150 -0
  126. package/dist/developer/storefront/nextjs/customization.md +141 -0
  127. package/dist/developer/storefront/nextjs/deployment.md +180 -0
  128. package/dist/developer/storefront/nextjs/quickstart.md +92 -0
  129. package/dist/developer/storefront/nextjs/spree-next-package.md +314 -0
  130. package/dist/developer/storefront/pages.md +163 -0
  131. package/dist/developer/storefront/sections.md +569 -0
  132. package/dist/developer/storefront/storefront.md +56 -0
  133. package/dist/developer/storefront/themes.md +161 -0
  134. package/dist/developer/tutorial/admin.md +134 -0
  135. package/dist/developer/tutorial/extending-models.md +380 -0
  136. package/dist/developer/tutorial/file-uploads.md +121 -0
  137. package/dist/developer/tutorial/introduction.md +33 -0
  138. package/dist/developer/tutorial/model.md +41 -0
  139. package/dist/developer/tutorial/page-builder.md +487 -0
  140. package/dist/developer/tutorial/rich-text.md +73 -0
  141. package/dist/developer/tutorial/seo.md +332 -0
  142. package/dist/developer/tutorial/storefront.md +352 -0
  143. package/dist/developer/tutorial/testing.md +558 -0
  144. package/dist/developer/upgrades/2.0-to-2.1.md +46 -0
  145. package/dist/developer/upgrades/2.1-to-2.2.md +59 -0
  146. package/dist/developer/upgrades/2.2-to-2.3.md +44 -0
  147. package/dist/developer/upgrades/2.3-to-2.4.md +42 -0
  148. package/dist/developer/upgrades/3.0-to-3.1.md +47 -0
  149. package/dist/developer/upgrades/3.1-to-3.2.md +34 -0
  150. package/dist/developer/upgrades/3.2-to-3.3.md +70 -0
  151. package/dist/developer/upgrades/3.3-to-3.4.md +36 -0
  152. package/dist/developer/upgrades/3.4-to-3.5.md +44 -0
  153. package/dist/developer/upgrades/3.5-to-3.6.md +40 -0
  154. package/dist/developer/upgrades/3.6-to-3.7.md +62 -0
  155. package/dist/developer/upgrades/3.7-to-4.0.md +152 -0
  156. package/dist/developer/upgrades/4.0-to-4.1.md +92 -0
  157. package/dist/developer/upgrades/4.1-to-4.2.md +109 -0
  158. package/dist/developer/upgrades/4.10-to-5.0.md +129 -0
  159. package/dist/developer/upgrades/4.2-to-4.3.md +100 -0
  160. package/dist/developer/upgrades/4.3-to-4.4.md +125 -0
  161. package/dist/developer/upgrades/4.4-to-4.5.md +94 -0
  162. package/dist/developer/upgrades/4.5-to-4.6.md +119 -0
  163. package/dist/developer/upgrades/4.6-to-4.7.md +39 -0
  164. package/dist/developer/upgrades/4.8-to-4.9.md +24 -0
  165. package/dist/developer/upgrades/4.9-to-4.10.md +24 -0
  166. package/dist/developer/upgrades/4.x-to-4.8.md +52 -0
  167. package/dist/developer/upgrades/5.0-to-5.1.md +28 -0
  168. package/dist/developer/upgrades/5.1-to-5.2.md +127 -0
  169. package/dist/developer/upgrades/5.2-to-5.3.md +338 -0
  170. package/dist/developer/upgrades/5.3-to-5.4.md +248 -0
  171. package/dist/developer/upgrades/quickstart.md +36 -0
  172. package/dist/integrations/analytics/google-analytics.md +64 -0
  173. package/dist/integrations/analytics/google-tag-manager.md +78 -0
  174. package/dist/integrations/integrations.md +39 -0
  175. package/dist/integrations/marketing/klaviyo.md +99 -0
  176. package/dist/integrations/payments/adyen.md +90 -0
  177. package/dist/integrations/payments/paypal.md +41 -0
  178. package/dist/integrations/payments/razorpay.md +45 -0
  179. package/dist/integrations/payments/stripe.md +109 -0
  180. package/dist/integrations/search/meilisearch.md +236 -0
  181. package/dist/integrations/sso-mfa-social-login/admin-dashboard.md +57 -0
  182. package/dist/integrations/sso-mfa-social-login/storefront.md +56 -0
  183. package/package.json +27 -0
@@ -0,0 +1,883 @@
1
+ ---
2
+ title: Webhook Events & Payloads
3
+ description: Complete reference of all webhook event types and their payload schemas
4
+ ---
5
+
6
+ Every webhook delivery sends a JSON envelope with the event metadata and a `data` object containing the serialized resource:
7
+
8
+ ```json
9
+ {
10
+ "id": "550e8400-e29b-41d4-a716-446655440000",
11
+ "name": "order.completed",
12
+ "created_at": "2025-01-15T10:30:00Z",
13
+ "data": { ... },
14
+ "metadata": {
15
+ "spree_version": "5.4.0"
16
+ }
17
+ }
18
+ ```
19
+
20
+ | Field | Type | Description |
21
+ |-------|------|-------------|
22
+ | `id` | string | Unique UUID for this event |
23
+ | `name` | string | Event name (e.g., `order.completed`) |
24
+ | `created_at` | string | ISO 8601 timestamp |
25
+ | `data` | object | Serialized resource (see payloads below) |
26
+ | `metadata` | object | Additional context including Spree version |
27
+
28
+ Event payloads use the same [Store API V3 serializers](/api-reference/introduction) as the REST API. All `id` fields use [prefixed IDs](/api-reference/introduction) (e.g., `or_m3Rp9wXz`, `prod_86Rf07xd4z`). All monetary values are strings. All timestamps are ISO 8601.
29
+
30
+ For details on creating webhook endpoints and verifying signatures, see [Webhooks](/developer/core-concepts/webhooks). For the event system internals and subscriber pattern, see [Events](/developer/core-concepts/events).
31
+
32
+ > **INFO:** Event payloads include the same top-level attributes and unconditional associations as API responses. Conditional associations (like product variants, images, or metafields) are not included in event payloads.
33
+
34
+ ---
35
+
36
+ ## Order Events
37
+
38
+ Events: `order.created`, `order.updated`, `order.completed`, `order.canceled`, `order.resumed`, `order.paid`, `order.shipped`
39
+
40
+ Order payloads include nested `items`, `shipments`, `payments`, `bill_address`, `ship_address`, `payment_methods`, and `promotions`.
41
+
42
+ ```json
43
+ {
44
+ "id": "or_m3Rp9wXz",
45
+ "number": "R123456789",
46
+ "state": "complete",
47
+ "token": "abc123def456",
48
+ "email": "customer@example.com",
49
+ "special_instructions": null,
50
+ "currency": "USD",
51
+ "item_count": 3,
52
+ "shipment_state": "shipped",
53
+ "payment_state": "paid",
54
+ "item_total": "89.99",
55
+ "display_item_total": "$89.99",
56
+ "ship_total": "10.00",
57
+ "display_ship_total": "$10.00",
58
+ "adjustment_total": "0.00",
59
+ "display_adjustment_total": "$0.00",
60
+ "promo_total": "0.00",
61
+ "display_promo_total": "$0.00",
62
+ "tax_total": "0.00",
63
+ "display_tax_total": "$0.00",
64
+ "included_tax_total": "0.00",
65
+ "display_included_tax_total": "$0.00",
66
+ "additional_tax_total": "0.00",
67
+ "display_additional_tax_total": "$0.00",
68
+ "total": "99.99",
69
+ "display_total": "$99.99",
70
+ "completed_at": "2025-01-15T10:30:00Z",
71
+ "created_at": "2025-01-15T10:00:00Z",
72
+ "updated_at": "2025-01-15T10:30:00Z",
73
+ "promotions": [],
74
+ "items": [
75
+ {
76
+ "id": "li_7xRt4wPq",
77
+ "variant_id": "var_k5nR8xLq",
78
+ "quantity": 2,
79
+ "currency": "USD",
80
+ "name": "Spree Tote Bag",
81
+ "slug": "spree-tote-bag",
82
+ "options_text": "Size: M, Color: Black",
83
+ "price": "29.99",
84
+ "display_price": "$29.99",
85
+ "total": "59.98",
86
+ "display_total": "$59.98",
87
+ "thumbnail_url": "https://cdn.example.com/images/tote-bag.jpg",
88
+ "option_values": [],
89
+ "digital_links": [],
90
+ "..."
91
+ }
92
+ ],
93
+ "shipments": [
94
+ {
95
+ "id": "shp_9xPq4wMn",
96
+ "number": "H123456789",
97
+ "state": "shipped",
98
+ "tracking": "1Z999AA10123456784",
99
+ "tracking_url": "https://tools.usps.com/go/TrackConfirmAction?tLabels=1Z999AA10123456784",
100
+ "cost": "10.00",
101
+ "display_cost": "$10.00",
102
+ "shipped_at": "2025-01-16T14:00:00Z",
103
+ "shipping_method": { "id": "sm_2wMn7xRt", "..." },
104
+ "stock_location": { "id": "sl_2wMn7xRt", "..." },
105
+ "shipping_rates": [],
106
+ "..."
107
+ }
108
+ ],
109
+ "payments": [
110
+ {
111
+ "id": "pay_3wXz7mRp",
112
+ "state": "completed",
113
+ "number": "P123456",
114
+ "amount": "99.99",
115
+ "display_amount": "$99.99",
116
+ "response_code": "ch_abc123",
117
+ "payment_method_id": "pm_4xLq8nRt",
118
+ "source_type": "credit_card",
119
+ "source_id": "cc_5wPq9mXz",
120
+ "source": { "..." },
121
+ "payment_method": { "id": "pm_4xLq8nRt", "..." },
122
+ "..."
123
+ }
124
+ ],
125
+ "bill_address": {
126
+ "id": "addr_1xPq2wMn",
127
+ "..."
128
+ },
129
+ "ship_address": {
130
+ "id": "addr_2wMn3xPq",
131
+ "..."
132
+ },
133
+ "payment_methods": [
134
+ { "id": "pm_4xLq8nRt", "..." }
135
+ ]
136
+ }
137
+ ```
138
+
139
+ ## Line Item Events
140
+
141
+ Events: `line_item.created`, `line_item.updated`, `line_item.deleted`
142
+
143
+ Line item payloads include nested `option_values` and `digital_links`.
144
+
145
+ ```json
146
+ {
147
+ "id": "li_7xRt4wPq",
148
+ "variant_id": "var_k5nR8xLq",
149
+ "quantity": 2,
150
+ "currency": "USD",
151
+ "name": "Spree Tote Bag",
152
+ "slug": "spree-tote-bag",
153
+ "options_text": "Size: M, Color: Black",
154
+ "price": "29.99",
155
+ "display_price": "$29.99",
156
+ "total": "59.98",
157
+ "display_total": "$59.98",
158
+ "adjustment_total": "0.00",
159
+ "display_adjustment_total": "$0.00",
160
+ "additional_tax_total": "2.40",
161
+ "display_additional_tax_total": "$2.40",
162
+ "included_tax_total": "0.00",
163
+ "display_included_tax_total": "$0.00",
164
+ "promo_total": "-5.00",
165
+ "display_promo_total": "-$5.00",
166
+ "pre_tax_amount": "54.98",
167
+ "display_pre_tax_amount": "$54.98",
168
+ "discounted_amount": "54.98",
169
+ "display_discounted_amount": "$54.98",
170
+ "compare_at_amount": null,
171
+ "display_compare_at_amount": null,
172
+ "thumbnail_url": "https://cdn.example.com/images/tote-bag.jpg",
173
+ "created_at": "2025-01-15T10:00:00Z",
174
+ "updated_at": "2025-01-15T10:00:00Z",
175
+ "option_values": [
176
+ { "id": "ov_2wMn9xPq", "name": "M", "presentation": "Medium" }
177
+ ],
178
+ "digital_links": []
179
+ }
180
+ ```
181
+
182
+ ## Payment Events
183
+
184
+ Events: `payment.created`, `payment.updated`, `payment.paid`
185
+
186
+ Payment payloads include a nested `payment_method` and polymorphic `source` (credit card, store credit, or payment source).
187
+
188
+ ```json
189
+ {
190
+ "id": "pay_3wXz7mRp",
191
+ "state": "completed",
192
+ "number": "P123456",
193
+ "amount": "99.99",
194
+ "display_amount": "$99.99",
195
+ "response_code": "ch_abc123",
196
+ "payment_method_id": "pm_4xLq8nRt",
197
+ "source_type": "credit_card",
198
+ "source_id": "cc_5wPq9mXz",
199
+ "source": {
200
+ "id": "cc_5wPq9mXz",
201
+ "..."
202
+ },
203
+ "payment_method": {
204
+ "id": "pm_4xLq8nRt",
205
+ "..."
206
+ },
207
+ "created_at": "2025-01-15T10:25:00Z",
208
+ "updated_at": "2025-01-15T10:25:00Z"
209
+ }
210
+ ```
211
+
212
+ The `source_type` field is normalized to one of: `"credit_card"`, `"store_credit"`, `"payment_source"`, or `null`.
213
+
214
+ ## Payment Session Events
215
+
216
+ Events: `payment_session.created`, `payment_session.updated`, `payment_session.deleted`
217
+
218
+ Payment session payloads include a nested `payment_method` and optionally a nested `payment`.
219
+
220
+ ```json
221
+ {
222
+ "id": "ps_6nRt2xLq",
223
+ "status": "pending",
224
+ "amount": "99.99",
225
+ "currency": "USD",
226
+ "external_id": "pi_3abc123",
227
+ "external_data": {},
228
+ "customer_external_id": null,
229
+ "order_id": "or_m3Rp9wXz",
230
+ "payment_method_id": "pm_4xLq8nRt",
231
+ "payment_method": {
232
+ "id": "pm_4xLq8nRt",
233
+ "..."
234
+ },
235
+ "expires_at": "2025-01-15T11:00:00Z",
236
+ "created_at": "2025-01-15T10:25:00Z",
237
+ "updated_at": "2025-01-15T10:25:00Z"
238
+ }
239
+ ```
240
+
241
+ ## Payment Setup Session Events
242
+
243
+ Events: `payment_setup_session.created`, `payment_setup_session.updated`, `payment_setup_session.deleted`
244
+
245
+ Payment setup session payloads include a nested `payment_method`.
246
+
247
+ ```json
248
+ {
249
+ "id": "pss_8mXz3wPq",
250
+ "status": "pending",
251
+ "external_id": "seti_abc123",
252
+ "external_client_secret": "seti_abc123_secret_xyz",
253
+ "external_data": {},
254
+ "payment_method_id": "pm_4xLq8nRt",
255
+ "payment_source_id": "cc_5wPq9mXz",
256
+ "payment_source_type": "Spree::CreditCard",
257
+ "customer_id": "usr_k5nR8xLq",
258
+ "payment_method": {
259
+ "id": "pm_4xLq8nRt",
260
+ "..."
261
+ },
262
+ "created_at": "2025-01-15T10:25:00Z",
263
+ "updated_at": "2025-01-15T10:25:00Z"
264
+ }
265
+ ```
266
+
267
+ ## Shipment Events
268
+
269
+ Events: `shipment.created`, `shipment.updated`, `shipment.shipped`, `shipment.canceled`, `shipment.resumed`
270
+
271
+ Shipment payloads include nested `shipping_method`, `stock_location`, and `shipping_rates`.
272
+
273
+ ```json
274
+ {
275
+ "id": "shp_9xPq4wMn",
276
+ "number": "H123456789",
277
+ "state": "shipped",
278
+ "tracking": "1Z999AA10123456784",
279
+ "tracking_url": "https://tools.usps.com/go/TrackConfirmAction?tLabels=1Z999AA10123456784",
280
+ "cost": "10.00",
281
+ "display_cost": "$10.00",
282
+ "shipped_at": "2025-01-16T14:00:00Z",
283
+ "created_at": "2025-01-15T10:30:00Z",
284
+ "updated_at": "2025-01-16T14:00:00Z",
285
+ "shipping_method": {
286
+ "id": "sm_2wMn7xRt",
287
+ "..."
288
+ },
289
+ "stock_location": {
290
+ "id": "sl_2wMn7xRt",
291
+ "..."
292
+ },
293
+ "shipping_rates": []
294
+ }
295
+ ```
296
+
297
+ ## Product Events
298
+
299
+ Events: `product.created`, `product.updated`, `product.deleted`, `product.activate`, `product.archive`, `product.out_of_stock`, `product.back_in_stock`
300
+
301
+ Product event payloads include pricing, stock status, and availability flags. Conditional associations (variants, images, option types, taxons, metafields) are not included in event payloads.
302
+
303
+ ```json
304
+ {
305
+ "id": "prod_86Rf07xd4z",
306
+ "name": "Spree Tote Bag",
307
+ "slug": "spree-tote-bag",
308
+ "description": "A beautiful tote bag",
309
+ "meta_description": null,
310
+ "meta_keywords": null,
311
+ "variant_count": 3,
312
+ "default_variant_id": "var_k5nR8xLq",
313
+ "thumbnail_url": "https://cdn.example.com/images/tote-bag.jpg",
314
+ "purchasable": true,
315
+ "in_stock": true,
316
+ "backorderable": false,
317
+ "available": true,
318
+ "tags": ["summer", "accessories"],
319
+ "price": {
320
+ "id": "pri_4wPq9mXz",
321
+ "amount": "29.99",
322
+ "amount_in_cents": 2999,
323
+ "display_amount": "$29.99",
324
+ "compare_at_amount": null,
325
+ "compare_at_amount_in_cents": null,
326
+ "display_compare_at_amount": null,
327
+ "currency": "USD",
328
+ "price_list_id": null
329
+ },
330
+ "original_price": null,
331
+ "available_on": "2025-01-01T00:00:00Z",
332
+ "created_at": "2025-01-01T00:00:00Z",
333
+ "updated_at": "2025-01-15T10:00:00Z"
334
+ }
335
+ ```
336
+
337
+ ## Variant Events
338
+
339
+ Events: `variant.created`, `variant.updated`, `variant.deleted`
340
+
341
+ Variant event payloads include pricing, stock status, and always-included `option_values`. Conditional associations (images, metafields) are not included in event payloads.
342
+
343
+ ```json
344
+ {
345
+ "id": "var_k5nR8xLq",
346
+ "product_id": "prod_86Rf07xd4z",
347
+ "sku": "SPR-TOTE-BLK",
348
+ "is_master": false,
349
+ "options_text": "Size: M, Color: Black",
350
+ "track_inventory": true,
351
+ "image_count": 2,
352
+ "thumbnail": "https://cdn.example.com/images/tote-bag-black.jpg",
353
+ "purchasable": true,
354
+ "in_stock": true,
355
+ "backorderable": false,
356
+ "weight": 0.5,
357
+ "height": 40.0,
358
+ "width": 35.0,
359
+ "depth": 10.0,
360
+ "price": {
361
+ "id": "pri_4wPq9mXz",
362
+ "amount": "29.99",
363
+ "amount_in_cents": 2999,
364
+ "display_amount": "$29.99",
365
+ "compare_at_amount": null,
366
+ "compare_at_amount_in_cents": null,
367
+ "display_compare_at_amount": null,
368
+ "currency": "USD",
369
+ "price_list_id": null
370
+ },
371
+ "original_price": null,
372
+ "created_at": "2025-01-01T00:00:00Z",
373
+ "updated_at": "2025-01-15T10:00:00Z",
374
+ "option_values": [
375
+ { "id": "ov_2wMn9xPq", "name": "M", "presentation": "Medium" },
376
+ { "id": "ov_3xLq8nRt", "name": "Black", "presentation": "Black" }
377
+ ]
378
+ }
379
+ ```
380
+
381
+ ## Price Events
382
+
383
+ Events: `price.created`, `price.updated`, `price.deleted`
384
+
385
+ ```json
386
+ {
387
+ "id": "pri_4wPq9mXz",
388
+ "amount": "29.99",
389
+ "amount_in_cents": 2999,
390
+ "display_amount": "$29.99",
391
+ "compare_at_amount": "39.99",
392
+ "compare_at_amount_in_cents": 3999,
393
+ "display_compare_at_amount": "$39.99",
394
+ "currency": "USD",
395
+ "price_list_id": null
396
+ }
397
+ ```
398
+
399
+ ## Image Events
400
+
401
+ Events: `image.created`, `image.updated`, `image.deleted`
402
+
403
+ Image payloads include URLs for all configured image variants (mini, small, medium, large, xlarge).
404
+
405
+ ```json
406
+ {
407
+ "id": "img_5mXz3wPq",
408
+ "type": "Spree::Image",
409
+ "viewable_type": "Spree::Variant",
410
+ "viewable_id": "var_k5nR8xLq",
411
+ "position": 1,
412
+ "alt": "Black tote bag front view",
413
+ "original_url": "https://cdn.example.com/images/original.jpg",
414
+ "mini_url": "https://cdn.example.com/images/mini.jpg",
415
+ "small_url": "https://cdn.example.com/images/small.jpg",
416
+ "medium_url": "https://cdn.example.com/images/medium.jpg",
417
+ "large_url": "https://cdn.example.com/images/large.jpg",
418
+ "xlarge_url": "https://cdn.example.com/images/xlarge.jpg",
419
+ "og_image_url": "https://cdn.example.com/images/og.jpg",
420
+ "created_at": "2025-01-01T00:00:00Z",
421
+ "updated_at": "2025-01-01T00:00:00Z"
422
+ }
423
+ ```
424
+
425
+ ## Stock Item Events
426
+
427
+ Events: `stock_item.created`, `stock_item.updated`, `stock_item.deleted`
428
+
429
+ ```json
430
+ {
431
+ "id": "si_6nRt2xLq",
432
+ "count_on_hand": 25,
433
+ "backorderable": false,
434
+ "stock_location_id": "sl_2wMn7xRt",
435
+ "variant_id": "var_k5nR8xLq",
436
+ "created_at": "2025-01-01T00:00:00Z",
437
+ "updated_at": "2025-01-15T10:00:00Z"
438
+ }
439
+ ```
440
+
441
+ ## Stock Movement Events
442
+
443
+ Events: `stock_movement.created`, `stock_movement.updated`, `stock_movement.deleted`
444
+
445
+ ```json
446
+ {
447
+ "id": "sm_7xRt4wPq",
448
+ "quantity": -1,
449
+ "action": "sold",
450
+ "originator_type": "Spree::Shipment",
451
+ "originator_id": "shp_9xPq4wMn",
452
+ "stock_item_id": "si_6nRt2xLq",
453
+ "created_at": "2025-01-15T10:30:00Z",
454
+ "updated_at": "2025-01-15T10:30:00Z"
455
+ }
456
+ ```
457
+
458
+ ## Stock Transfer Events
459
+
460
+ Events: `stock_transfer.created`, `stock_transfer.updated`, `stock_transfer.deleted`
461
+
462
+ ```json
463
+ {
464
+ "id": "st_8mXz3wPq",
465
+ "number": "T123456789",
466
+ "type": "Spree::StockTransfer",
467
+ "reference": "Warehouse rebalance",
468
+ "source_location_id": "sl_2wMn7xRt",
469
+ "destination_location_id": "sl_9xPq4wMn",
470
+ "created_at": "2025-01-15T10:00:00Z",
471
+ "updated_at": "2025-01-15T10:00:00Z"
472
+ }
473
+ ```
474
+
475
+ ## Customer Events
476
+
477
+ Events: `customer.created`, `customer.updated`, `customer.deleted`
478
+
479
+ Customer payloads include nested `addresses`, `default_billing_address`, and `default_shipping_address`.
480
+
481
+ ```json
482
+ {
483
+ "id": "usr_k5nR8xLq",
484
+ "email": "customer@example.com",
485
+ "first_name": "John",
486
+ "last_name": "Doe",
487
+ "created_at": "2025-01-01T00:00:00Z",
488
+ "updated_at": "2025-01-15T10:00:00Z",
489
+ "addresses": [],
490
+ "default_billing_address": null,
491
+ "default_shipping_address": null
492
+ }
493
+ ```
494
+
495
+ ## Promotion Events
496
+
497
+ Events: `promotion.created`, `promotion.updated`, `promotion.deleted`
498
+
499
+ ```json
500
+ {
501
+ "id": "promo_2wMn9xPq",
502
+ "name": "Summer Sale 20% Off",
503
+ "description": "20% off all summer items",
504
+ "code": "SUMMER20",
505
+ "type": "Spree::Promotion",
506
+ "kind": "coupon",
507
+ "path": null,
508
+ "match_policy": "all",
509
+ "usage_limit": 1000,
510
+ "advertise": true,
511
+ "multi_codes": false,
512
+ "code_prefix": null,
513
+ "number_of_codes": null,
514
+ "starts_at": "2025-06-01T00:00:00Z",
515
+ "expires_at": "2025-08-31T23:59:59Z",
516
+ "promotion_category_id": "pcat_3xLq8nRt",
517
+ "created_at": "2025-05-15T10:00:00Z",
518
+ "updated_at": "2025-05-15T10:00:00Z"
519
+ }
520
+ ```
521
+
522
+ ## Gift Card Events
523
+
524
+ Events: `gift_card.created`, `gift_card.updated`, `gift_card.deleted`
525
+
526
+ ```json
527
+ {
528
+ "id": "gc_4xLq8nRt",
529
+ "code": "****-1234",
530
+ "state": "active",
531
+ "amount": 50.0,
532
+ "amount_used": 15.0,
533
+ "amount_authorized": 0.0,
534
+ "amount_remaining": 35.0,
535
+ "display_amount": "$50.00",
536
+ "display_amount_used": "$15.00",
537
+ "display_amount_remaining": "$35.00",
538
+ "currency": "USD",
539
+ "expired": false,
540
+ "active": true,
541
+ "expires_at": "2026-01-01T00:00:00Z",
542
+ "redeemed_at": "2025-02-01T10:00:00Z",
543
+ "created_at": "2025-01-01T00:00:00Z",
544
+ "updated_at": "2025-02-01T10:00:00Z"
545
+ }
546
+ ```
547
+
548
+ > **INFO:** The gift card `code` is displayed as a masked value (e.g., `****-1234`) for security.
549
+
550
+ ## Gift Card Batch Events
551
+
552
+ Events: `gift_card_batch.created`, `gift_card_batch.updated`, `gift_card_batch.deleted`
553
+
554
+ ```json
555
+ {
556
+ "id": "gcb_5wPq9mXz",
557
+ "codes_count": 100,
558
+ "amount": "25.00",
559
+ "currency": "USD",
560
+ "prefix": "HOLIDAY",
561
+ "expires_at": "2026-12-31T00:00:00Z",
562
+ "created_by_id": "adm_8mXz3wPq",
563
+ "created_at": "2025-01-01T00:00:00Z",
564
+ "updated_at": "2025-01-01T00:00:00Z"
565
+ }
566
+ ```
567
+
568
+ ## Store Credit Events
569
+
570
+ Events: `store_credit.created`, `store_credit.updated`, `store_credit.deleted`
571
+
572
+ ```json
573
+ {
574
+ "id": "sc_6nRt2xLq",
575
+ "amount": "100.00",
576
+ "amount_used": "25.00",
577
+ "amount_remaining": "75.00",
578
+ "display_amount": "$100.00",
579
+ "display_amount_used": "$25.00",
580
+ "display_amount_remaining": "$75.00",
581
+ "currency": "USD"
582
+ }
583
+ ```
584
+
585
+ ## Refund Events
586
+
587
+ Events: `refund.created`, `refund.updated`, `refund.deleted`
588
+
589
+ ```json
590
+ {
591
+ "id": "ref_7xRt4wPq",
592
+ "amount": "29.99",
593
+ "transaction_id": "txn_abc123",
594
+ "payment_id": "pay_3wXz7mRp",
595
+ "refund_reason_id": "rr_2wMn9xPq",
596
+ "reimbursement_id": "rei_3xLq8nRt",
597
+ "created_at": "2025-01-20T10:00:00Z",
598
+ "updated_at": "2025-01-20T10:00:00Z"
599
+ }
600
+ ```
601
+
602
+ ## Reimbursement Events
603
+
604
+ Events: `reimbursement.created`, `reimbursement.updated`, `reimbursement.deleted`
605
+
606
+ ```json
607
+ {
608
+ "id": "rei_3xLq8nRt",
609
+ "number": "RI123456789",
610
+ "reimbursement_status": "reimbursed",
611
+ "total": "29.99",
612
+ "order_id": "or_m3Rp9wXz",
613
+ "customer_return_id": "cr_4xLq8nRt",
614
+ "created_at": "2025-01-20T10:00:00Z",
615
+ "updated_at": "2025-01-20T10:00:00Z"
616
+ }
617
+ ```
618
+
619
+ ## Return Authorization Events
620
+
621
+ Events: `return_authorization.created`, `return_authorization.updated`, `return_authorization.deleted`
622
+
623
+ ```json
624
+ {
625
+ "id": "ra_8mXz3wPq",
626
+ "number": "RA123456789",
627
+ "state": "authorized",
628
+ "order_id": "or_m3Rp9wXz",
629
+ "stock_location_id": "sl_2wMn7xRt",
630
+ "return_authorization_reason_id": "rar_9xPq4wMn",
631
+ "created_at": "2025-01-18T10:00:00Z",
632
+ "updated_at": "2025-01-18T10:00:00Z"
633
+ }
634
+ ```
635
+
636
+ ## Return Item Events
637
+
638
+ Events: `return_item.created`, `return_item.updated`, `return_item.deleted`
639
+
640
+ ```json
641
+ {
642
+ "id": "ri_9xPq4wMn",
643
+ "reception_status": "received",
644
+ "acceptance_status": "accepted",
645
+ "pre_tax_amount": "29.99",
646
+ "included_tax_total": "0.00",
647
+ "additional_tax_total": "2.40",
648
+ "inventory_unit_id": "iu_2wMn7xRt",
649
+ "return_authorization_id": "ra_8mXz3wPq",
650
+ "customer_return_id": "cr_4xLq8nRt",
651
+ "reimbursement_id": "rei_3xLq8nRt",
652
+ "exchange_variant_id": null,
653
+ "created_at": "2025-01-19T10:00:00Z",
654
+ "updated_at": "2025-01-19T10:00:00Z"
655
+ }
656
+ ```
657
+
658
+ ## Customer Return Events
659
+
660
+ Events: `customer_return.created`, `customer_return.updated`, `customer_return.deleted`
661
+
662
+ ```json
663
+ {
664
+ "id": "cr_4xLq8nRt",
665
+ "number": "CR123456789",
666
+ "stock_location_id": "sl_2wMn7xRt",
667
+ "created_at": "2025-01-19T10:00:00Z",
668
+ "updated_at": "2025-01-19T10:00:00Z"
669
+ }
670
+ ```
671
+
672
+ ## Wishlist Events
673
+
674
+ Events: `wishlist.created`, `wishlist.updated`, `wishlist.deleted`
675
+
676
+ Wishlist items are a conditional association and are not included in event payloads.
677
+
678
+ ```json
679
+ {
680
+ "id": "wl_5wPq9mXz",
681
+ "name": "My Wishlist",
682
+ "token": "abc123def456",
683
+ "is_default": true,
684
+ "is_private": true,
685
+ "created_at": "2025-01-01T00:00:00Z",
686
+ "updated_at": "2025-01-15T10:00:00Z"
687
+ }
688
+ ```
689
+
690
+ ## Wished Item Events
691
+
692
+ Events: `wished_item.created`, `wished_item.updated`, `wished_item.deleted`
693
+
694
+ Wished item payloads include a nested `variant`.
695
+
696
+ ```json
697
+ {
698
+ "id": "wi_6nRt2xLq",
699
+ "variant_id": "var_k5nR8xLq",
700
+ "wishlist_id": "wl_5wPq9mXz",
701
+ "quantity": 1,
702
+ "created_at": "2025-01-15T10:00:00Z",
703
+ "updated_at": "2025-01-15T10:00:00Z",
704
+ "variant": {
705
+ "id": "var_k5nR8xLq",
706
+ "..."
707
+ }
708
+ }
709
+ ```
710
+
711
+ ## Post Events
712
+
713
+ Events: `post.created`, `post.updated`, `post.deleted`
714
+
715
+ ```json
716
+ {
717
+ "id": "post_7xRt4wPq",
718
+ "title": "Summer Collection 2025",
719
+ "slug": "summer-collection-2025",
720
+ "meta_title": "Summer Collection | My Store",
721
+ "meta_description": "Discover our new summer collection",
722
+ "published_at": "2025-06-01T00:00:00Z",
723
+ "author_id": "adm_8mXz3wPq",
724
+ "post_category_id": "pcat_9xPq4wMn",
725
+ "created_at": "2025-05-15T10:00:00Z",
726
+ "updated_at": "2025-05-15T10:00:00Z"
727
+ }
728
+ ```
729
+
730
+ ## Post Category Events
731
+
732
+ Events: `post_category.created`, `post_category.updated`, `post_category.deleted`
733
+
734
+ ```json
735
+ {
736
+ "id": "pcat_9xPq4wMn",
737
+ "title": "News",
738
+ "slug": "news",
739
+ "created_at": "2025-01-01T00:00:00Z",
740
+ "updated_at": "2025-01-01T00:00:00Z"
741
+ }
742
+ ```
743
+
744
+ ## Newsletter Subscriber Events
745
+
746
+ Events: `newsletter_subscriber.created`, `newsletter_subscriber.updated`, `newsletter_subscriber.deleted`
747
+
748
+ ```json
749
+ {
750
+ "id": "ns_2wMn9xPq",
751
+ "email": "subscriber@example.com",
752
+ "verified": true,
753
+ "verified_at": "2025-01-02T10:00:00Z",
754
+ "user_id": "usr_k5nR8xLq",
755
+ "created_at": "2025-01-01T00:00:00Z",
756
+ "updated_at": "2025-01-02T10:00:00Z"
757
+ }
758
+ ```
759
+
760
+ ## Digital Product Events
761
+
762
+ Events: `digital.created`, `digital.updated`, `digital.deleted`
763
+
764
+ ```json
765
+ {
766
+ "id": "dig_3xLq8nRt",
767
+ "variant_id": "var_k5nR8xLq",
768
+ "created_at": "2025-01-01T00:00:00Z",
769
+ "updated_at": "2025-01-01T00:00:00Z"
770
+ }
771
+ ```
772
+
773
+ ## Digital Link Events
774
+
775
+ Events: `digital_link.created`, `digital_link.updated`, `digital_link.deleted`
776
+
777
+ ```json
778
+ {
779
+ "id": "dl_4xLq8nRt",
780
+ "access_counter": 3,
781
+ "filename": "ebook.pdf",
782
+ "content_type": "application/pdf",
783
+ "download_url": "/api/v3/store/digital_downloads/abc123",
784
+ "authorizable": true,
785
+ "expired": false,
786
+ "access_limit_exceeded": false,
787
+ "created_at": "2025-01-15T10:30:00Z",
788
+ "updated_at": "2025-01-15T12:00:00Z"
789
+ }
790
+ ```
791
+
792
+ ## Import Events
793
+
794
+ Events: `import.created`, `import.updated`, `import.deleted`
795
+
796
+ ```json
797
+ {
798
+ "id": "imp_5wPq9mXz",
799
+ "number": "I123456789",
800
+ "type": "Spree::Imports::Products",
801
+ "status": "completed",
802
+ "owner_type": "Spree::Store",
803
+ "owner_id": "str_9xPq2wMn",
804
+ "user_id": "adm_8mXz3wPq",
805
+ "rows_count": 150,
806
+ "created_at": "2025-01-15T10:00:00Z",
807
+ "updated_at": "2025-01-15T10:05:00Z"
808
+ }
809
+ ```
810
+
811
+ ## Import Row Events
812
+
813
+ Events: `import_row.created`, `import_row.updated`, `import_row.deleted`
814
+
815
+ ```json
816
+ {
817
+ "id": "ir_6nRt2xLq",
818
+ "import_id": "imp_5wPq9mXz",
819
+ "row_number": 42,
820
+ "status": "success",
821
+ "validation_errors": [],
822
+ "item_type": "Spree::Product",
823
+ "item_id": "prod_86Rf07xd4z",
824
+ "created_at": "2025-01-15T10:01:00Z",
825
+ "updated_at": "2025-01-15T10:01:00Z"
826
+ }
827
+ ```
828
+
829
+ ## Export Events
830
+
831
+ Events: `export.created`, `export.updated`, `export.deleted`
832
+
833
+ ```json
834
+ {
835
+ "id": "exp_7xRt4wPq",
836
+ "number": "E123456789",
837
+ "type": "Spree::Exports::Products",
838
+ "format": "csv",
839
+ "user_id": "adm_8mXz3wPq",
840
+ "created_at": "2025-01-15T10:00:00Z",
841
+ "updated_at": "2025-01-15T10:02:00Z"
842
+ }
843
+ ```
844
+
845
+ ## Report Events
846
+
847
+ Events: `report.created`, `report.updated`, `report.deleted`
848
+
849
+ ```json
850
+ {
851
+ "id": "rep_8mXz3wPq",
852
+ "type": "Spree::Reports::SalesByProduct",
853
+ "user_id": "adm_8mXz3wPq",
854
+ "currency": "USD",
855
+ "date_from": "2025-01-01T00:00:00Z",
856
+ "date_to": "2025-01-31T23:59:59Z",
857
+ "created_at": "2025-02-01T10:00:00Z",
858
+ "updated_at": "2025-02-01T10:00:00Z"
859
+ }
860
+ ```
861
+
862
+ ## Invitation Events
863
+
864
+ Events: `invitation.created`, `invitation.updated`, `invitation.deleted`
865
+
866
+ ```json
867
+ {
868
+ "id": "inv_9xPq4wMn",
869
+ "email": "newadmin@example.com",
870
+ "status": "pending",
871
+ "resource_type": "Spree::Store",
872
+ "resource_id": "str_9xPq2wMn",
873
+ "inviter_type": "Spree::AdminUser",
874
+ "inviter_id": "adm_8mXz3wPq",
875
+ "invitee_type": null,
876
+ "invitee_id": null,
877
+ "role_id": "role_2wMn9xPq",
878
+ "expires_at": "2025-02-15T10:00:00Z",
879
+ "accepted_at": null,
880
+ "created_at": "2025-01-15T10:00:00Z",
881
+ "updated_at": "2025-01-15T10:00:00Z"
882
+ }
883
+ ```