Skip to content

list-order-returns

Method: GET
Path: /orders/{order_number}/returns

Tags: Orders

Summary

Retrieve order returns

Description

Lists all return requests for a specific order. Returns an array of OrderReturn objects.

Storefront SDK Usage

SDK Method: sdk.order.listOrderReturns()

Example:

typescript
const { data, error } = await sdk.order.listOrderReturns({
  order_number: "ORD-2024-001"
});

if (error) {
  console.error("Failed to list order returns:", error.message);
} else {
  console.log("Returns found:", data.returns?.length || 0);

  data.returns?.forEach(orderReturn => {
    console.log(`Return ${orderReturn.request_number}: ${orderReturn.status}`);
    console.log("Created at:", orderReturn.created_at);
    console.log("Items:", orderReturn.items?.length || 0);
  });
}

TypeScript Definition

typescript
"list-order-returns": {
        parameters: {
            query?: never;
            header?: never;
            path: {
                /** @description The unique identifier of the Order. */
                order_number: string;
            };
            cookie?: never;
        };
        requestBody?: never;
        responses: {
            /** @description OK */
            200: {
                headers: {
                    [name: string]: unknown;
                };
                content: {
                    "application/json": {
                        message?: string;
                        success?: boolean;
                        content?: {
                            returns?: components["schemas"]["OrderReturn"][];
                        };
                    };
                };
            };
            401: components["responses"]["Unauthorized"];
            404: components["responses"]["NotFound"];
        };
    };

Component References

ReferenceResolves To
components["schemas"]["OrderReturn"]OrderReturn
components["responses"]["Unauthorized"]Unauthorized
components["responses"]["NotFound"]NotFound

Parameters

  • order_number (path): The unique identifier of the Order.

Responses

200

OK

401

Not authorized for given operation on the Resource

404

Requested resource not found

OpenAPI Definition

json
{
  "tags": [
    "Orders"
  ],
  "operationId": "list-order-returns",
  "summary": "Retrieve order returns",
  "description": "Lists all return requests for a specific order. Returns an array of `OrderReturn` objects.",
  "externalDocs": {
    "url": "https://llm-docs.commercengine.io/storefront/operations/list-order-returns",
    "description": "API reference for the list-order-returns operation"
  },
  "parameters": [
    {
      "name": "order_number",
      "in": "path",
      "description": "The unique identifier of the Order.",
      "required": true,
      "schema": {
        "type": "string"
      }
    }
  ],
  "responses": {
    "200": {
      "description": "OK",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "message": {
                "type": "string"
              },
              "success": {
                "type": "boolean"
              },
              "content": {
                "properties": {
                  "returns": {
                    "type": "array",
                    "items": {
                      "$ref": "#/components/schemas/OrderReturn"
                    }
                  }
                },
                "type": "object"
              }
            }
          }
        }
      }
    },
    "401": {
      "$ref": "#/components/responses/Unauthorized"
    },
    "404": {
      "$ref": "#/components/responses/NotFound"
    }
  },
  "security": [
    {
      "Authorization": []
    }
  ],
  "x-speakeasy-group": "orders",
  "x-speakeasy-ignore": true,
  "x-speakeasy-name-override": "listOrderReturns"
}

Auto-generated from OpenAPI spec and TypeScript definitions

Last updated: