@redotech/redo-api-schema 2.2.416 → 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
@@ -185,6 +185,11 @@ export interface paths {
185
185
  * @description List returns, sorted by most recent to least recent.
186
186
  */
187
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"];
188
193
  parameters: {
189
194
  path: {
190
195
  storeId: components["parameters"]["store-id.param"];
@@ -340,6 +345,83 @@ export interface components {
340
345
  */
341
346
  price: components["schemas"]["money.schema"];
342
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
+ };
343
425
  /**
344
426
  * Custom Event Request
345
427
  * @description Custom event to trigger flows with merchant-defined event names and properties.
@@ -1519,6 +1601,8 @@ export interface components {
1519
1601
  };
1520
1602
  responses: never;
1521
1603
  parameters: {
1604
+ /** @description Optional idempotency key for safely retrying create requests. */
1605
+ "idempotency-key.param"?: string;
1522
1606
  /** @description Invoice ID */
1523
1607
  "invoice-id.param": string;
1524
1608
  /**
@@ -2282,6 +2366,63 @@ export interface operations {
2282
2366
  };
2283
2367
  };
2284
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
+ };
2285
2426
  /**
2286
2427
  * Receive Storefront Events
2287
2428
  * @description Processes events from storefronts using Shopify pixel event schema
package/lib/openapi.yaml CHANGED
@@ -906,6 +906,59 @@ paths:
906
906
  summary: List Returns
907
907
  tags:
908
908
  - Returns
909
+ post:
910
+ description: Create a return for specific order line items.
911
+ operationId: Return create
912
+ parameters:
913
+ - $ref: '#/components/parameters/idempotency-key.param'
914
+ requestBody:
915
+ content:
916
+ application/json:
917
+ schema:
918
+ $ref: '#/components/schemas/create-return-request.schema'
919
+ required: true
920
+ responses:
921
+ '200':
922
+ content:
923
+ application/json:
924
+ schema:
925
+ $ref: '#/components/schemas/create-return-response.schema'
926
+ description: Success (idempotent replay; existing return returned)
927
+ '201':
928
+ content:
929
+ application/json:
930
+ schema:
931
+ $ref: '#/components/schemas/create-return-response.schema'
932
+ description: Created
933
+ '400':
934
+ content:
935
+ application/json:
936
+ schema:
937
+ $ref: '#/components/schemas/error.schema'
938
+ description: Invalid request body
939
+ '404':
940
+ content:
941
+ application/json:
942
+ schema:
943
+ $ref: '#/components/schemas/error.schema'
944
+ description: Order not found
945
+ '409':
946
+ content:
947
+ application/json:
948
+ schema:
949
+ $ref: '#/components/schemas/error.schema'
950
+ description: Conflict
951
+ default:
952
+ content:
953
+ application/problem+json:
954
+ schema:
955
+ $ref: '#/components/schemas/error.schema'
956
+ description: Error
957
+ security:
958
+ - Bearer: []
959
+ summary: Create Return
960
+ tags:
961
+ - Returns
909
962
  parameters:
910
963
  - $ref: '#/components/parameters/store-id.param'
911
964
  summary: Returns
@@ -1239,6 +1292,13 @@ components:
1239
1292
  name: status
1240
1293
  schema:
1241
1294
  $ref: '#/components/schemas/return-status.schema'
1295
+ idempotency-key.param:
1296
+ description: Optional idempotency key for safely retrying create requests.
1297
+ in: header
1298
+ name: Idempotency-Key
1299
+ required: false
1300
+ schema:
1301
+ type: string
1242
1302
  webhook-id.param:
1243
1303
  description: Webhook ID
1244
1304
  in: path
@@ -2748,6 +2808,150 @@ components:
2748
2808
  example: open
2749
2809
  title: Return status
2750
2810
  type: string
2811
+ create-return-request.schema:
2812
+ type: object
2813
+ description: Create return request body.
2814
+ properties:
2815
+ data:
2816
+ type: object
2817
+ description: Return information payload.
2818
+ properties:
2819
+ provider:
2820
+ type: string
2821
+ description: Ecommerce platform provider.
2822
+ examples:
2823
+ - shopify
2824
+ externalOrderId:
2825
+ type: string
2826
+ description: External order ID from the ecommerce platform.
2827
+ items:
2828
+ type: array
2829
+ minItems: 1
2830
+ description: Items being returned.
2831
+ items:
2832
+ type: object
2833
+ properties:
2834
+ lineItemId:
2835
+ type: string
2836
+ description: External line item ID from the order.
2837
+ quantity:
2838
+ type: integer
2839
+ minimum: 1
2840
+ description: Number of units to return.
2841
+ reason:
2842
+ type: string
2843
+ description: Customer-facing return reason.
2844
+ reasonCode:
2845
+ type: string
2846
+ description: Machine-readable reason code.
2847
+ compensation:
2848
+ type: string
2849
+ enum:
2850
+ - refund
2851
+ - store_credit
2852
+ description: How the customer should be compensated for this item.
2853
+ notes:
2854
+ type: string
2855
+ description: Customer-facing notes for this item.
2856
+ required:
2857
+ - lineItemId
2858
+ - quantity
2859
+ - reason
2860
+ - compensation
2861
+ shippingAddress:
2862
+ type: object
2863
+ description: Address the customer is shipping from.
2864
+ properties:
2865
+ line1:
2866
+ type: string
2867
+ line2:
2868
+ type: string
2869
+ city:
2870
+ type: string
2871
+ state:
2872
+ type: string
2873
+ postalCode:
2874
+ type: string
2875
+ country:
2876
+ type: string
2877
+ description: ISO 3166-1 alpha-2 country code.
2878
+ required:
2879
+ - line1
2880
+ - city
2881
+ - state
2882
+ - postalCode
2883
+ - country
2884
+ label:
2885
+ type: object
2886
+ description: Optional return label and tracking details.
2887
+ properties:
2888
+ trackingNumber:
2889
+ type: string
2890
+ description: Carrier tracking number.
2891
+ carrier:
2892
+ type: string
2893
+ description: Carrier name.
2894
+ trackingUrl:
2895
+ type: string
2896
+ description: Public tracking URL.
2897
+ postageLabelUrl:
2898
+ type: string
2899
+ description: Postage label URL.
2900
+ formLabelUrl:
2901
+ type: string
2902
+ description: Commercial or form label URL.
2903
+ originalShipmentId:
2904
+ type: string
2905
+ description: Provider shipment identifier to reference.
2906
+ required:
2907
+ - trackingNumber
2908
+ notes:
2909
+ type: string
2910
+ description: Internal merchant-side notes.
2911
+ required:
2912
+ - provider
2913
+ - externalOrderId
2914
+ - items
2915
+ - shippingAddress
2916
+ options:
2917
+ type: object
2918
+ description: Options controlling side effects of the return creation.
2919
+ properties:
2920
+ createExternalRMAs:
2921
+ type: boolean
2922
+ description: Whether to create RMAs with external integrations (e.g. ShipBob). Defaults to false.
2923
+ default: false
2924
+ required:
2925
+ - data
2926
+ create-return-response.schema:
2927
+ type: object
2928
+ description: Create return response body.
2929
+ properties:
2930
+ return:
2931
+ $ref: '#/components/schemas/return-read.schema'
2932
+ externalRMAResponses:
2933
+ type: array
2934
+ items:
2935
+ type: object
2936
+ properties:
2937
+ integrationProvider:
2938
+ type: string
2939
+ description: Name of the external integration provider.
2940
+ success:
2941
+ type: boolean
2942
+ description: Whether external RMA creation succeeded.
2943
+ errorCode:
2944
+ type: string
2945
+ description: Provider error code when external RMA creation fails.
2946
+ errorMessage:
2947
+ type: string
2948
+ description: Provider error message when external RMA creation fails.
2949
+ required:
2950
+ - integrationProvider
2951
+ - success
2952
+ required:
2953
+ - return
2954
+ - externalRMAResponses
2751
2955
  storefront-event.schema:
2752
2956
  additionalProperties: true
2753
2957
  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.418"
35
35
  }