Skip to content

OrderReturnRequest ​

Type: schema

Description ​

A shopper's return request on an order, with its items and the admin's decision.

TypeScript Definition ​

typescript
OrderReturnRequest: {{
            /** @description The return's number (the event's `return_request_number`). */
            request_number: string;
            /**
             * @description The return's status.
             * @enum {string}
             */
            status: "created" | "approved" | "rejected" | "cancelled";
            /**
             * @description What the admin approved; the requested settlement until then.
             * @enum {string}
             */
            resolution: "refund" | "replacement";
            /**
             * @description What the shopper asked for.
             * @enum {string}
             */
            requested_settlement: "refund" | "replacement";
            /** @description Whether the items are to be picked up, set on approval; `null` before. */
            pickup_required: boolean | null;
            subtotal: number;
            /** @description Shipping refunded with the return; currently always `0`. */
            shipping_amount: number;
            total_tax: number;
            /** @description Value of the returned items: `subtotal` (price before tax) plus `total_tax` plus `shipping_amount`. */
            grand_total: number;
            /** @description The replacement order, for a `replacement` resolution. */
            replacement_order_id: number | null;
            /** Format: date-time */
            approved_at: string | null;
            /** Format: date-time */
            rejected_at: string | null;
            /** Format: date-time */
            shipped_at: string | null;
            /** Format: date-time */
            received_at: string | null;
            /** @description The shopper's reason for cancelling, or the admin's reason for rejecting. */
            cancellation_reason: null | string;
            /** @description Name of the shopper who cancelled, or of the admin who rejected. */
            cancelled_by: null | string;
            /** @description The shopper's uploaded photos; `null` when none. */
            images: null | string[];
            /** @description The shopper's uploaded videos; `null` when none. */
            videos: string[] | null;
            created_at: string;
            modified_at: string;
            items: {
                product_id: string;
                variant_id: string | null;
                sku: string;
                shipment_number: string;
                quantity: number;
                return_reason: string;
            }[];
        };
        /**
         * OrderState
         * @description An order as its events carry it: its status, totals, items, addresses and payments, the customer's contact (`customer_email`, `customer_phone`), who cancelled the order, and the KYC and ERP ledger details recorded when the merchant approved it.
         */
}

OpenAPI Schema ​

json
{
  "title": "OrderReturnRequest",
  "description": "A shopper's return request on an order, with its items and the admin's decision.",
  "type": "object",
  "externalDocs": {
    "url": "https://llm-docs.commercengine.io/storefront/schemas/OrderReturnRequest",
    "description": "API reference for the OrderReturnRequest schema"
  },
  "required": [
    "approved_at",
    "cancellation_reason",
    "cancelled_by",
    "created_at",
    "grand_total",
    "images",
    "items",
    "modified_at",
    "pickup_required",
    "received_at",
    "rejected_at",
    "replacement_order_id",
    "request_number",
    "requested_settlement",
    "resolution",
    "shipped_at",
    "shipping_amount",
    "status",
    "subtotal",
    "total_tax",
    "videos"
  ],
  "properties": {
    "request_number": {
      "description": "The return's number (the event's `return_request_number`).",
      "type": "string"
    },
    "status": {
      "description": "The return's status.",
      "type": "string",
      "enum": [
        "created",
        "approved",
        "rejected",
        "cancelled"
      ]
    },
    "resolution": {
      "description": "What the admin approved; the requested settlement until then.",
      "type": "string",
      "enum": [
        "refund",
        "replacement"
      ]
    },
    "requested_settlement": {
      "description": "What the shopper asked for.",
      "type": "string",
      "enum": [
        "refund",
        "replacement"
      ]
    },
    "pickup_required": {
      "description": "Whether the items are to be picked up, set on approval; `null` before.",
      "type": [
        "boolean",
        "null"
      ]
    },
    "subtotal": {
      "type": "number"
    },
    "shipping_amount": {
      "description": "Shipping refunded with the return; currently always `0`.",
      "type": "number"
    },
    "total_tax": {
      "type": "number"
    },
    "grand_total": {
      "description": "Value of the returned items: `subtotal` (price before tax) plus `total_tax` plus `shipping_amount`.",
      "type": "number"
    },
    "replacement_order_id": {
      "description": "The replacement order, for a `replacement` resolution.",
      "type": [
        "integer",
        "null"
      ]
    },
    "approved_at": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    },
    "rejected_at": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    },
    "shipped_at": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    },
    "received_at": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    },
    "cancellation_reason": {
      "description": "The shopper's reason for cancelling, or the admin's reason for rejecting.",
      "type": [
        "null",
        "string"
      ]
    },
    "cancelled_by": {
      "description": "Name of the shopper who cancelled, or of the admin who rejected.",
      "type": [
        "null",
        "string"
      ]
    },
    "images": {
      "description": "The shopper's uploaded photos; `null` when none.",
      "anyOf": [
        {
          "type": "null"
        },
        {
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      ]
    },
    "videos": {
      "description": "The shopper's uploaded videos; `null` when none.",
      "type": [
        "array",
        "null"
      ],
      "items": {
        "type": "string"
      }
    },
    "created_at": {
      "type": "string"
    },
    "modified_at": {
      "type": "string"
    },
    "items": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "product_id": {
            "type": "string"
          },
          "variant_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "sku": {
            "type": "string"
          },
          "shipment_number": {
            "type": "string"
          },
          "quantity": {
            "type": "integer"
          },
          "return_reason": {
            "type": "string"
          }
        },
        "required": [
          "product_id",
          "quantity",
          "return_reason",
          "shipment_number",
          "sku",
          "variant_id"
        ]
      },
      "properties": {
        "shipment_number": {
          "description": "The shipment the returned units were delivered in."
        },
        "return_reason": {
          "description": "The shopper's reason for returning the item."
        }
      }
    }
  }
}

Auto-generated from OpenAPI spec and TypeScript definitions

Last updated: