@redotech/redo-api-schema 2.2.416 → 2.2.423

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
@@ -76,6 +76,11 @@ export interface paths {
76
76
  /**
77
77
  * Update Return Status
78
78
  * @description Update return status.
79
+ *
80
+ * Certain status transitions trigger additional side effects to maintain data consistency:
81
+ *
82
+ * - Setting status to **complete** will also mark all return items as complete.
83
+ * - Setting status to **open** from **complete** or **rejected** will reopen the return, resetting all processed/rejected items back to open, clearing pending processing info, resetting the expiration date, and marking the return as reopened. **Note:** Reopening a processed return does not reverse any refunds, exchanges, or other actions that were performed during processing.
79
84
  */
80
85
  put: operations["Return status update"];
81
86
  };
@@ -185,6 +190,11 @@ export interface paths {
185
190
  * @description List returns, sorted by most recent to least recent.
186
191
  */
187
192
  get: operations["Returns list"];
193
+ /**
194
+ * Create Return
195
+ * @description Create a return for specific order line items.
196
+ */
197
+ post: operations["Return create"];
188
198
  parameters: {
189
199
  path: {
190
200
  storeId: components["parameters"]["store-id.param"];
@@ -340,6 +350,83 @@ export interface components {
340
350
  */
341
351
  price: components["schemas"]["money.schema"];
342
352
  };
353
+ /** @description Create return request body. */
354
+ "create-return-request.schema": {
355
+ /** @description Return information payload. */
356
+ data: {
357
+ /** @description External order ID from the ecommerce platform. */
358
+ externalOrderId: string;
359
+ /** @description Items being returned. */
360
+ items: ({
361
+ /**
362
+ * @description How the customer should be compensated for this item.
363
+ * @enum {string}
364
+ */
365
+ compensation: "refund" | "store_credit";
366
+ /** @description External line item ID from the order. */
367
+ lineItemId: string;
368
+ /** @description Customer-facing notes for this item. */
369
+ notes?: string;
370
+ /** @description Number of units to return. */
371
+ quantity: number;
372
+ /** @description Customer-facing return reason. */
373
+ reason: string;
374
+ /** @description Machine-readable reason code. */
375
+ reasonCode?: string;
376
+ })[];
377
+ /** @description Optional return label and tracking details. */
378
+ label?: {
379
+ /** @description Carrier name. */
380
+ carrier?: string;
381
+ /** @description Commercial or form label URL. */
382
+ formLabelUrl?: string;
383
+ /** @description Provider shipment identifier to reference. */
384
+ originalShipmentId?: string;
385
+ /** @description Postage label URL. */
386
+ postageLabelUrl?: string;
387
+ /** @description Carrier tracking number. */
388
+ trackingNumber: string;
389
+ /** @description Public tracking URL. */
390
+ trackingUrl?: string;
391
+ };
392
+ /** @description Internal merchant-side notes. */
393
+ notes?: string;
394
+ /** @description Ecommerce platform provider. */
395
+ provider: string;
396
+ /** @description Address the customer is shipping from. */
397
+ shippingAddress: {
398
+ city: string;
399
+ /** @description ISO 3166-1 alpha-2 country code. */
400
+ country: string;
401
+ line1: string;
402
+ line2?: string;
403
+ postalCode: string;
404
+ state: string;
405
+ };
406
+ };
407
+ /** @description Options controlling side effects of the return creation. */
408
+ options?: {
409
+ /**
410
+ * @description Whether to create RMAs with external integrations (e.g. ShipBob). Defaults to false.
411
+ * @default false
412
+ */
413
+ createExternalRMAs?: boolean;
414
+ };
415
+ };
416
+ /** @description Create return response body. */
417
+ "create-return-response.schema": {
418
+ externalRMAResponses: {
419
+ /** @description Provider error code when external RMA creation fails. */
420
+ errorCode?: string;
421
+ /** @description Provider error message when external RMA creation fails. */
422
+ errorMessage?: string;
423
+ /** @description Name of the external integration provider. */
424
+ integrationProvider: string;
425
+ /** @description Whether external RMA creation succeeded. */
426
+ success: boolean;
427
+ }[];
428
+ return: components["schemas"]["return-read.schema"];
429
+ };
343
430
  /**
344
431
  * Custom Event Request
345
432
  * @description Custom event to trigger flows with merchant-defined event names and properties.
@@ -1519,6 +1606,8 @@ export interface components {
1519
1606
  };
1520
1607
  responses: never;
1521
1608
  parameters: {
1609
+ /** @description Optional idempotency key for safely retrying create requests. */
1610
+ "idempotency-key.param"?: string;
1522
1611
  /** @description Invoice ID */
1523
1612
  "invoice-id.param": string;
1524
1613
  /**
@@ -1794,6 +1883,11 @@ export interface operations {
1794
1883
  /**
1795
1884
  * Update Return Status
1796
1885
  * @description Update return status.
1886
+ *
1887
+ * Certain status transitions trigger additional side effects to maintain data consistency:
1888
+ *
1889
+ * - Setting status to **complete** will also mark all return items as complete.
1890
+ * - Setting status to **open** from **complete** or **rejected** will reopen the return, resetting all processed/rejected items back to open, clearing pending processing info, resetting the expiration date, and marking the return as reopened. **Note:** Reopening a processed return does not reverse any refunds, exchanges, or other actions that were performed during processing.
1797
1891
  */
1798
1892
  "Return status update": {
1799
1893
  parameters: {
@@ -2282,6 +2376,63 @@ export interface operations {
2282
2376
  };
2283
2377
  };
2284
2378
  };
2379
+ /**
2380
+ * Create Return
2381
+ * @description Create a return for specific order line items.
2382
+ */
2383
+ "Return create": {
2384
+ parameters: {
2385
+ header?: {
2386
+ "Idempotency-Key"?: components["parameters"]["idempotency-key.param"];
2387
+ };
2388
+ path: {
2389
+ storeId: components["parameters"]["store-id.param"];
2390
+ };
2391
+ };
2392
+ requestBody: {
2393
+ content: {
2394
+ "application/json": components["schemas"]["create-return-request.schema"];
2395
+ };
2396
+ };
2397
+ responses: {
2398
+ /** @description Success (idempotent replay; existing return returned) */
2399
+ 200: {
2400
+ content: {
2401
+ "application/json": components["schemas"]["create-return-response.schema"];
2402
+ };
2403
+ };
2404
+ /** @description Created */
2405
+ 201: {
2406
+ content: {
2407
+ "application/json": components["schemas"]["create-return-response.schema"];
2408
+ };
2409
+ };
2410
+ /** @description Invalid request body */
2411
+ 400: {
2412
+ content: {
2413
+ "application/json": components["schemas"]["error.schema"];
2414
+ };
2415
+ };
2416
+ /** @description Order not found */
2417
+ 404: {
2418
+ content: {
2419
+ "application/json": components["schemas"]["error.schema"];
2420
+ };
2421
+ };
2422
+ /** @description Conflict */
2423
+ 409: {
2424
+ content: {
2425
+ "application/json": components["schemas"]["error.schema"];
2426
+ };
2427
+ };
2428
+ /** @description Error */
2429
+ default: {
2430
+ content: {
2431
+ "application/problem+json": components["schemas"]["error.schema"];
2432
+ };
2433
+ };
2434
+ };
2435
+ };
2285
2436
  /**
2286
2437
  * Receive Storefront Events
2287
2438
  * @description Processes events from storefronts using Shopify pixel event schema
package/lib/openapi.yaml CHANGED
@@ -830,7 +830,13 @@ paths:
830
830
  tags:
831
831
  - Returns
832
832
  put:
833
- description: Update return status.
833
+ description: |
834
+ Update return status.
835
+
836
+ Certain status transitions trigger additional side effects to maintain data consistency:
837
+
838
+ - Setting status to **complete** will also mark all return items as complete.
839
+ - Setting status to **open** from **complete** or **rejected** will reopen the return, resetting all processed/rejected items back to open, clearing pending processing info, resetting the expiration date, and marking the return as reopened. **Note:** Reopening a processed return does not reverse any refunds, exchanges, or other actions that were performed during processing.
834
840
  operationId: Return status update
835
841
  parameters:
836
842
  - $ref: '#/components/parameters/return-id.param'
@@ -906,6 +912,59 @@ paths:
906
912
  summary: List Returns
907
913
  tags:
908
914
  - Returns
915
+ post:
916
+ description: Create a return for specific order line items.
917
+ operationId: Return create
918
+ parameters:
919
+ - $ref: '#/components/parameters/idempotency-key.param'
920
+ requestBody:
921
+ content:
922
+ application/json:
923
+ schema:
924
+ $ref: '#/components/schemas/create-return-request.schema'
925
+ required: true
926
+ responses:
927
+ '200':
928
+ content:
929
+ application/json:
930
+ schema:
931
+ $ref: '#/components/schemas/create-return-response.schema'
932
+ description: Success (idempotent replay; existing return returned)
933
+ '201':
934
+ content:
935
+ application/json:
936
+ schema:
937
+ $ref: '#/components/schemas/create-return-response.schema'
938
+ description: Created
939
+ '400':
940
+ content:
941
+ application/json:
942
+ schema:
943
+ $ref: '#/components/schemas/error.schema'
944
+ description: Invalid request body
945
+ '404':
946
+ content:
947
+ application/json:
948
+ schema:
949
+ $ref: '#/components/schemas/error.schema'
950
+ description: Order not found
951
+ '409':
952
+ content:
953
+ application/json:
954
+ schema:
955
+ $ref: '#/components/schemas/error.schema'
956
+ description: Conflict
957
+ default:
958
+ content:
959
+ application/problem+json:
960
+ schema:
961
+ $ref: '#/components/schemas/error.schema'
962
+ description: Error
963
+ security:
964
+ - Bearer: []
965
+ summary: Create Return
966
+ tags:
967
+ - Returns
909
968
  parameters:
910
969
  - $ref: '#/components/parameters/store-id.param'
911
970
  summary: Returns
@@ -1239,6 +1298,13 @@ components:
1239
1298
  name: status
1240
1299
  schema:
1241
1300
  $ref: '#/components/schemas/return-status.schema'
1301
+ idempotency-key.param:
1302
+ description: Optional idempotency key for safely retrying create requests.
1303
+ in: header
1304
+ name: Idempotency-Key
1305
+ required: false
1306
+ schema:
1307
+ type: string
1242
1308
  webhook-id.param:
1243
1309
  description: Webhook ID
1244
1310
  in: path
@@ -2748,6 +2814,150 @@ components:
2748
2814
  example: open
2749
2815
  title: Return status
2750
2816
  type: string
2817
+ create-return-request.schema:
2818
+ type: object
2819
+ description: Create return request body.
2820
+ properties:
2821
+ data:
2822
+ type: object
2823
+ description: Return information payload.
2824
+ properties:
2825
+ provider:
2826
+ type: string
2827
+ description: Ecommerce platform provider.
2828
+ examples:
2829
+ - shopify
2830
+ externalOrderId:
2831
+ type: string
2832
+ description: External order ID from the ecommerce platform.
2833
+ items:
2834
+ type: array
2835
+ minItems: 1
2836
+ description: Items being returned.
2837
+ items:
2838
+ type: object
2839
+ properties:
2840
+ lineItemId:
2841
+ type: string
2842
+ description: External line item ID from the order.
2843
+ quantity:
2844
+ type: integer
2845
+ minimum: 1
2846
+ description: Number of units to return.
2847
+ reason:
2848
+ type: string
2849
+ description: Customer-facing return reason.
2850
+ reasonCode:
2851
+ type: string
2852
+ description: Machine-readable reason code.
2853
+ compensation:
2854
+ type: string
2855
+ enum:
2856
+ - refund
2857
+ - store_credit
2858
+ description: How the customer should be compensated for this item.
2859
+ notes:
2860
+ type: string
2861
+ description: Customer-facing notes for this item.
2862
+ required:
2863
+ - lineItemId
2864
+ - quantity
2865
+ - reason
2866
+ - compensation
2867
+ shippingAddress:
2868
+ type: object
2869
+ description: Address the customer is shipping from.
2870
+ properties:
2871
+ line1:
2872
+ type: string
2873
+ line2:
2874
+ type: string
2875
+ city:
2876
+ type: string
2877
+ state:
2878
+ type: string
2879
+ postalCode:
2880
+ type: string
2881
+ country:
2882
+ type: string
2883
+ description: ISO 3166-1 alpha-2 country code.
2884
+ required:
2885
+ - line1
2886
+ - city
2887
+ - state
2888
+ - postalCode
2889
+ - country
2890
+ label:
2891
+ type: object
2892
+ description: Optional return label and tracking details.
2893
+ properties:
2894
+ trackingNumber:
2895
+ type: string
2896
+ description: Carrier tracking number.
2897
+ carrier:
2898
+ type: string
2899
+ description: Carrier name.
2900
+ trackingUrl:
2901
+ type: string
2902
+ description: Public tracking URL.
2903
+ postageLabelUrl:
2904
+ type: string
2905
+ description: Postage label URL.
2906
+ formLabelUrl:
2907
+ type: string
2908
+ description: Commercial or form label URL.
2909
+ originalShipmentId:
2910
+ type: string
2911
+ description: Provider shipment identifier to reference.
2912
+ required:
2913
+ - trackingNumber
2914
+ notes:
2915
+ type: string
2916
+ description: Internal merchant-side notes.
2917
+ required:
2918
+ - provider
2919
+ - externalOrderId
2920
+ - items
2921
+ - shippingAddress
2922
+ options:
2923
+ type: object
2924
+ description: Options controlling side effects of the return creation.
2925
+ properties:
2926
+ createExternalRMAs:
2927
+ type: boolean
2928
+ description: Whether to create RMAs with external integrations (e.g. ShipBob). Defaults to false.
2929
+ default: false
2930
+ required:
2931
+ - data
2932
+ create-return-response.schema:
2933
+ type: object
2934
+ description: Create return response body.
2935
+ properties:
2936
+ return:
2937
+ $ref: '#/components/schemas/return-read.schema'
2938
+ externalRMAResponses:
2939
+ type: array
2940
+ items:
2941
+ type: object
2942
+ properties:
2943
+ integrationProvider:
2944
+ type: string
2945
+ description: Name of the external integration provider.
2946
+ success:
2947
+ type: boolean
2948
+ description: Whether external RMA creation succeeded.
2949
+ errorCode:
2950
+ type: string
2951
+ description: Provider error code when external RMA creation fails.
2952
+ errorMessage:
2953
+ type: string
2954
+ description: Provider error message when external RMA creation fails.
2955
+ required:
2956
+ - integrationProvider
2957
+ - success
2958
+ required:
2959
+ - return
2960
+ - externalRMAResponses
2751
2961
  storefront-event.schema:
2752
2962
  additionalProperties: true
2753
2963
  description: Shopify pixel event for storefront tracking.
package/package.json CHANGED
@@ -31,5 +31,5 @@
31
31
  ]
32
32
  }
33
33
  },
34
- "version": "2.2.416"
34
+ "version": "2.2.423"
35
35
  }