@redotech/redo-api-schema 2.2.405 → 2.2.418

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,39 @@ export interface paths {
121
121
  */
122
122
  post: operations["Customer subscriptions update"];
123
123
  };
124
+ "/stores/{storeId}/customers": {
125
+ /**
126
+ * Get customer by email
127
+ * @description Retrieve a customer profile by email address.
128
+ *
129
+ * The response includes the customer's name, contact information, location,
130
+ * and any custom fields associated with the profile. Custom fields are returned
131
+ * as `{ fieldName: value }` pairs.
132
+ */
133
+ get: operations["Customer get"];
134
+ /**
135
+ * Create or update customer
136
+ * @description Create or update a customer profile. Uses the email address as the upsert
137
+ * key — if a customer with that email exists, their profile is updated;
138
+ * otherwise, a new customer is created.
139
+ *
140
+ * ## Profile fields
141
+ * - `firstName` and `lastName` are set directly on the customer. A full
142
+ * display name is automatically generated from these fields.
143
+ * - `phoneNumber` should be in E.164 format (e.g., `+12345678900`). If the
144
+ * number is new, it is added to the customer's contact information.
145
+ *
146
+ * ## Location
147
+ * Providing `location` sets the customer's current location. Only the fields
148
+ * you include are updated.
149
+ *
150
+ * ## Custom fields
151
+ * Use `customFields` to store arbitrary key-value data on the customer (e.g.,
152
+ * `pricing_plan`, `subscription_source`). Values can be strings, numbers, or
153
+ * booleans. If a custom field doesn't exist yet, it is created automatically.
154
+ */
155
+ put: operations["Customer upsert"];
156
+ };
124
157
  "/stores/{storeId}/events": {
125
158
  /**
126
159
  * Create custom event
@@ -152,6 +185,11 @@ export interface paths {
152
185
  * @description List returns, sorted by most recent to least recent.
153
186
  */
154
187
  get: operations["Returns list"];
188
+ /**
189
+ * Create Return
190
+ * @description Create a return for specific order line items.
191
+ */
192
+ post: operations["Return create"];
155
193
  parameters: {
156
194
  path: {
157
195
  storeId: components["parameters"]["store-id.param"];
@@ -307,6 +345,83 @@ export interface components {
307
345
  */
308
346
  price: components["schemas"]["money.schema"];
309
347
  };
348
+ /** @description Create return request body. */
349
+ "create-return-request.schema": {
350
+ /** @description Return information payload. */
351
+ data: {
352
+ /** @description External order ID from the ecommerce platform. */
353
+ externalOrderId: string;
354
+ /** @description Items being returned. */
355
+ items: ({
356
+ /**
357
+ * @description How the customer should be compensated for this item.
358
+ * @enum {string}
359
+ */
360
+ compensation: "refund" | "store_credit";
361
+ /** @description External line item ID from the order. */
362
+ lineItemId: string;
363
+ /** @description Customer-facing notes for this item. */
364
+ notes?: string;
365
+ /** @description Number of units to return. */
366
+ quantity: number;
367
+ /** @description Customer-facing return reason. */
368
+ reason: string;
369
+ /** @description Machine-readable reason code. */
370
+ reasonCode?: string;
371
+ })[];
372
+ /** @description Optional return label and tracking details. */
373
+ label?: {
374
+ /** @description Carrier name. */
375
+ carrier?: string;
376
+ /** @description Commercial or form label URL. */
377
+ formLabelUrl?: string;
378
+ /** @description Provider shipment identifier to reference. */
379
+ originalShipmentId?: string;
380
+ /** @description Postage label URL. */
381
+ postageLabelUrl?: string;
382
+ /** @description Carrier tracking number. */
383
+ trackingNumber: string;
384
+ /** @description Public tracking URL. */
385
+ trackingUrl?: string;
386
+ };
387
+ /** @description Internal merchant-side notes. */
388
+ notes?: string;
389
+ /** @description Ecommerce platform provider. */
390
+ provider: string;
391
+ /** @description Address the customer is shipping from. */
392
+ shippingAddress: {
393
+ city: string;
394
+ /** @description ISO 3166-1 alpha-2 country code. */
395
+ country: string;
396
+ line1: string;
397
+ line2?: string;
398
+ postalCode: string;
399
+ state: string;
400
+ };
401
+ };
402
+ /** @description Options controlling side effects of the return creation. */
403
+ options?: {
404
+ /**
405
+ * @description Whether to create RMAs with external integrations (e.g. ShipBob). Defaults to false.
406
+ * @default false
407
+ */
408
+ createExternalRMAs?: boolean;
409
+ };
410
+ };
411
+ /** @description Create return response body. */
412
+ "create-return-response.schema": {
413
+ externalRMAResponses: {
414
+ /** @description Provider error code when external RMA creation fails. */
415
+ errorCode?: string;
416
+ /** @description Provider error message when external RMA creation fails. */
417
+ errorMessage?: string;
418
+ /** @description Name of the external integration provider. */
419
+ integrationProvider: string;
420
+ /** @description Whether external RMA creation succeeded. */
421
+ success: boolean;
422
+ }[];
423
+ return: components["schemas"]["return-read.schema"];
424
+ };
310
425
  /**
311
426
  * Custom Event Request
312
427
  * @description Custom event to trigger flows with merchant-defined event names and properties.
@@ -343,6 +458,70 @@ export interface components {
343
458
  */
344
459
  status: "processed";
345
460
  };
461
+ /**
462
+ * Customer Location
463
+ * @description Customer location information.
464
+ */
465
+ "customer-location.schema": {
466
+ /** @description City name */
467
+ city?: string;
468
+ /** @description Country name */
469
+ country?: string;
470
+ /** @description ISO 3166-1 alpha-2 country code */
471
+ countryCode?: string;
472
+ /** @description IANA time zone identifier */
473
+ ianaTimeZoneName?: string;
474
+ /** @description Latitude coordinate */
475
+ latitude?: number;
476
+ /** @description Longitude coordinate */
477
+ longitude?: number;
478
+ /** @description Postal or ZIP code */
479
+ postalCode?: string;
480
+ /** @description State or province name */
481
+ state?: string;
482
+ /** @description State or province abbreviation */
483
+ stateCode?: string;
484
+ /** @description Street address line 1 */
485
+ street1?: string;
486
+ /** @description Street address line 2 */
487
+ street2?: string;
488
+ };
489
+ /**
490
+ * Customer
491
+ * @description Customer profile.
492
+ */
493
+ "customer-read.schema": {
494
+ /**
495
+ * Created at
496
+ * Format: date-time
497
+ * @description Timestamp when the customer was created.
498
+ */
499
+ createdAt: string;
500
+ /** @description Custom field values as key-value pairs, where keys are field names and values can be strings, numbers, or booleans. */
501
+ customFields?: {
502
+ [key: string]: string | number | boolean;
503
+ };
504
+ /**
505
+ * Format: email
506
+ * @description Customer email address
507
+ */
508
+ email: string;
509
+ /** @description Customer first name */
510
+ firstName?: string;
511
+ /** @description Redo customer ID */
512
+ id: string;
513
+ /** @description Customer last name */
514
+ lastName?: string;
515
+ location?: components["schemas"]["customer-location.schema"];
516
+ /** @description Customer phone number in E.164 format */
517
+ phoneNumber?: string;
518
+ /**
519
+ * Updated at
520
+ * Format: date-time
521
+ * @description Timestamp when the customer was last updated.
522
+ */
523
+ updatedAt: string;
524
+ };
346
525
  /** @description Email subscription updates */
347
526
  "customer-subscription-email.schema": {
348
527
  /**
@@ -383,6 +562,48 @@ export interface components {
383
562
  };
384
563
  };
385
564
  };
565
+ /**
566
+ * Customer Upsert Request
567
+ * @description Request body for creating or updating a customer profile. The email address is used as the upsert key.
568
+ */
569
+ "customer-upsert-request.schema": {
570
+ /**
571
+ * @description Custom field values as key-value pairs. Keys are field names and values can be strings, numbers, or booleans. New fields are created automatically if they don't exist yet.
572
+ * @example {
573
+ * "subscription_source": "web",
574
+ * "status": "Active",
575
+ * "loyalty_points": 1250,
576
+ * "vip_member": true
577
+ * }
578
+ */
579
+ customFields?: {
580
+ [key: string]: string | number | boolean;
581
+ };
582
+ /**
583
+ * Format: email
584
+ * @description Customer email address. Used as the upsert key to find or create the customer.
585
+ */
586
+ email: string;
587
+ /** @description Customer first name */
588
+ firstName?: string;
589
+ /** @description Customer last name */
590
+ lastName?: string;
591
+ location?: components["schemas"]["customer-location.schema"];
592
+ /** @description Customer phone number in E.164 format (e.g., +12345678900). Appended to the existing phone list if not already present. */
593
+ phoneNumber?: string;
594
+ };
595
+ /**
596
+ * Customer Upsert Response
597
+ * @description Response after creating or updating a customer profile.
598
+ */
599
+ "customer-upsert-response.schema": {
600
+ /** @description Whether a new customer was created (true) or an existing customer was updated (false). */
601
+ created: boolean;
602
+ /** @description Customer email address */
603
+ email: string;
604
+ /** @description Redo customer ID */
605
+ id: string;
606
+ };
386
607
  /**
387
608
  * Problem details
388
609
  * @description Problem details. See [RFC 7807 Section 3](https://datatracker.ietf.org/doc/html/rfc7807#section-3).
@@ -1380,6 +1601,8 @@ export interface components {
1380
1601
  };
1381
1602
  responses: never;
1382
1603
  parameters: {
1604
+ /** @description Optional idempotency key for safely retrying create requests. */
1605
+ "idempotency-key.param"?: string;
1383
1606
  /** @description Invoice ID */
1384
1607
  "invoice-id.param": string;
1385
1608
  /**
@@ -1899,6 +2122,122 @@ export interface operations {
1899
2122
  };
1900
2123
  };
1901
2124
  };
2125
+ /**
2126
+ * Get customer by email
2127
+ * @description Retrieve a customer profile by email address.
2128
+ *
2129
+ * The response includes the customer's name, contact information, location,
2130
+ * and any custom fields associated with the profile. Custom fields are returned
2131
+ * as `{ fieldName: value }` pairs.
2132
+ */
2133
+ "Customer get": {
2134
+ parameters: {
2135
+ query: {
2136
+ /** @description Customer email address */
2137
+ email: string;
2138
+ };
2139
+ path: {
2140
+ storeId: components["parameters"]["store-id.param"];
2141
+ };
2142
+ };
2143
+ responses: {
2144
+ /** @description Customer found */
2145
+ 200: {
2146
+ content: {
2147
+ "application/json": components["schemas"]["customer-read.schema"];
2148
+ };
2149
+ };
2150
+ /** @description Missing or invalid email parameter */
2151
+ 400: {
2152
+ content: {
2153
+ "application/problem+json": components["schemas"]["error.schema"];
2154
+ };
2155
+ };
2156
+ /** @description No customer found for that email */
2157
+ 404: {
2158
+ content: {
2159
+ "application/problem+json": components["schemas"]["error.schema"];
2160
+ };
2161
+ };
2162
+ /** @description Internal server error */
2163
+ 500: {
2164
+ content: {
2165
+ "application/problem+json": components["schemas"]["error.schema"];
2166
+ };
2167
+ };
2168
+ /** @description Error */
2169
+ default: {
2170
+ content: {
2171
+ "application/problem+json": components["schemas"]["error.schema"];
2172
+ };
2173
+ };
2174
+ };
2175
+ };
2176
+ /**
2177
+ * Create or update customer
2178
+ * @description Create or update a customer profile. Uses the email address as the upsert
2179
+ * key — if a customer with that email exists, their profile is updated;
2180
+ * otherwise, a new customer is created.
2181
+ *
2182
+ * ## Profile fields
2183
+ * - `firstName` and `lastName` are set directly on the customer. A full
2184
+ * display name is automatically generated from these fields.
2185
+ * - `phoneNumber` should be in E.164 format (e.g., `+12345678900`). If the
2186
+ * number is new, it is added to the customer's contact information.
2187
+ *
2188
+ * ## Location
2189
+ * Providing `location` sets the customer's current location. Only the fields
2190
+ * you include are updated.
2191
+ *
2192
+ * ## Custom fields
2193
+ * Use `customFields` to store arbitrary key-value data on the customer (e.g.,
2194
+ * `pricing_plan`, `subscription_source`). Values can be strings, numbers, or
2195
+ * booleans. If a custom field doesn't exist yet, it is created automatically.
2196
+ */
2197
+ "Customer upsert": {
2198
+ parameters: {
2199
+ path: {
2200
+ storeId: components["parameters"]["store-id.param"];
2201
+ };
2202
+ };
2203
+ requestBody: {
2204
+ content: {
2205
+ "application/json": components["schemas"]["customer-upsert-request.schema"];
2206
+ };
2207
+ };
2208
+ responses: {
2209
+ /** @description Existing customer updated */
2210
+ 200: {
2211
+ content: {
2212
+ "application/json": components["schemas"]["customer-upsert-response.schema"];
2213
+ };
2214
+ };
2215
+ /** @description New customer created */
2216
+ 201: {
2217
+ content: {
2218
+ "application/json": components["schemas"]["customer-upsert-response.schema"];
2219
+ };
2220
+ };
2221
+ /** @description Invalid request body or invalid email address */
2222
+ 400: {
2223
+ content: {
2224
+ "application/problem+json": components["schemas"]["error.schema"];
2225
+ };
2226
+ };
2227
+ /** @description Internal server error */
2228
+ 500: {
2229
+ content: {
2230
+ "application/problem+json": components["schemas"]["error.schema"];
2231
+ };
2232
+ };
2233
+ /** @description Error */
2234
+ default: {
2235
+ content: {
2236
+ "application/problem+json": components["schemas"]["error.schema"];
2237
+ };
2238
+ };
2239
+ };
2240
+ };
1902
2241
  /**
1903
2242
  * Create custom event
1904
2243
  * @description Create a custom event to trigger flows with merchant-defined event names and properties.
@@ -2027,6 +2366,63 @@ export interface operations {
2027
2366
  };
2028
2367
  };
2029
2368
  };
2369
+ /**
2370
+ * Create Return
2371
+ * @description Create a return for specific order line items.
2372
+ */
2373
+ "Return create": {
2374
+ parameters: {
2375
+ header?: {
2376
+ "Idempotency-Key"?: components["parameters"]["idempotency-key.param"];
2377
+ };
2378
+ path: {
2379
+ storeId: components["parameters"]["store-id.param"];
2380
+ };
2381
+ };
2382
+ requestBody: {
2383
+ content: {
2384
+ "application/json": components["schemas"]["create-return-request.schema"];
2385
+ };
2386
+ };
2387
+ responses: {
2388
+ /** @description Success (idempotent replay; existing return returned) */
2389
+ 200: {
2390
+ content: {
2391
+ "application/json": components["schemas"]["create-return-response.schema"];
2392
+ };
2393
+ };
2394
+ /** @description Created */
2395
+ 201: {
2396
+ content: {
2397
+ "application/json": components["schemas"]["create-return-response.schema"];
2398
+ };
2399
+ };
2400
+ /** @description Invalid request body */
2401
+ 400: {
2402
+ content: {
2403
+ "application/json": components["schemas"]["error.schema"];
2404
+ };
2405
+ };
2406
+ /** @description Order not found */
2407
+ 404: {
2408
+ content: {
2409
+ "application/json": components["schemas"]["error.schema"];
2410
+ };
2411
+ };
2412
+ /** @description Conflict */
2413
+ 409: {
2414
+ content: {
2415
+ "application/json": components["schemas"]["error.schema"];
2416
+ };
2417
+ };
2418
+ /** @description Error */
2419
+ default: {
2420
+ content: {
2421
+ "application/problem+json": components["schemas"]["error.schema"];
2422
+ };
2423
+ };
2424
+ };
2425
+ };
2030
2426
  /**
2031
2427
  * Receive Storefront Events
2032
2428
  * @description Processes events from storefronts using Shopify pixel event schema