@redotech/redo-api-schema 2.2.245 → 2.2.315

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.
package/lib/openapi.d.ts CHANGED
@@ -121,6 +121,24 @@ export interface paths {
121
121
  */
122
122
  post: operations["Customer subscriptions update"];
123
123
  };
124
+ "/stores/{storeId}/events": {
125
+ /**
126
+ * Create custom event
127
+ * @description Create a custom event to trigger flows with merchant-defined event names and properties.
128
+ *
129
+ * Custom events allow merchants to trigger flows based on events from their own systems.
130
+ * Events can include custom properties that are accessible in email and SMS templates.
131
+ *
132
+ * ## Customer Matching
133
+ * The API matches customers by email or phone number. At least one must be provided.
134
+ *
135
+ * If no matching customer is found, the request will fail with a 404 error.
136
+ *
137
+ * ## Rate Limiting
138
+ * This endpoint is rate-limited to 100 requests per second per store.
139
+ */
140
+ post: operations["Custom event create"];
141
+ };
124
142
  "/stores/{storeId}/invoices": {
125
143
  /**
126
144
  * List Invoices
@@ -325,6 +343,42 @@ export interface components {
325
343
  */
326
344
  price: components["schemas"]["money.schema"];
327
345
  };
346
+ /**
347
+ * Custom Event Request
348
+ * @description Custom event to trigger flows with merchant-defined event names and properties.
349
+ */
350
+ "custom-event-request.schema": {
351
+ /** @description Customer email address (one of email or phone is required). */
352
+ email?: string;
353
+ /** @description The name of the custom event (e.g., 'user_registered', 'purchase_completed'). */
354
+ event_name: string;
355
+ /**
356
+ * Format: date-time
357
+ * @description ISO 8601 timestamp when the event occurred. Defaults to current time if not provided.
358
+ */
359
+ event_timestamp?: string;
360
+ /** @description Customer phone number (one of email or phone is required). */
361
+ phone?: string;
362
+ /** @description Custom properties for this event. Access in templates using dot notation (e.g., {{ properties.product_name }}). */
363
+ properties?: {
364
+ [key: string]: unknown;
365
+ };
366
+ };
367
+ /**
368
+ * Custom Event Response
369
+ * @description Response after successfully creating a custom event.
370
+ */
371
+ "custom-event-response.schema": {
372
+ /** @description The unique identifier for the created event. */
373
+ event_id: string;
374
+ /** @description The name of the custom event that was created. */
375
+ event_name: string;
376
+ /**
377
+ * @description Status of the event processing.
378
+ * @enum {string}
379
+ */
380
+ status: "processed";
381
+ };
328
382
  /** @description Email subscription updates */
329
383
  "customer-subscription-email.schema": {
330
384
  /**
@@ -1862,6 +1916,65 @@ export interface operations {
1862
1916
  };
1863
1917
  };
1864
1918
  };
1919
+ /**
1920
+ * Create custom event
1921
+ * @description Create a custom event to trigger flows with merchant-defined event names and properties.
1922
+ *
1923
+ * Custom events allow merchants to trigger flows based on events from their own systems.
1924
+ * Events can include custom properties that are accessible in email and SMS templates.
1925
+ *
1926
+ * ## Customer Matching
1927
+ * The API matches customers by email or phone number. At least one must be provided.
1928
+ *
1929
+ * If no matching customer is found, the request will fail with a 404 error.
1930
+ *
1931
+ * ## Rate Limiting
1932
+ * This endpoint is rate-limited to 100 requests per second per store.
1933
+ */
1934
+ "Custom event create": {
1935
+ parameters: {
1936
+ path: {
1937
+ storeId: components["parameters"]["store-id.param"];
1938
+ };
1939
+ };
1940
+ requestBody: {
1941
+ content: {
1942
+ "application/json": components["schemas"]["custom-event-request.schema"];
1943
+ };
1944
+ };
1945
+ responses: {
1946
+ /** @description Event created successfully */
1947
+ 200: {
1948
+ content: {
1949
+ "application/json": components["schemas"]["custom-event-response.schema"];
1950
+ };
1951
+ };
1952
+ /** @description Invalid request body or missing required customer identifier */
1953
+ 400: {
1954
+ content: {
1955
+ "application/json": components["schemas"]["error.schema"];
1956
+ };
1957
+ };
1958
+ /** @description Customer not found with provided identifier */
1959
+ 404: {
1960
+ content: {
1961
+ "application/json": components["schemas"]["error.schema"];
1962
+ };
1963
+ };
1964
+ /** @description Rate limit exceeded */
1965
+ 429: {
1966
+ content: {
1967
+ "application/json": components["schemas"]["error.schema"];
1968
+ };
1969
+ };
1970
+ /** @description Error */
1971
+ default: {
1972
+ content: {
1973
+ "application/problem+json": components["schemas"]["error.schema"];
1974
+ };
1975
+ };
1976
+ };
1977
+ };
1865
1978
  /**
1866
1979
  * List Invoices
1867
1980
  * @description Get a list of invoices.
package/lib/openapi.yaml CHANGED
@@ -217,6 +217,52 @@ components:
217
217
  - price
218
218
  title: Coverage product
219
219
  type: object
220
+ custom-event-request.schema:
221
+ additionalProperties: false
222
+ description: Custom event to trigger flows with merchant-defined event names and properties.
223
+ properties:
224
+ email:
225
+ description: Customer email address (one of email or phone is required).
226
+ type: string
227
+ event_name:
228
+ description: The name of the custom event (e.g., 'user_registered', 'purchase_completed').
229
+ type: string
230
+ event_timestamp:
231
+ description: ISO 8601 timestamp when the event occurred. Defaults to current time if not provided.
232
+ format: date-time
233
+ type: string
234
+ phone:
235
+ description: Customer phone number (one of email or phone is required).
236
+ type: string
237
+ properties:
238
+ additionalProperties: true
239
+ description: Custom properties for this event. Access in templates using dot notation (e.g., {{ properties.product_name }}).
240
+ type: object
241
+ required:
242
+ - event_name
243
+ title: Custom Event Request
244
+ type: object
245
+ custom-event-response.schema:
246
+ additionalProperties: false
247
+ description: Response after successfully creating a custom event.
248
+ properties:
249
+ event_id:
250
+ description: The unique identifier for the created event.
251
+ type: string
252
+ event_name:
253
+ description: The name of the custom event that was created.
254
+ type: string
255
+ status:
256
+ description: Status of the event processing.
257
+ enum:
258
+ - processed
259
+ type: string
260
+ required:
261
+ - event_id
262
+ - status
263
+ - event_name
264
+ title: Custom Event Response
265
+ type: object
220
266
  customer-subscription-email.schema:
221
267
  description: Email subscription updates
222
268
  properties:
@@ -2087,6 +2133,85 @@ paths:
2087
2133
  tags:
2088
2134
  - Customer Subscriptions
2089
2135
  summary: Customer subscriptions
2136
+ /stores/{storeId}/events:
2137
+ post:
2138
+ description: |
2139
+ Create a custom event to trigger flows with merchant-defined event names and properties.
2140
+
2141
+ Custom events allow merchants to trigger flows based on events from their own systems.
2142
+ Events can include custom properties that are accessible in email and SMS templates.
2143
+
2144
+ ## Customer Matching
2145
+ The API matches customers by email or phone number. At least one must be provided.
2146
+
2147
+ If no matching customer is found, the request will fail with a 404 error.
2148
+
2149
+ ## Rate Limiting
2150
+ This endpoint is rate-limited to 100 requests per second per store.
2151
+ operationId: Custom event create
2152
+ parameters:
2153
+ - $ref: '#/components/parameters/store-id.param'
2154
+ requestBody:
2155
+ content:
2156
+ application/json:
2157
+ examples:
2158
+ purchase_milestone:
2159
+ summary: Purchase milestone event
2160
+ value:
2161
+ event_name: purchase_milestone_reached
2162
+ phone: '+12065551234'
2163
+ properties:
2164
+ milestone_type: 100th_purchase
2165
+ total_spent: 5000
2166
+ vip_tier: gold
2167
+ user_registered:
2168
+ summary: User registration event
2169
+ value:
2170
+ email: customer@example.com
2171
+ event_name: user_registered
2172
+ properties:
2173
+ plan_type: premium
2174
+ referral_code: FRIEND123
2175
+ source: mobile_app
2176
+ schema:
2177
+ $ref: '#/components/schemas/custom-event-request.schema'
2178
+ required: true
2179
+ responses:
2180
+ '200':
2181
+ content:
2182
+ application/json:
2183
+ schema:
2184
+ $ref: '#/components/schemas/custom-event-response.schema'
2185
+ description: Event created successfully
2186
+ '400':
2187
+ content:
2188
+ application/json:
2189
+ schema:
2190
+ $ref: '#/components/schemas/error.schema'
2191
+ description: Invalid request body or missing required customer identifier
2192
+ '404':
2193
+ content:
2194
+ application/json:
2195
+ schema:
2196
+ $ref: '#/components/schemas/error.schema'
2197
+ description: Customer not found with provided identifier
2198
+ '429':
2199
+ content:
2200
+ application/json:
2201
+ schema:
2202
+ $ref: '#/components/schemas/error.schema'
2203
+ description: Rate limit exceeded
2204
+ default:
2205
+ content:
2206
+ application/problem+json:
2207
+ schema:
2208
+ $ref: '#/components/schemas/error.schema'
2209
+ description: Error
2210
+ security:
2211
+ - Bearer: []
2212
+ summary: Create custom event
2213
+ tags:
2214
+ - Custom Events
2090
2215
  /stores/{storeId}/invoices:
2091
2216
  description: Return a list of invoices.
2092
2217
  get:
package/package.json CHANGED
@@ -31,5 +31,5 @@
31
31
  ]
32
32
  }
33
33
  },
34
- "version": "2.2.245"
34
+ "version": "2.2.315"
35
35
  }