@redotech/redo-api-schema 2.2.449 → 2.2.476
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 +195 -52
- package/lib/openapi.yaml +290 -91
- package/package.json +1 -1
package/lib/openapi.d.ts
CHANGED
|
@@ -165,18 +165,53 @@ export interface paths {
|
|
|
165
165
|
* @description Create a custom event to trigger flows with merchant-defined event names and properties.
|
|
166
166
|
*
|
|
167
167
|
* Custom events allow merchants to trigger flows based on events from their own systems.
|
|
168
|
-
* Events can include custom properties that are accessible in email and SMS templates
|
|
168
|
+
* Events can include custom properties that are accessible in email and SMS templates,
|
|
169
|
+
* and are persisted for segmentation and historical queries.
|
|
169
170
|
*
|
|
170
|
-
* ##
|
|
171
|
-
* The API
|
|
171
|
+
* ## Identity Resolution
|
|
172
|
+
* The API resolves customers using the following priority order:
|
|
173
|
+
* 1. `customer.id` — Redo customer ObjectId (highest priority)
|
|
174
|
+
* 2. `customer.email` — customer email address
|
|
175
|
+
* 3. `customer.phoneNumber` — customer phone number
|
|
172
176
|
*
|
|
173
|
-
* If no matching customer is found,
|
|
177
|
+
* At least one identifier must be provided. If no matching customer is found, one will
|
|
178
|
+
* be created automatically. If `customer.id` is provided but not found, the API falls
|
|
179
|
+
* back to email/phone rather than returning 404.
|
|
180
|
+
*
|
|
181
|
+
* ## Datetime Formatting
|
|
182
|
+
* All datetime values must be formatted as ISO 8601 (RFC 3339) strings, e.g., `2026-04-02T12:00:00Z`.
|
|
183
|
+
* This applies to `eventTimestamp`, any date-valued properties in `data`, and any date-valued `customFields`.
|
|
184
|
+
* Strings matching this format are automatically detected and indexed as dates for segmentation.
|
|
174
185
|
*
|
|
175
186
|
* ## Rate Limiting
|
|
176
187
|
* This endpoint is rate-limited to 100 requests per second per store.
|
|
177
188
|
*/
|
|
178
189
|
post: operations["Custom event create"];
|
|
179
190
|
};
|
|
191
|
+
"/stores/{storeId}/events/bulk": {
|
|
192
|
+
/**
|
|
193
|
+
* Bulk create custom events
|
|
194
|
+
* @description Create multiple custom events in a single request. Accepts up to 100 events per request.
|
|
195
|
+
*
|
|
196
|
+
* Each event is validated independently. The response includes per-event results, allowing
|
|
197
|
+
* partial failures — some events may be accepted while others are rejected due to validation
|
|
198
|
+
* errors.
|
|
199
|
+
*
|
|
200
|
+
* ## Identity Resolution
|
|
201
|
+
* Each event resolves customers independently using the same priority order as the
|
|
202
|
+
* single-event endpoint:
|
|
203
|
+
* 1. `customer.id` — Redo customer ObjectId (highest priority)
|
|
204
|
+
* 2. `customer.email` — customer email address
|
|
205
|
+
* 3. `customer.phoneNumber` — customer phone number
|
|
206
|
+
*
|
|
207
|
+
* At least one identifier must be provided per event. If no matching customer is found,
|
|
208
|
+
* one will be created automatically.
|
|
209
|
+
*
|
|
210
|
+
* ## Rate Limiting
|
|
211
|
+
* This endpoint is rate-limited to 100 requests per second per store.
|
|
212
|
+
*/
|
|
213
|
+
post: operations["Bulk create custom events"];
|
|
214
|
+
};
|
|
180
215
|
"/stores/{storeId}/invoices": {
|
|
181
216
|
/**
|
|
182
217
|
* List Invoices
|
|
@@ -392,6 +427,14 @@ export interface components {
|
|
|
392
427
|
*/
|
|
393
428
|
state: string;
|
|
394
429
|
};
|
|
430
|
+
/**
|
|
431
|
+
* Bulk Custom Event Request
|
|
432
|
+
* @description Request body for sending multiple custom events in a single request.
|
|
433
|
+
*/
|
|
434
|
+
"bulk-custom-event-request.schema": {
|
|
435
|
+
/** @description Array of custom events to create. */
|
|
436
|
+
events: components["schemas"]["custom-event-request.schema"][];
|
|
437
|
+
};
|
|
395
438
|
/**
|
|
396
439
|
* Product Family Image
|
|
397
440
|
* @description An image associated with a product family or variant.
|
|
@@ -795,49 +838,77 @@ export interface components {
|
|
|
795
838
|
* @description Custom event to trigger flows with merchant-defined event names and properties.
|
|
796
839
|
*/
|
|
797
840
|
"custom-event-request.schema": {
|
|
798
|
-
/** @description
|
|
799
|
-
|
|
800
|
-
/** @description
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
841
|
+
/** @description Customer identity and profile fields. At least one of `id`, `email`, or `phoneNumber` is required for identity resolution. */
|
|
842
|
+
customer: {
|
|
843
|
+
/** @description Merchant-defined customer attributes as key-value pairs. Values can be strings, numbers, or booleans. Date values should be passed as ISO 8601 strings (e.g., "2026-04-02T12:00:00Z") and are automatically detected and indexed as dates. */
|
|
844
|
+
customFields?: {
|
|
845
|
+
[key: string]: string | number | boolean;
|
|
846
|
+
};
|
|
847
|
+
/**
|
|
848
|
+
* Format: email
|
|
849
|
+
* @description Customer email address. Used for identity resolution.
|
|
850
|
+
*/
|
|
851
|
+
email?: string;
|
|
852
|
+
/** @description Customer first name. Applied with patch semantics — does not erase existing value if omitted. */
|
|
853
|
+
firstName?: string;
|
|
854
|
+
/** @description Redo customer ObjectId. Used for identity resolution. Takes priority over email and phoneNumber when provided. */
|
|
855
|
+
id?: string;
|
|
856
|
+
/** @description Customer last name. Applied with patch semantics — does not erase existing value if omitted. */
|
|
857
|
+
lastName?: string;
|
|
858
|
+
/** @description Customer location for profile enrichment. All fields are optional. */
|
|
859
|
+
location?: {
|
|
860
|
+
/** @description City name. */
|
|
861
|
+
city?: string;
|
|
862
|
+
/** @description Country name. */
|
|
863
|
+
country?: string;
|
|
864
|
+
/** @description ISO 3166-1 alpha-2 country code (e.g., "US", "GB"). */
|
|
865
|
+
countryCode?: string;
|
|
866
|
+
/** @description IANA time zone identifier (e.g., "America/New_York"). */
|
|
867
|
+
ianaTimeZoneName?: string;
|
|
868
|
+
/** @description Geographic latitude coordinate. */
|
|
869
|
+
latitude?: number;
|
|
870
|
+
/** @description Geographic longitude coordinate. */
|
|
871
|
+
longitude?: number;
|
|
872
|
+
/** @description Postal or ZIP code. */
|
|
873
|
+
postalCode?: string;
|
|
874
|
+
/** @description State or province name. */
|
|
875
|
+
state?: string;
|
|
876
|
+
/** @description State or province abbreviation (e.g., "CA", "NY"). */
|
|
877
|
+
stateCode?: string;
|
|
878
|
+
/** @description Primary street address. */
|
|
879
|
+
street1?: string;
|
|
880
|
+
/** @description Secondary address line (apartment, suite, etc.). */
|
|
881
|
+
street2?: string;
|
|
882
|
+
};
|
|
883
|
+
/** @description Customer phone number in E.164 format. Used for identity resolution. */
|
|
884
|
+
phoneNumber?: string;
|
|
885
|
+
};
|
|
886
|
+
/**
|
|
887
|
+
* @description Custom properties for this event (must not exceed 400 properties). The size of the event payload must not exceed 5 MB, and each string cannot be larger than 100 KB. For a full list of data limits on event payloads, see [Limitations](/docs/guides/integrations/custom-events#rate-limits).
|
|
888
|
+
*
|
|
889
|
+
* Note any top-level property that is not an object can be used to create segments. The `$extra` property records any non-segmentable values that can be referenced later, e.g., HTML templates are useful on a segment but are not used to create a segment.
|
|
818
890
|
*/
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
[key: string]:
|
|
891
|
+
data?: {
|
|
892
|
+
/** @description Non-segmentable metadata bucket. Values inside `$extra` are stored on the event but excluded from segmentation indexes. Unlike top-level data properties, values of 0, null, and empty string are NOT stripped inside `$extra`. Use this for large text, debug info, nested objects, arrays, or any data you want to reference in templates but not segment on. */
|
|
893
|
+
$extra?: {
|
|
894
|
+
[key: string]: unknown;
|
|
895
|
+
};
|
|
896
|
+
[key: string]: (string | number | boolean) | undefined;
|
|
825
897
|
};
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
* Custom Event Response
|
|
829
|
-
* @description Response after successfully creating a custom event.
|
|
830
|
-
*/
|
|
831
|
-
"custom-event-response.schema": {
|
|
832
|
-
/** @description The unique identifier for the created event. */
|
|
833
|
-
event_id: string;
|
|
834
|
-
/** @description The name of the custom event that was created. */
|
|
835
|
-
event_name: string;
|
|
898
|
+
/** @description The name of the custom event (e.g., 'User Registered', 'Loyalty Reward Earned'). */
|
|
899
|
+
eventName: string;
|
|
836
900
|
/**
|
|
837
|
-
*
|
|
838
|
-
* @
|
|
901
|
+
* Format: date-time
|
|
902
|
+
* @description ISO 8601 timestamp when the event occurred. Defaults to current time if not provided.
|
|
839
903
|
*/
|
|
840
|
-
|
|
904
|
+
eventTimestamp?: string;
|
|
905
|
+
/** @description Merchant-controlled deduplication key (1-255 characters). If provided, subsequent events with the same uniqueId for the same store are silently deduplicated. Use this for safe retries and at-least-once delivery patterns. */
|
|
906
|
+
uniqueId?: string;
|
|
907
|
+
/** @description Monetary or conversion value associated with the event (e.g., purchase amount). */
|
|
908
|
+
value?: number;
|
|
909
|
+
/** @description ISO 4217 currency code for the value field (e.g., "USD", "EUR"). */
|
|
910
|
+
valueCurrency?: string;
|
|
911
|
+
[key: string]: unknown;
|
|
841
912
|
};
|
|
842
913
|
/**
|
|
843
914
|
* Customer Location
|
|
@@ -2918,12 +2989,23 @@ export interface operations {
|
|
|
2918
2989
|
* @description Create a custom event to trigger flows with merchant-defined event names and properties.
|
|
2919
2990
|
*
|
|
2920
2991
|
* Custom events allow merchants to trigger flows based on events from their own systems.
|
|
2921
|
-
* Events can include custom properties that are accessible in email and SMS templates
|
|
2992
|
+
* Events can include custom properties that are accessible in email and SMS templates,
|
|
2993
|
+
* and are persisted for segmentation and historical queries.
|
|
2994
|
+
*
|
|
2995
|
+
* ## Identity Resolution
|
|
2996
|
+
* The API resolves customers using the following priority order:
|
|
2997
|
+
* 1. `customer.id` — Redo customer ObjectId (highest priority)
|
|
2998
|
+
* 2. `customer.email` — customer email address
|
|
2999
|
+
* 3. `customer.phoneNumber` — customer phone number
|
|
2922
3000
|
*
|
|
2923
|
-
*
|
|
2924
|
-
*
|
|
3001
|
+
* At least one identifier must be provided. If no matching customer is found, one will
|
|
3002
|
+
* be created automatically. If `customer.id` is provided but not found, the API falls
|
|
3003
|
+
* back to email/phone rather than returning 404.
|
|
2925
3004
|
*
|
|
2926
|
-
*
|
|
3005
|
+
* ## Datetime Formatting
|
|
3006
|
+
* All datetime values must be formatted as ISO 8601 (RFC 3339) strings, e.g., `2026-04-02T12:00:00Z`.
|
|
3007
|
+
* This applies to `eventTimestamp`, any date-valued properties in `data`, and any date-valued `customFields`.
|
|
3008
|
+
* Strings matching this format are automatically detected and indexed as dates for segmentation.
|
|
2927
3009
|
*
|
|
2928
3010
|
* ## Rate Limiting
|
|
2929
3011
|
* This endpoint is rate-limited to 100 requests per second per store.
|
|
@@ -2940,19 +3022,80 @@ export interface operations {
|
|
|
2940
3022
|
};
|
|
2941
3023
|
};
|
|
2942
3024
|
responses: {
|
|
2943
|
-
/** @description Event
|
|
2944
|
-
|
|
3025
|
+
/** @description Event accepted and queued for processing. No response body is returned. */
|
|
3026
|
+
202: {
|
|
3027
|
+
content: never;
|
|
3028
|
+
};
|
|
3029
|
+
/** @description Invalid request body or missing required customer identifier */
|
|
3030
|
+
400: {
|
|
2945
3031
|
content: {
|
|
2946
|
-
"application/json": components["schemas"]["
|
|
3032
|
+
"application/json": components["schemas"]["error.schema"];
|
|
2947
3033
|
};
|
|
2948
3034
|
};
|
|
2949
|
-
/** @description
|
|
3035
|
+
/** @description Store not found */
|
|
3036
|
+
404: {
|
|
3037
|
+
content: {
|
|
3038
|
+
"application/json": components["schemas"]["error.schema"];
|
|
3039
|
+
};
|
|
3040
|
+
};
|
|
3041
|
+
/** @description Rate limit exceeded */
|
|
3042
|
+
429: {
|
|
3043
|
+
content: {
|
|
3044
|
+
"application/json": components["schemas"]["error.schema"];
|
|
3045
|
+
};
|
|
3046
|
+
};
|
|
3047
|
+
/** @description Error */
|
|
3048
|
+
default: {
|
|
3049
|
+
content: {
|
|
3050
|
+
"application/problem+json": components["schemas"]["error.schema"];
|
|
3051
|
+
};
|
|
3052
|
+
};
|
|
3053
|
+
};
|
|
3054
|
+
};
|
|
3055
|
+
/**
|
|
3056
|
+
* Bulk create custom events
|
|
3057
|
+
* @description Create multiple custom events in a single request. Accepts up to 100 events per request.
|
|
3058
|
+
*
|
|
3059
|
+
* Each event is validated independently. The response includes per-event results, allowing
|
|
3060
|
+
* partial failures — some events may be accepted while others are rejected due to validation
|
|
3061
|
+
* errors.
|
|
3062
|
+
*
|
|
3063
|
+
* ## Identity Resolution
|
|
3064
|
+
* Each event resolves customers independently using the same priority order as the
|
|
3065
|
+
* single-event endpoint:
|
|
3066
|
+
* 1. `customer.id` — Redo customer ObjectId (highest priority)
|
|
3067
|
+
* 2. `customer.email` — customer email address
|
|
3068
|
+
* 3. `customer.phoneNumber` — customer phone number
|
|
3069
|
+
*
|
|
3070
|
+
* At least one identifier must be provided per event. If no matching customer is found,
|
|
3071
|
+
* one will be created automatically.
|
|
3072
|
+
*
|
|
3073
|
+
* ## Rate Limiting
|
|
3074
|
+
* This endpoint is rate-limited to 100 requests per second per store.
|
|
3075
|
+
*/
|
|
3076
|
+
"Bulk create custom events": {
|
|
3077
|
+
parameters: {
|
|
3078
|
+
path: {
|
|
3079
|
+
storeId: components["parameters"]["store-id.param"];
|
|
3080
|
+
};
|
|
3081
|
+
};
|
|
3082
|
+
requestBody: {
|
|
3083
|
+
content: {
|
|
3084
|
+
"application/json": components["schemas"]["bulk-custom-event-request.schema"];
|
|
3085
|
+
};
|
|
3086
|
+
};
|
|
3087
|
+
responses: {
|
|
3088
|
+
/** @description Bulk request accepted and queued for processing. No response body is returned. */
|
|
3089
|
+
202: {
|
|
3090
|
+
content: never;
|
|
3091
|
+
};
|
|
3092
|
+
/** @description Invalid request body (e.g., events array missing or exceeds 100 items) */
|
|
2950
3093
|
400: {
|
|
2951
3094
|
content: {
|
|
2952
3095
|
"application/json": components["schemas"]["error.schema"];
|
|
2953
3096
|
};
|
|
2954
3097
|
};
|
|
2955
|
-
/** @description
|
|
3098
|
+
/** @description Store not found */
|
|
2956
3099
|
404: {
|
|
2957
3100
|
content: {
|
|
2958
3101
|
"application/json": components["schemas"]["error.schema"];
|
package/lib/openapi.yaml
CHANGED
|
@@ -190,16 +190,28 @@ paths:
|
|
|
190
190
|
Create a custom event to trigger flows with merchant-defined event names and properties.
|
|
191
191
|
|
|
192
192
|
Custom events allow merchants to trigger flows based on events from their own systems.
|
|
193
|
-
Events can include custom properties that are accessible in email and SMS templates
|
|
193
|
+
Events can include custom properties that are accessible in email and SMS templates,
|
|
194
|
+
and are persisted for segmentation and historical queries.
|
|
194
195
|
|
|
195
|
-
##
|
|
196
|
-
The API
|
|
196
|
+
## Identity Resolution
|
|
197
|
+
The API resolves customers using the following priority order:
|
|
198
|
+
1. `customer.id` — Redo customer ObjectId (highest priority)
|
|
199
|
+
2. `customer.email` — customer email address
|
|
200
|
+
3. `customer.phoneNumber` — customer phone number
|
|
197
201
|
|
|
198
|
-
If no matching customer is found,
|
|
202
|
+
At least one identifier must be provided. If no matching customer is found, one will
|
|
203
|
+
be created automatically. If `customer.id` is provided but not found, the API falls
|
|
204
|
+
back to email/phone rather than returning 404.
|
|
205
|
+
|
|
206
|
+
## Datetime Formatting
|
|
207
|
+
All datetime values must be formatted as ISO 8601 (RFC 3339) strings, e.g., `2026-04-02T12:00:00Z`.
|
|
208
|
+
This applies to `eventTimestamp`, any date-valued properties in `data`, and any date-valued `customFields`.
|
|
209
|
+
Strings matching this format are automatically detected and indexed as dates for segmentation.
|
|
199
210
|
|
|
200
211
|
## Rate Limiting
|
|
201
212
|
This endpoint is rate-limited to 100 requests per second per store.
|
|
202
213
|
operationId: Custom event create
|
|
214
|
+
x-express-openapi-disable-validation-middleware: true
|
|
203
215
|
parameters:
|
|
204
216
|
- $ref: '#/components/parameters/store-id.param'
|
|
205
217
|
requestBody:
|
|
@@ -208,44 +220,173 @@ paths:
|
|
|
208
220
|
schema:
|
|
209
221
|
$ref: '#/components/schemas/custom-event-request.schema'
|
|
210
222
|
examples:
|
|
211
|
-
|
|
212
|
-
summary:
|
|
223
|
+
full_example:
|
|
224
|
+
summary: Every field populated
|
|
213
225
|
value:
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
226
|
+
eventName: Purchase Milestone Reached
|
|
227
|
+
customer:
|
|
228
|
+
id: 665f1a2b3c4d5e6f7a8b9c0d
|
|
229
|
+
email: stewart@example.com
|
|
230
|
+
phoneNumber: '+11234567890'
|
|
231
|
+
firstName: Stewart
|
|
232
|
+
lastName: Thompson
|
|
233
|
+
location:
|
|
234
|
+
street1: 123 Main St
|
|
235
|
+
street2: Apt 4B
|
|
236
|
+
city: Seattle
|
|
237
|
+
state: Washington
|
|
238
|
+
stateCode: WA
|
|
239
|
+
postalCode: '98101'
|
|
240
|
+
country: United States
|
|
241
|
+
countryCode: US
|
|
242
|
+
ianaTimeZoneName: America/Los_Angeles
|
|
243
|
+
latitude: 47.6062
|
|
244
|
+
longitude: -122.3321
|
|
245
|
+
customFields:
|
|
246
|
+
Age at Signup: 25
|
|
247
|
+
Birthday: '1976-07-04T12:00:00Z'
|
|
248
|
+
Loyalty Tier: Gold
|
|
249
|
+
Accepts Marketing: true
|
|
250
|
+
eventTimestamp: '2026-04-02T12:00:00Z'
|
|
251
|
+
value: 299.99
|
|
252
|
+
valueCurrency: USD
|
|
253
|
+
uniqueId: milestone-test-001
|
|
254
|
+
data:
|
|
255
|
+
Milestone Type: 100th_purchase
|
|
256
|
+
Total Spent: 5000
|
|
257
|
+
VIP Tier: gold
|
|
258
|
+
Enrolled At: '2025-01-01T00:00:00Z'
|
|
259
|
+
Campaign Source: email_drip
|
|
260
|
+
Last Purchase Date: '2026-03-15T00:00:00Z'
|
|
261
|
+
$extra:
|
|
262
|
+
Most Recent Order IDs:
|
|
263
|
+
- 1
|
|
264
|
+
- 2
|
|
265
|
+
- 3
|
|
266
|
+
Profile Snapshot:
|
|
267
|
+
tier: gold
|
|
268
|
+
memberSince: '2024-01-01'
|
|
269
|
+
medium_example:
|
|
270
|
+
summary: Event with customer profile and data
|
|
222
271
|
value:
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
272
|
+
eventName: Order Placed
|
|
273
|
+
customer:
|
|
274
|
+
email: stewart@example.com
|
|
275
|
+
firstName: Stewart
|
|
276
|
+
lastName: Thompson
|
|
277
|
+
customFields:
|
|
278
|
+
Birthday: '1976-07-04T12:00:00Z'
|
|
279
|
+
Loyalty Tier: Gold
|
|
280
|
+
value: 149.99
|
|
281
|
+
valueCurrency: USD
|
|
282
|
+
data:
|
|
283
|
+
Order Id: ord_456
|
|
284
|
+
Item Count: 3
|
|
285
|
+
Category: apparel
|
|
286
|
+
minimal:
|
|
287
|
+
summary: Required fields only
|
|
288
|
+
value:
|
|
289
|
+
eventName: Page Viewed
|
|
290
|
+
customer:
|
|
291
|
+
email: stewart@example.com
|
|
229
292
|
required: true
|
|
230
293
|
responses:
|
|
231
|
-
'
|
|
294
|
+
'202':
|
|
295
|
+
description: Event accepted and queued for processing. No response body is returned.
|
|
296
|
+
'400':
|
|
232
297
|
content:
|
|
233
298
|
application/json:
|
|
234
299
|
schema:
|
|
235
|
-
$ref: '#/components/schemas/
|
|
236
|
-
description:
|
|
300
|
+
$ref: '#/components/schemas/error.schema'
|
|
301
|
+
description: Invalid request body or missing required customer identifier
|
|
302
|
+
'404':
|
|
303
|
+
content:
|
|
304
|
+
application/json:
|
|
305
|
+
schema:
|
|
306
|
+
$ref: '#/components/schemas/error.schema'
|
|
307
|
+
description: Store not found
|
|
308
|
+
'429':
|
|
309
|
+
content:
|
|
310
|
+
application/json:
|
|
311
|
+
schema:
|
|
312
|
+
$ref: '#/components/schemas/error.schema'
|
|
313
|
+
description: Rate limit exceeded
|
|
314
|
+
default:
|
|
315
|
+
content:
|
|
316
|
+
application/problem+json:
|
|
317
|
+
schema:
|
|
318
|
+
$ref: '#/components/schemas/error.schema'
|
|
319
|
+
description: Error
|
|
320
|
+
security:
|
|
321
|
+
- Bearer: []
|
|
322
|
+
summary: Create custom event
|
|
323
|
+
tags:
|
|
324
|
+
- Custom Events
|
|
325
|
+
/stores/{storeId}/events/bulk:
|
|
326
|
+
post:
|
|
327
|
+
description: |
|
|
328
|
+
Create multiple custom events in a single request. Accepts up to 100 events per request.
|
|
329
|
+
|
|
330
|
+
Each event is validated independently. The response includes per-event results, allowing
|
|
331
|
+
partial failures — some events may be accepted while others are rejected due to validation
|
|
332
|
+
errors.
|
|
333
|
+
|
|
334
|
+
## Identity Resolution
|
|
335
|
+
Each event resolves customers independently using the same priority order as the
|
|
336
|
+
single-event endpoint:
|
|
337
|
+
1. `customer.id` — Redo customer ObjectId (highest priority)
|
|
338
|
+
2. `customer.email` — customer email address
|
|
339
|
+
3. `customer.phoneNumber` — customer phone number
|
|
340
|
+
|
|
341
|
+
At least one identifier must be provided per event. If no matching customer is found,
|
|
342
|
+
one will be created automatically.
|
|
343
|
+
|
|
344
|
+
## Rate Limiting
|
|
345
|
+
This endpoint is rate-limited to 100 requests per second per store.
|
|
346
|
+
operationId: Bulk create custom events
|
|
347
|
+
x-express-openapi-disable-validation-middleware: true
|
|
348
|
+
parameters:
|
|
349
|
+
- $ref: '#/components/parameters/store-id.param'
|
|
350
|
+
requestBody:
|
|
351
|
+
content:
|
|
352
|
+
application/json:
|
|
353
|
+
schema:
|
|
354
|
+
$ref: '#/components/schemas/bulk-custom-event-request.schema'
|
|
355
|
+
examples:
|
|
356
|
+
mixed_events:
|
|
357
|
+
summary: Bulk event creation with multiple event types
|
|
358
|
+
value:
|
|
359
|
+
events:
|
|
360
|
+
- eventName: User Registered
|
|
361
|
+
customer:
|
|
362
|
+
email: alice@example.com
|
|
363
|
+
data:
|
|
364
|
+
Plan Type: premium
|
|
365
|
+
- eventName: Purchase Completed
|
|
366
|
+
customer:
|
|
367
|
+
email: bob@example.com
|
|
368
|
+
data:
|
|
369
|
+
Order Total: 99.99
|
|
370
|
+
Item Count: 3
|
|
371
|
+
value: 99.99
|
|
372
|
+
valueCurrency: USD
|
|
373
|
+
uniqueId: order-456
|
|
374
|
+
required: true
|
|
375
|
+
responses:
|
|
376
|
+
'202':
|
|
377
|
+
description: Bulk request accepted and queued for processing. No response body is returned.
|
|
237
378
|
'400':
|
|
238
379
|
content:
|
|
239
380
|
application/json:
|
|
240
381
|
schema:
|
|
241
382
|
$ref: '#/components/schemas/error.schema'
|
|
242
|
-
description: Invalid request body
|
|
383
|
+
description: Invalid request body (e.g., events array missing or exceeds 100 items)
|
|
243
384
|
'404':
|
|
244
385
|
content:
|
|
245
386
|
application/json:
|
|
246
387
|
schema:
|
|
247
388
|
$ref: '#/components/schemas/error.schema'
|
|
248
|
-
description:
|
|
389
|
+
description: Store not found
|
|
249
390
|
'429':
|
|
250
391
|
content:
|
|
251
392
|
application/json:
|
|
@@ -260,7 +401,7 @@ paths:
|
|
|
260
401
|
description: Error
|
|
261
402
|
security:
|
|
262
403
|
- Bearer: []
|
|
263
|
-
summary:
|
|
404
|
+
summary: Bulk create custom events
|
|
264
405
|
tags:
|
|
265
406
|
- Custom Events
|
|
266
407
|
/stores/{storeId}/customer-portal:
|
|
@@ -1921,83 +2062,141 @@ components:
|
|
|
1921
2062
|
title: Coverage product
|
|
1922
2063
|
type: object
|
|
1923
2064
|
custom-event-request.schema:
|
|
1924
|
-
additionalProperties:
|
|
1925
|
-
description:
|
|
2065
|
+
additionalProperties: true
|
|
2066
|
+
description: |
|
|
2067
|
+
Custom event to trigger flows with merchant-defined event names and properties.
|
|
1926
2068
|
properties:
|
|
1927
|
-
|
|
1928
|
-
description: The name of the custom event (e.g., '
|
|
1929
|
-
type: string
|
|
1930
|
-
email:
|
|
1931
|
-
description: Customer email address (one of email or phone is required).
|
|
1932
|
-
type: string
|
|
1933
|
-
phone:
|
|
1934
|
-
description: Customer phone number (one of email or phone is required).
|
|
2069
|
+
eventName:
|
|
2070
|
+
description: The name of the custom event (e.g., 'User Registered', 'Loyalty Reward Earned').
|
|
1935
2071
|
type: string
|
|
1936
|
-
|
|
1937
|
-
description:
|
|
2072
|
+
customer:
|
|
2073
|
+
description: |
|
|
2074
|
+
Customer identity and profile fields. At least one of `id`, `email`, or `phoneNumber` is required for identity resolution.
|
|
2075
|
+
type: object
|
|
2076
|
+
additionalProperties: false
|
|
2077
|
+
anyOf:
|
|
2078
|
+
- required:
|
|
2079
|
+
- id
|
|
2080
|
+
- required:
|
|
2081
|
+
- email
|
|
2082
|
+
- required:
|
|
2083
|
+
- phoneNumber
|
|
2084
|
+
properties:
|
|
2085
|
+
id:
|
|
2086
|
+
description: Redo customer ObjectId. Used for identity resolution. Takes priority over email and phoneNumber when provided.
|
|
2087
|
+
type: string
|
|
2088
|
+
email:
|
|
2089
|
+
description: Customer email address. Used for identity resolution.
|
|
2090
|
+
format: email
|
|
2091
|
+
type: string
|
|
2092
|
+
phoneNumber:
|
|
2093
|
+
description: Customer phone number in E.164 format. Used for identity resolution.
|
|
2094
|
+
type: string
|
|
2095
|
+
firstName:
|
|
2096
|
+
description: Customer first name. Applied with patch semantics — does not erase existing value if omitted.
|
|
2097
|
+
type: string
|
|
2098
|
+
lastName:
|
|
2099
|
+
description: Customer last name. Applied with patch semantics — does not erase existing value if omitted.
|
|
2100
|
+
type: string
|
|
2101
|
+
location:
|
|
2102
|
+
description: Customer location for profile enrichment. All fields are optional.
|
|
2103
|
+
type: object
|
|
2104
|
+
additionalProperties: false
|
|
2105
|
+
properties:
|
|
2106
|
+
street1:
|
|
2107
|
+
description: Primary street address.
|
|
2108
|
+
type: string
|
|
2109
|
+
street2:
|
|
2110
|
+
description: Secondary address line (apartment, suite, etc.).
|
|
2111
|
+
type: string
|
|
2112
|
+
city:
|
|
2113
|
+
description: City name.
|
|
2114
|
+
type: string
|
|
2115
|
+
state:
|
|
2116
|
+
description: State or province name.
|
|
2117
|
+
type: string
|
|
2118
|
+
stateCode:
|
|
2119
|
+
description: State or province abbreviation (e.g., "CA", "NY").
|
|
2120
|
+
type: string
|
|
2121
|
+
postalCode:
|
|
2122
|
+
description: Postal or ZIP code.
|
|
2123
|
+
type: string
|
|
2124
|
+
country:
|
|
2125
|
+
description: Country name.
|
|
2126
|
+
type: string
|
|
2127
|
+
countryCode:
|
|
2128
|
+
description: ISO 3166-1 alpha-2 country code (e.g., "US", "GB").
|
|
2129
|
+
type: string
|
|
2130
|
+
ianaTimeZoneName:
|
|
2131
|
+
description: IANA time zone identifier (e.g., "America/New_York").
|
|
2132
|
+
type: string
|
|
2133
|
+
latitude:
|
|
2134
|
+
description: Geographic latitude coordinate.
|
|
2135
|
+
type: number
|
|
2136
|
+
longitude:
|
|
2137
|
+
description: Geographic longitude coordinate.
|
|
2138
|
+
type: number
|
|
2139
|
+
customFields:
|
|
2140
|
+
description: |
|
|
2141
|
+
Merchant-defined customer attributes as key-value pairs. Values can be strings, numbers, or booleans. Date values should be passed as ISO 8601 strings (e.g., "2026-04-02T12:00:00Z") and are automatically detected and indexed as dates.
|
|
2142
|
+
type: object
|
|
2143
|
+
additionalProperties:
|
|
2144
|
+
oneOf:
|
|
2145
|
+
- type: string
|
|
2146
|
+
- type: number
|
|
2147
|
+
- type: boolean
|
|
2148
|
+
data:
|
|
2149
|
+
description: |
|
|
2150
|
+
Custom properties for this event (must not exceed 400 properties). The size of the event payload must not exceed 5 MB, and each string cannot be larger than 100 KB. For a full list of data limits on event payloads, see [Limitations](/docs/guides/integrations/custom-events#rate-limits).
|
|
2151
|
+
|
|
2152
|
+
Note any top-level property that is not an object can be used to create segments. The `$extra` property records any non-segmentable values that can be referenced later, e.g., HTML templates are useful on a segment but are not used to create a segment.
|
|
1938
2153
|
type: object
|
|
1939
|
-
additionalProperties:
|
|
1940
|
-
|
|
2154
|
+
additionalProperties:
|
|
2155
|
+
description: |
|
|
2156
|
+
Segmentable event property. Each key you add becomes available for audience segmentation and automation conditions. Supported types are string, number, boolean, and date (ISO 8601 strings like "2025-01-15T00:00:00Z" are auto-detected as dates). Values of 0, null, and empty string ("") are treated as unset and will not be stored.
|
|
2157
|
+
anyOf:
|
|
2158
|
+
- type: string
|
|
2159
|
+
- type: number
|
|
2160
|
+
- type: boolean
|
|
2161
|
+
properties:
|
|
2162
|
+
$extra:
|
|
2163
|
+
description: |
|
|
2164
|
+
Non-segmentable metadata bucket. Values inside `$extra` are stored on the event but excluded from segmentation indexes. Unlike top-level data properties, values of 0, null, and empty string are NOT stripped inside `$extra`. Use this for large text, debug info, nested objects, arrays, or any data you want to reference in templates but not segment on.
|
|
2165
|
+
type: object
|
|
2166
|
+
additionalProperties: true
|
|
2167
|
+
eventTimestamp:
|
|
1941
2168
|
description: ISO 8601 timestamp when the event occurred. Defaults to current time if not provided.
|
|
1942
2169
|
format: date-time
|
|
1943
2170
|
type: string
|
|
1944
|
-
|
|
1945
|
-
description:
|
|
1946
|
-
|
|
1947
|
-
|
|
1948
|
-
|
|
1949
|
-
|
|
1950
|
-
|
|
1951
|
-
|
|
1952
|
-
|
|
1953
|
-
|
|
1954
|
-
description: Product IDs to use as the basis for recommendations.
|
|
1955
|
-
type: array
|
|
1956
|
-
items:
|
|
1957
|
-
type: string
|
|
1958
|
-
alreadyInCart:
|
|
1959
|
-
description: Items already in the customer's cart.
|
|
1960
|
-
type: array
|
|
1961
|
-
items:
|
|
1962
|
-
type: object
|
|
1963
|
-
properties:
|
|
1964
|
-
productId:
|
|
1965
|
-
type: string
|
|
1966
|
-
variantId:
|
|
1967
|
-
type: string
|
|
1968
|
-
quantity:
|
|
1969
|
-
type: number
|
|
1970
|
-
required:
|
|
1971
|
-
- productId
|
|
1972
|
-
- variantId
|
|
1973
|
-
required:
|
|
1974
|
-
- existingCartId
|
|
1975
|
-
- productIdsForRecommendations
|
|
1976
|
-
- alreadyInCart
|
|
2171
|
+
value:
|
|
2172
|
+
description: Monetary or conversion value associated with the event (e.g., purchase amount).
|
|
2173
|
+
type: number
|
|
2174
|
+
valueCurrency:
|
|
2175
|
+
description: ISO 4217 currency code for the value field (e.g., "USD", "EUR").
|
|
2176
|
+
type: string
|
|
2177
|
+
uniqueId:
|
|
2178
|
+
description: |
|
|
2179
|
+
Merchant-controlled deduplication key (1-255 characters). If provided, subsequent events with the same uniqueId for the same store are silently deduplicated. Use this for safe retries and at-least-once delivery patterns.
|
|
2180
|
+
type: string
|
|
1977
2181
|
required:
|
|
1978
|
-
-
|
|
2182
|
+
- eventName
|
|
2183
|
+
- customer
|
|
1979
2184
|
title: Custom Event Request
|
|
1980
2185
|
type: object
|
|
1981
|
-
custom-event-
|
|
2186
|
+
bulk-custom-event-request.schema:
|
|
1982
2187
|
additionalProperties: false
|
|
1983
|
-
description:
|
|
2188
|
+
description: Request body for sending multiple custom events in a single request.
|
|
1984
2189
|
properties:
|
|
1985
|
-
|
|
1986
|
-
description:
|
|
1987
|
-
type:
|
|
1988
|
-
|
|
1989
|
-
|
|
1990
|
-
|
|
1991
|
-
|
|
1992
|
-
type: string
|
|
1993
|
-
event_name:
|
|
1994
|
-
description: The name of the custom event that was created.
|
|
1995
|
-
type: string
|
|
2190
|
+
events:
|
|
2191
|
+
description: Array of custom events to create.
|
|
2192
|
+
type: array
|
|
2193
|
+
items:
|
|
2194
|
+
$ref: '#/components/schemas/custom-event-request.schema'
|
|
2195
|
+
maxItems: 100
|
|
2196
|
+
minItems: 1
|
|
1996
2197
|
required:
|
|
1997
|
-
-
|
|
1998
|
-
|
|
1999
|
-
- event_name
|
|
2000
|
-
title: Custom Event Response
|
|
2198
|
+
- events
|
|
2199
|
+
title: Bulk Custom Event Request
|
|
2001
2200
|
type: object
|
|
2002
2201
|
subscription-status-marketing.schema:
|
|
2003
2202
|
description: Marketing subscription status
|
package/package.json
CHANGED