{
  "openapi": "3.0.0",
  "servers": [
    {
      "url": "https://api.litecommerce.io",
      "description": "Production"
    },
    {
      "url": "https://api.preview.litecommerce.io",
      "description": "Preview (staging)"
    }
  ],
  "info": {
    "title": "cartonium Return facts - prepared public-wire projection",
    "version": "unpublished-projection-d3e8606dd5e1",
    "description": "Eight exact operations and their transitive local component/security closure from the source-pinned full public reference. Prepared source data only. This subset version or hash is never the whole-document runtime schema identity."
  },
  "paths": {
    "/api/v1/public/orders/{orderId}/returns/facts": {
      "post": {
        "deprecated": true,
        "description": "Factual companion of `POST /public/orders/{orderId}/returns`: the same email check, quantity validation and errors. Leaves out the private refund draft (`refundAmountInCents`, `refundState`, `amountOwedInCents`, `refundCurrency`): `money` reports what the customer requested, what the merchant published once the return is approved, and the refund this return actually issued — each with its own availability and historical currency. Like the route it accompanies, this email-gated operation is a measured retirement target; new clients use the authenticated by-reference `/facts` operations.",
        "operationId": "PublicReturnController_requestWithFacts",
        "parameters": [
          {
            "name": "orderId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "x-storefront-origin",
            "required": false,
            "description": "Required for server requests without browser Origin. Forward the actual tenant storefront HTTPS origin (scheme and host only), or the actual hosted cartonium checkout origin. Domains determines the tenant and Production/Sandbox data automatically. Both origin headers, when present, must match. Missing, unregistered, unverified, or wrong-tenant origins fail closed; API deployment and mode headers cannot select a fallback. Local development only: a non-deployed API reached through a loopback connection and local Host also accepts actual http(s)://<tenant>.localhost:<port> and http(s)://<tenant>.sandbox.localhost:<port> checkout origins. These explicit hosted addresses select their own mode; bare localhost is never tenant or mode authority.",
            "schema": {
              "type": "string",
              "format": "uri",
              "example": "https://sandbox.store.example"
            }
          },
          {
            "in": "header",
            "name": "x-commerce-environment",
            "required": false,
            "description": "Optional consistency assertion only. The registered request origin selects commerce mode; this header cannot select a mode or replace a missing origin. If supplied it must match the origin-derived mode. Prefer omitting it. The response x-commerce-environment reports the selected mode.",
            "schema": {
              "type": "string",
              "enum": [
                "production",
                "sandbox"
              ]
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateReturnDto"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicReturnFactsDto"
                }
              }
            }
          },
          "400": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorDto"
                }
              }
            }
          },
          "403": {
            "description": "Email mismatch is a documented #1475 UX/security exception: the public return flow returns 403 so legitimate customers can correct the email, while org scoping, rate limiting, and no extra order detail bound probing.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorDto"
                }
              }
            }
          },
          "404": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorDto"
                }
              }
            }
          },
          "429": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorDto"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "description": "Positive whole-number seconds to wait before retrying the request.",
                "schema": {
                  "type": "string",
                  "pattern": "^[1-9][0-9]*$"
                }
              }
            }
          },
          "503": {
            "description": "Return money facts are unavailable. The request is refused before the order or any return is read or changed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorDto"
                }
              }
            }
          }
        },
        "security": [
          {
            "OrganizationSlug": []
          }
        ],
        "summary": "Request a return and read its factual money (customer-initiated).",
        "tags": [
          "public-returns"
        ]
      },
      "get": {
        "deprecated": true,
        "description": "Factual companion of `GET /public/orders/{orderId}/returns`: requires the same email that placed the order; returns are newest-first. Leaves out the private refund draft (`refundAmountInCents`, `refundState`, `amountOwedInCents`, `refundCurrency`): `money` reports what the customer requested, what the merchant published once the return is approved, and the refund this return actually issued — each with its own availability and historical currency. Like the route it accompanies, this email-gated operation is a measured retirement target; new clients use the authenticated by-reference `/facts` operations.",
        "operationId": "PublicReturnController_listWithFacts",
        "parameters": [
          {
            "name": "orderId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "email",
            "required": true,
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "x-storefront-origin",
            "required": false,
            "description": "Required for server requests without browser Origin. Forward the actual tenant storefront HTTPS origin (scheme and host only), or the actual hosted cartonium checkout origin. Domains determines the tenant and Production/Sandbox data automatically. Both origin headers, when present, must match. Missing, unregistered, unverified, or wrong-tenant origins fail closed; API deployment and mode headers cannot select a fallback. Local development only: a non-deployed API reached through a loopback connection and local Host also accepts actual http(s)://<tenant>.localhost:<port> and http(s)://<tenant>.sandbox.localhost:<port> checkout origins. These explicit hosted addresses select their own mode; bare localhost is never tenant or mode authority.",
            "schema": {
              "type": "string",
              "format": "uri",
              "example": "https://sandbox.store.example"
            }
          },
          {
            "in": "header",
            "name": "x-commerce-environment",
            "required": false,
            "description": "Optional consistency assertion only. The registered request origin selects commerce mode; this header cannot select a mode or replace a missing origin. If supplied it must match the origin-derived mode. Prefer omitting it. The response x-commerce-environment reports the selected mode.",
            "schema": {
              "type": "string",
              "enum": [
                "production",
                "sandbox"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/PublicReturnFactsDto"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Missing or malformed storefront origin context. Server requests must forward their actual HTTPS origin in x-storefront-origin.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorDto"
                }
              }
            }
          },
          "403": {
            "description": "Email mismatch is a documented #1475 UX/security exception: the public return flow returns 403 so legitimate customers can correct the email, while org scoping, rate limiting, and no extra order detail bound probing.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorDto"
                }
              }
            }
          },
          "404": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorDto"
                }
              }
            }
          },
          "429": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorDto"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "description": "Positive whole-number seconds to wait before retrying the request.",
                "schema": {
                  "type": "string",
                  "pattern": "^[1-9][0-9]*$"
                }
              }
            }
          },
          "503": {
            "description": "Return money facts are unavailable. The request is refused before the order or any return is read or changed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorDto"
                }
              }
            }
          }
        },
        "security": [
          {
            "OrganizationSlug": []
          }
        ],
        "summary": "List the calling customer's returns on this order, with factual money.",
        "tags": [
          "public-returns"
        ]
      }
    },
    "/api/v1/public/orders/{orderId}/returns/{returnId}/cancel/facts": {
      "post": {
        "deprecated": true,
        "description": "Factual companion of `POST /public/orders/{orderId}/returns/{returnId}/cancel`: the same customer-side cancellation rules and errors. Leaves out the private refund draft (`refundAmountInCents`, `refundState`, `amountOwedInCents`, `refundCurrency`): `money` reports what the customer requested, what the merchant published once the return is approved, and the refund this return actually issued — each with its own availability and historical currency. Like the route it accompanies, this email-gated operation is a measured retirement target; new clients use the authenticated by-reference `/facts` operations.",
        "operationId": "PublicReturnController_cancelWithFacts",
        "parameters": [
          {
            "name": "orderId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "returnId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "x-storefront-origin",
            "required": false,
            "description": "Required for server requests without browser Origin. Forward the actual tenant storefront HTTPS origin (scheme and host only), or the actual hosted cartonium checkout origin. Domains determines the tenant and Production/Sandbox data automatically. Both origin headers, when present, must match. Missing, unregistered, unverified, or wrong-tenant origins fail closed; API deployment and mode headers cannot select a fallback. Local development only: a non-deployed API reached through a loopback connection and local Host also accepts actual http(s)://<tenant>.localhost:<port> and http(s)://<tenant>.sandbox.localhost:<port> checkout origins. These explicit hosted addresses select their own mode; bare localhost is never tenant or mode authority.",
            "schema": {
              "type": "string",
              "format": "uri",
              "example": "https://sandbox.store.example"
            }
          },
          {
            "in": "header",
            "name": "x-commerce-environment",
            "required": false,
            "description": "Optional consistency assertion only. The registered request origin selects commerce mode; this header cannot select a mode or replace a missing origin. If supplied it must match the origin-derived mode. Prefer omitting it. The response x-commerce-environment reports the selected mode.",
            "schema": {
              "type": "string",
              "enum": [
                "production",
                "sandbox"
              ]
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CancelReturnDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicReturnFactsDto"
                }
              }
            }
          },
          "400": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorDto"
                }
              }
            }
          },
          "403": {
            "description": "Email mismatch is a documented #1475 UX/security exception: the public return flow returns 403 so legitimate customers can correct the email, while org scoping, rate limiting, and no extra order detail bound probing.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorDto"
                }
              }
            }
          },
          "404": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorDto"
                }
              }
            }
          },
          "429": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorDto"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "description": "Positive whole-number seconds to wait before retrying the request.",
                "schema": {
                  "type": "string",
                  "pattern": "^[1-9][0-9]*$"
                }
              }
            }
          },
          "503": {
            "description": "Return money facts are unavailable. The request is refused before the order or any return is read or changed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorDto"
                }
              }
            }
          }
        },
        "security": [
          {
            "OrganizationSlug": []
          }
        ],
        "summary": "Cancel a return while still REQUESTED or APPROVED, and read its factual money.",
        "tags": [
          "public-returns"
        ]
      }
    },
    "/api/v1/customer/account/orders/by-reference/{orderReference}/returns/facts": {
      "get": {
        "description": "Factual companion of `GET …/by-reference/{orderReference}/returns`: the same live CustomerSession, exact durable Order ownership, budgets and errors. The response leaves out the private refund draft (`refundAmountInCents`, `refundState`, `amountOwedInCents`, `refundCurrency`): `money` reports what the customer requested, what the merchant published once the return is approved, and the refund this return actually issued — each with its own availability and historical currency.",
        "operationId": "CustomerOrderReferenceController_listReturnFacts",
        "parameters": [
          {
            "name": "x-litecommerce-api-surface",
            "in": "header",
            "description": "Official cartonium hosted clients send `hosted` to attribute this API call to the included hosted-page daily allowance. This is usage attribution only; it grants no authentication, tenant scope or payment authority. Omitting it preserves the existing unmarked caller accounting.",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "hosted"
              ]
            }
          },
          {
            "name": "orderReference",
            "required": true,
            "in": "path",
            "description": "Stable customer-safe Order address. A reference never grants access by itself.",
            "schema": {
              "type": "string",
              "pattern": "^or1_[0-9a-f]{32}$",
              "maxLength": 128
            }
          },
          {
            "in": "header",
            "name": "x-storefront-origin",
            "required": false,
            "description": "Required for server requests without browser Origin. Forward the actual tenant storefront HTTPS origin (scheme and host only), or the actual hosted cartonium checkout origin. Domains determines the tenant and Production/Sandbox data automatically. Both origin headers, when present, must match. Missing, unregistered, unverified, or wrong-tenant origins fail closed; API deployment and mode headers cannot select a fallback. Local development only: a non-deployed API reached through a loopback connection and local Host also accepts actual http(s)://<tenant>.localhost:<port> and http(s)://<tenant>.sandbox.localhost:<port> checkout origins. These explicit hosted addresses select their own mode; bare localhost is never tenant or mode authority.",
            "schema": {
              "type": "string",
              "format": "uri",
              "example": "https://sandbox.store.example"
            }
          },
          {
            "in": "header",
            "name": "x-commerce-environment",
            "required": false,
            "description": "Optional consistency assertion only. The registered request origin selects commerce mode; this header cannot select a mode or replace a missing origin. If supplied it must match the origin-derived mode. Prefer omitting it. The response x-commerce-environment reports the selected mode.",
            "schema": {
              "type": "string",
              "enum": [
                "production",
                "sandbox"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "headers": {
              "Cache-Control": {
                "description": "Private response; never store in a browser or intermediary.",
                "schema": {
                  "type": "string",
                  "example": "private, no-store"
                }
              },
              "Pragma": {
                "description": "HTTP/1.0-compatible no-cache directive.",
                "schema": {
                  "type": "string",
                  "example": "no-cache"
                }
              },
              "Vary": {
                "description": "Credential and tenant dimensions used by this response.",
                "schema": {
                  "type": "string",
                  "example": "x-organization-slug, Authorization, Cookie"
                }
              }
            },
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CustomerReturnFactsListByReferenceResponseDto"
                }
              }
            }
          },
          "400": {
            "description": "Missing or malformed storefront origin context. Server requests must forward their actual HTTPS origin in x-storefront-origin.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorDto"
                }
              }
            }
          },
          "401": {
            "headers": {
              "Cache-Control": {
                "description": "Private response; never store in a browser or intermediary.",
                "schema": {
                  "type": "string",
                  "example": "private, no-store"
                }
              },
              "Pragma": {
                "description": "HTTP/1.0-compatible no-cache directive.",
                "schema": {
                  "type": "string",
                  "example": "no-cache"
                }
              },
              "Vary": {
                "description": "Credential and tenant dimensions used by this response.",
                "schema": {
                  "type": "string",
                  "example": "x-organization-slug, Authorization, Cookie"
                }
              }
            },
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorDto"
                }
              }
            }
          },
          "403": {
            "description": "Storefront origin is unavailable, unverified, belongs to another tenant, or conflicts with the browser origin or requested commerce mode.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorDto"
                }
              }
            }
          },
          "404": {
            "headers": {
              "Cache-Control": {
                "description": "Private response; never store in a browser or intermediary.",
                "schema": {
                  "type": "string",
                  "example": "private, no-store"
                }
              },
              "Pragma": {
                "description": "HTTP/1.0-compatible no-cache directive.",
                "schema": {
                  "type": "string",
                  "example": "no-cache"
                }
              },
              "Vary": {
                "description": "Credential and tenant dimensions used by this response.",
                "schema": {
                  "type": "string",
                  "example": "x-organization-slug, Authorization, Cookie"
                }
              }
            },
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorDto"
                }
              }
            }
          },
          "429": {
            "headers": {
              "Cache-Control": {
                "description": "Private response; never store in a browser or intermediary.",
                "schema": {
                  "type": "string",
                  "example": "private, no-store"
                }
              },
              "Pragma": {
                "description": "HTTP/1.0-compatible no-cache directive.",
                "schema": {
                  "type": "string",
                  "example": "no-cache"
                }
              },
              "Vary": {
                "description": "Credential and tenant dimensions used by this response.",
                "schema": {
                  "type": "string",
                  "example": "x-organization-slug, Authorization, Cookie"
                }
              },
              "Retry-After": {
                "description": "Positive whole-number seconds to wait before retrying the request.",
                "schema": {
                  "type": "string",
                  "pattern": "^[1-9][0-9]*$"
                }
              }
            },
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorDto"
                }
              }
            }
          },
          "503": {
            "headers": {
              "Cache-Control": {
                "description": "Private response; never store in a browser or intermediary.",
                "schema": {
                  "type": "string",
                  "example": "private, no-store"
                }
              },
              "Pragma": {
                "description": "HTTP/1.0-compatible no-cache directive.",
                "schema": {
                  "type": "string",
                  "example": "no-cache"
                }
              },
              "Vary": {
                "description": "Credential and tenant dimensions used by this response.",
                "schema": {
                  "type": "string",
                  "example": "x-organization-slug, Authorization, Cookie"
                }
              }
            },
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorDto"
                }
              }
            }
          }
        },
        "security": [
          {
            "OrganizationSlug": [],
            "CustomerSession": []
          }
        ],
        "summary": "List returns, with factual money, for an owned reference-addressed order.",
        "tags": [
          "customer-account"
        ]
      },
      "post": {
        "description": "Factual companion of `POST …/by-reference/{orderReference}/returns`: the same session/ownership authorization, budgets, validation, command and errors; no customer email credential. The response leaves out the private refund draft (`refundAmountInCents`, `refundState`, `amountOwedInCents`, `refundCurrency`): `money` reports what the customer requested, what the merchant published once the return is approved, and the refund this return actually issued — each with its own availability and historical currency.",
        "operationId": "CustomerOrderReferenceController_createReturnFacts",
        "parameters": [
          {
            "name": "x-litecommerce-api-surface",
            "in": "header",
            "description": "Official cartonium hosted clients send `hosted` to attribute this API call to the included hosted-page daily allowance. This is usage attribution only; it grants no authentication, tenant scope or payment authority. Omitting it preserves the existing unmarked caller accounting.",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "hosted"
              ]
            }
          },
          {
            "name": "orderReference",
            "required": true,
            "in": "path",
            "description": "Stable customer-safe Order address. A reference never grants access by itself.",
            "schema": {
              "type": "string",
              "pattern": "^or1_[0-9a-f]{32}$",
              "maxLength": 128
            }
          },
          {
            "in": "header",
            "name": "x-storefront-origin",
            "required": false,
            "description": "Required for server requests without browser Origin. Forward the actual tenant storefront HTTPS origin (scheme and host only), or the actual hosted cartonium checkout origin. Domains determines the tenant and Production/Sandbox data automatically. Both origin headers, when present, must match. Missing, unregistered, unverified, or wrong-tenant origins fail closed; API deployment and mode headers cannot select a fallback. Local development only: a non-deployed API reached through a loopback connection and local Host also accepts actual http(s)://<tenant>.localhost:<port> and http(s)://<tenant>.sandbox.localhost:<port> checkout origins. These explicit hosted addresses select their own mode; bare localhost is never tenant or mode authority.",
            "schema": {
              "type": "string",
              "format": "uri",
              "example": "https://sandbox.store.example"
            }
          },
          {
            "in": "header",
            "name": "x-commerce-environment",
            "required": false,
            "description": "Optional consistency assertion only. The registered request origin selects commerce mode; this header cannot select a mode or replace a missing origin. If supplied it must match the origin-derived mode. Prefer omitting it. The response x-commerce-environment reports the selected mode.",
            "schema": {
              "type": "string",
              "enum": [
                "production",
                "sandbox"
              ]
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateReturnByReferenceDto"
              }
            }
          }
        },
        "responses": {
          "201": {
            "headers": {
              "Cache-Control": {
                "description": "Private response; never store in a browser or intermediary.",
                "schema": {
                  "type": "string",
                  "example": "private, no-store"
                }
              },
              "Pragma": {
                "description": "HTTP/1.0-compatible no-cache directive.",
                "schema": {
                  "type": "string",
                  "example": "no-cache"
                }
              },
              "Vary": {
                "description": "Credential and tenant dimensions used by this response.",
                "schema": {
                  "type": "string",
                  "example": "x-organization-slug, Authorization, Cookie"
                }
              }
            },
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrderReferenceReturnFactsDto"
                }
              }
            }
          },
          "400": {
            "headers": {
              "Cache-Control": {
                "description": "Private response; never store in a browser or intermediary.",
                "schema": {
                  "type": "string",
                  "example": "private, no-store"
                }
              },
              "Pragma": {
                "description": "HTTP/1.0-compatible no-cache directive.",
                "schema": {
                  "type": "string",
                  "example": "no-cache"
                }
              },
              "Vary": {
                "description": "Credential and tenant dimensions used by this response.",
                "schema": {
                  "type": "string",
                  "example": "x-organization-slug, Authorization, Cookie"
                }
              }
            },
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorDto"
                }
              }
            }
          },
          "401": {
            "headers": {
              "Cache-Control": {
                "description": "Private response; never store in a browser or intermediary.",
                "schema": {
                  "type": "string",
                  "example": "private, no-store"
                }
              },
              "Pragma": {
                "description": "HTTP/1.0-compatible no-cache directive.",
                "schema": {
                  "type": "string",
                  "example": "no-cache"
                }
              },
              "Vary": {
                "description": "Credential and tenant dimensions used by this response.",
                "schema": {
                  "type": "string",
                  "example": "x-organization-slug, Authorization, Cookie"
                }
              }
            },
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorDto"
                }
              }
            }
          },
          "403": {
            "description": "Storefront origin is unavailable, unverified, belongs to another tenant, or conflicts with the browser origin or requested commerce mode.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorDto"
                }
              }
            }
          },
          "404": {
            "headers": {
              "Cache-Control": {
                "description": "Private response; never store in a browser or intermediary.",
                "schema": {
                  "type": "string",
                  "example": "private, no-store"
                }
              },
              "Pragma": {
                "description": "HTTP/1.0-compatible no-cache directive.",
                "schema": {
                  "type": "string",
                  "example": "no-cache"
                }
              },
              "Vary": {
                "description": "Credential and tenant dimensions used by this response.",
                "schema": {
                  "type": "string",
                  "example": "x-organization-slug, Authorization, Cookie"
                }
              }
            },
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorDto"
                }
              }
            }
          },
          "409": {
            "headers": {
              "Cache-Control": {
                "description": "Private response; never store in a browser or intermediary.",
                "schema": {
                  "type": "string",
                  "example": "private, no-store"
                }
              },
              "Pragma": {
                "description": "HTTP/1.0-compatible no-cache directive.",
                "schema": {
                  "type": "string",
                  "example": "no-cache"
                }
              },
              "Vary": {
                "description": "Credential and tenant dimensions used by this response.",
                "schema": {
                  "type": "string",
                  "example": "x-organization-slug, Authorization, Cookie"
                }
              }
            },
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorDto"
                }
              }
            }
          },
          "429": {
            "headers": {
              "Cache-Control": {
                "description": "Private response; never store in a browser or intermediary.",
                "schema": {
                  "type": "string",
                  "example": "private, no-store"
                }
              },
              "Pragma": {
                "description": "HTTP/1.0-compatible no-cache directive.",
                "schema": {
                  "type": "string",
                  "example": "no-cache"
                }
              },
              "Vary": {
                "description": "Credential and tenant dimensions used by this response.",
                "schema": {
                  "type": "string",
                  "example": "x-organization-slug, Authorization, Cookie"
                }
              },
              "Retry-After": {
                "description": "Positive whole-number seconds to wait before retrying the request.",
                "schema": {
                  "type": "string",
                  "pattern": "^[1-9][0-9]*$"
                }
              }
            },
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorDto"
                }
              }
            }
          },
          "503": {
            "headers": {
              "Cache-Control": {
                "description": "Private response; never store in a browser or intermediary.",
                "schema": {
                  "type": "string",
                  "example": "private, no-store"
                }
              },
              "Pragma": {
                "description": "HTTP/1.0-compatible no-cache directive.",
                "schema": {
                  "type": "string",
                  "example": "no-cache"
                }
              },
              "Vary": {
                "description": "Credential and tenant dimensions used by this response.",
                "schema": {
                  "type": "string",
                  "example": "x-organization-slug, Authorization, Cookie"
                }
              }
            },
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorDto"
                }
              }
            }
          }
        },
        "security": [
          {
            "OrganizationSlug": [],
            "CustomerSession": []
          }
        ],
        "summary": "Create a return for an owned reference-addressed order, with factual money.",
        "tags": [
          "customer-account"
        ]
      }
    },
    "/api/v1/customer/account/orders/by-reference/{orderReference}/returns/{returnId}/cancel/facts": {
      "post": {
        "description": "Factual companion of `POST …/by-reference/{orderReference}/returns/{returnId}/cancel`: the Return must belong to the exact tenant and referenced parent Order and remain customer-cancellable; same budgets and errors. The response leaves out the private refund draft (`refundAmountInCents`, `refundState`, `amountOwedInCents`, `refundCurrency`): `money` reports what the customer requested, what the merchant published once the return is approved, and the refund this return actually issued — each with its own availability and historical currency.",
        "operationId": "CustomerOrderReferenceController_cancelReturnFacts",
        "parameters": [
          {
            "name": "x-litecommerce-api-surface",
            "in": "header",
            "description": "Official cartonium hosted clients send `hosted` to attribute this API call to the included hosted-page daily allowance. This is usage attribution only; it grants no authentication, tenant scope or payment authority. Omitting it preserves the existing unmarked caller accounting.",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "hosted"
              ]
            }
          },
          {
            "name": "orderReference",
            "required": true,
            "in": "path",
            "description": "Stable customer-safe Order address. A reference never grants access by itself.",
            "schema": {
              "type": "string",
              "pattern": "^or1_[0-9a-f]{32}$",
              "maxLength": 128
            }
          },
          {
            "name": "returnId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "x-storefront-origin",
            "required": false,
            "description": "Required for server requests without browser Origin. Forward the actual tenant storefront HTTPS origin (scheme and host only), or the actual hosted cartonium checkout origin. Domains determines the tenant and Production/Sandbox data automatically. Both origin headers, when present, must match. Missing, unregistered, unverified, or wrong-tenant origins fail closed; API deployment and mode headers cannot select a fallback. Local development only: a non-deployed API reached through a loopback connection and local Host also accepts actual http(s)://<tenant>.localhost:<port> and http(s)://<tenant>.sandbox.localhost:<port> checkout origins. These explicit hosted addresses select their own mode; bare localhost is never tenant or mode authority.",
            "schema": {
              "type": "string",
              "format": "uri",
              "example": "https://sandbox.store.example"
            }
          },
          {
            "in": "header",
            "name": "x-commerce-environment",
            "required": false,
            "description": "Optional consistency assertion only. The registered request origin selects commerce mode; this header cannot select a mode or replace a missing origin. If supplied it must match the origin-derived mode. Prefer omitting it. The response x-commerce-environment reports the selected mode.",
            "schema": {
              "type": "string",
              "enum": [
                "production",
                "sandbox"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "headers": {
              "Cache-Control": {
                "description": "Private response; never store in a browser or intermediary.",
                "schema": {
                  "type": "string",
                  "example": "private, no-store"
                }
              },
              "Pragma": {
                "description": "HTTP/1.0-compatible no-cache directive.",
                "schema": {
                  "type": "string",
                  "example": "no-cache"
                }
              },
              "Vary": {
                "description": "Credential and tenant dimensions used by this response.",
                "schema": {
                  "type": "string",
                  "example": "x-organization-slug, Authorization, Cookie"
                }
              }
            },
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrderReferenceReturnFactsDto"
                }
              }
            }
          },
          "400": {
            "headers": {
              "Cache-Control": {
                "description": "Private response; never store in a browser or intermediary.",
                "schema": {
                  "type": "string",
                  "example": "private, no-store"
                }
              },
              "Pragma": {
                "description": "HTTP/1.0-compatible no-cache directive.",
                "schema": {
                  "type": "string",
                  "example": "no-cache"
                }
              },
              "Vary": {
                "description": "Credential and tenant dimensions used by this response.",
                "schema": {
                  "type": "string",
                  "example": "x-organization-slug, Authorization, Cookie"
                }
              }
            },
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorDto"
                }
              }
            }
          },
          "401": {
            "headers": {
              "Cache-Control": {
                "description": "Private response; never store in a browser or intermediary.",
                "schema": {
                  "type": "string",
                  "example": "private, no-store"
                }
              },
              "Pragma": {
                "description": "HTTP/1.0-compatible no-cache directive.",
                "schema": {
                  "type": "string",
                  "example": "no-cache"
                }
              },
              "Vary": {
                "description": "Credential and tenant dimensions used by this response.",
                "schema": {
                  "type": "string",
                  "example": "x-organization-slug, Authorization, Cookie"
                }
              }
            },
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorDto"
                }
              }
            }
          },
          "403": {
            "description": "Storefront origin is unavailable, unverified, belongs to another tenant, or conflicts with the browser origin or requested commerce mode.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorDto"
                }
              }
            }
          },
          "404": {
            "headers": {
              "Cache-Control": {
                "description": "Private response; never store in a browser or intermediary.",
                "schema": {
                  "type": "string",
                  "example": "private, no-store"
                }
              },
              "Pragma": {
                "description": "HTTP/1.0-compatible no-cache directive.",
                "schema": {
                  "type": "string",
                  "example": "no-cache"
                }
              },
              "Vary": {
                "description": "Credential and tenant dimensions used by this response.",
                "schema": {
                  "type": "string",
                  "example": "x-organization-slug, Authorization, Cookie"
                }
              }
            },
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorDto"
                }
              }
            }
          },
          "409": {
            "headers": {
              "Cache-Control": {
                "description": "Private response; never store in a browser or intermediary.",
                "schema": {
                  "type": "string",
                  "example": "private, no-store"
                }
              },
              "Pragma": {
                "description": "HTTP/1.0-compatible no-cache directive.",
                "schema": {
                  "type": "string",
                  "example": "no-cache"
                }
              },
              "Vary": {
                "description": "Credential and tenant dimensions used by this response.",
                "schema": {
                  "type": "string",
                  "example": "x-organization-slug, Authorization, Cookie"
                }
              }
            },
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorDto"
                }
              }
            }
          },
          "429": {
            "headers": {
              "Cache-Control": {
                "description": "Private response; never store in a browser or intermediary.",
                "schema": {
                  "type": "string",
                  "example": "private, no-store"
                }
              },
              "Pragma": {
                "description": "HTTP/1.0-compatible no-cache directive.",
                "schema": {
                  "type": "string",
                  "example": "no-cache"
                }
              },
              "Vary": {
                "description": "Credential and tenant dimensions used by this response.",
                "schema": {
                  "type": "string",
                  "example": "x-organization-slug, Authorization, Cookie"
                }
              },
              "Retry-After": {
                "description": "Positive whole-number seconds to wait before retrying the request.",
                "schema": {
                  "type": "string",
                  "pattern": "^[1-9][0-9]*$"
                }
              }
            },
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorDto"
                }
              }
            }
          },
          "503": {
            "headers": {
              "Cache-Control": {
                "description": "Private response; never store in a browser or intermediary.",
                "schema": {
                  "type": "string",
                  "example": "private, no-store"
                }
              },
              "Pragma": {
                "description": "HTTP/1.0-compatible no-cache directive.",
                "schema": {
                  "type": "string",
                  "example": "no-cache"
                }
              },
              "Vary": {
                "description": "Credential and tenant dimensions used by this response.",
                "schema": {
                  "type": "string",
                  "example": "x-organization-slug, Authorization, Cookie"
                }
              }
            },
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorDto"
                }
              }
            }
          }
        },
        "security": [
          {
            "OrganizationSlug": [],
            "CustomerSession": []
          }
        ],
        "summary": "Cancel a return on an owned reference-addressed order, with factual money.",
        "tags": [
          "customer-account"
        ]
      }
    },
    "/api/v1/customer/account/orders/{orderNumber}/returns/facts": {
      "get": {
        "description": "Factual companion of `GET /customer/account/orders/{orderNumber}/returns`: the same session and durable Order ownership; returns are newest-first. The response leaves out the private refund draft (`refundAmountInCents`, `refundState`, `amountOwedInCents`, `refundCurrency`): `money` reports what the customer requested, what the merchant published once the return is approved, and the refund this return actually issued — each with its own availability and historical currency. Responses are private and non-cacheable.",
        "operationId": "CustomerActionsController_listReturnFacts",
        "parameters": [
          {
            "name": "x-litecommerce-api-surface",
            "in": "header",
            "description": "Official cartonium hosted clients send `hosted` to attribute this API call to the included hosted-page daily allowance. This is usage attribution only; it grants no authentication, tenant scope or payment authority. Omitting it preserves the existing unmarked caller accounting.",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "hosted"
              ]
            }
          },
          {
            "name": "orderNumber",
            "required": true,
            "in": "path",
            "description": "Public order number.",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "x-storefront-origin",
            "required": false,
            "description": "Required for server requests without browser Origin. Forward the actual tenant storefront HTTPS origin (scheme and host only), or the actual hosted cartonium checkout origin. Domains determines the tenant and Production/Sandbox data automatically. Both origin headers, when present, must match. Missing, unregistered, unverified, or wrong-tenant origins fail closed; API deployment and mode headers cannot select a fallback. Local development only: a non-deployed API reached through a loopback connection and local Host also accepts actual http(s)://<tenant>.localhost:<port> and http(s)://<tenant>.sandbox.localhost:<port> checkout origins. These explicit hosted addresses select their own mode; bare localhost is never tenant or mode authority.",
            "schema": {
              "type": "string",
              "format": "uri",
              "example": "https://sandbox.store.example"
            }
          },
          {
            "in": "header",
            "name": "x-commerce-environment",
            "required": false,
            "description": "Optional consistency assertion only. The registered request origin selects commerce mode; this header cannot select a mode or replace a missing origin. If supplied it must match the origin-derived mode. Prefer omitting it. The response x-commerce-environment reports the selected mode.",
            "schema": {
              "type": "string",
              "enum": [
                "production",
                "sandbox"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CustomerReturnFactsListResponseDto"
                }
              }
            }
          },
          "400": {
            "description": "Missing or malformed storefront origin context. Server requests must forward their actual HTTPS origin in x-storefront-origin.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorDto"
                }
              }
            }
          },
          "401": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorDto"
                }
              }
            }
          },
          "403": {
            "description": "Storefront origin is unavailable, unverified, belongs to another tenant, or conflicts with the browser origin or requested commerce mode.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorDto"
                }
              }
            }
          },
          "404": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorDto"
                }
              }
            }
          },
          "429": {
            "description": "Marked hosted-page traffic exhausted the included hosted or total daily API allowance. Both reset at UTC midnight. A rejected reservation increments neither counter; details.limitKey is hostedApiCallsPerDay when the hosted sublimit was reached.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorDto"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "description": "Positive whole-number seconds to wait before retrying the request.",
                "schema": {
                  "type": "string",
                  "pattern": "^[1-9][0-9]*$"
                }
              }
            }
          }
        },
        "security": [
          {
            "OrganizationSlug": [],
            "CustomerSession": []
          }
        ],
        "summary": "List returns, with factual money, for one of the authenticated customer’s orders.",
        "tags": [
          "customer-actions"
        ]
      }
    },
    "/api/v1/customer/actions/{token}/facts": {
      "post": {
        "description": "Factual companion of `POST /customer/actions/{token}`: the token is the credential, still tenant-scoped by the organization slug, and is consumed once; repeating either operation returns the same return without acting again. On a replay the requested evidence is the original submission, while approval and refund show their current state. The response leaves out the private refund draft (`refundAmountInCents`, `refundState`, `amountOwedInCents`, `refundCurrency`): `money` reports what the customer requested, what the merchant published once the return is approved, and the refund this return actually issued — each with its own availability and historical currency. Responses are private and non-cacheable.",
        "operationId": "CustomerActionsController_consumeActionFacts",
        "parameters": [
          {
            "name": "x-litecommerce-api-surface",
            "in": "header",
            "description": "Official cartonium hosted clients send `hosted` to attribute this API call to the included hosted-page daily allowance. This is usage attribution only; it grants no authentication, tenant scope or payment authority. Omitting it preserves the existing unmarked caller accounting.",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "hosted"
              ]
            }
          },
          {
            "name": "token",
            "required": true,
            "in": "path",
            "description": "Raw customer action token.",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "x-storefront-origin",
            "required": false,
            "description": "Required for server requests without browser Origin. Forward the actual tenant storefront HTTPS origin (scheme and host only), or the actual hosted cartonium checkout origin. Domains determines the tenant and Production/Sandbox data automatically. Both origin headers, when present, must match. Missing, unregistered, unverified, or wrong-tenant origins fail closed; API deployment and mode headers cannot select a fallback. Local development only: a non-deployed API reached through a loopback connection and local Host also accepts actual http(s)://<tenant>.localhost:<port> and http(s)://<tenant>.sandbox.localhost:<port> checkout origins. These explicit hosted addresses select their own mode; bare localhost is never tenant or mode authority.",
            "schema": {
              "type": "string",
              "format": "uri",
              "example": "https://sandbox.store.example"
            }
          },
          {
            "in": "header",
            "name": "x-commerce-environment",
            "required": false,
            "description": "Optional consistency assertion only. The registered request origin selects commerce mode; this header cannot select a mode or replace a missing origin. If supplied it must match the origin-derived mode. Prefer omitting it. The response x-commerce-environment reports the selected mode.",
            "schema": {
              "type": "string",
              "enum": [
                "production",
                "sandbox"
              ]
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ConsumeReturnActionDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CustomerActionConsumeFactsResponseDto"
                }
              }
            }
          },
          "400": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorDto"
                }
              }
            }
          },
          "403": {
            "description": "Storefront origin is unavailable, unverified, belongs to another tenant, or conflicts with the browser origin or requested commerce mode.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorDto"
                }
              }
            }
          },
          "404": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorDto"
                }
              }
            }
          },
          "409": {
            "description": "RETURN_REQUESTED_REVIEW_STALE means the reviewed selection or estimate changed without creating a Return. Review again and reuse the same token; other eligibility/source conflicts require correction or order reload.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorDto"
                }
              }
            }
          },
          "429": {
            "description": "Marked hosted-page traffic exhausted the included hosted or total daily API allowance. Both reset at UTC midnight. A rejected reservation increments neither counter; details.limitKey is hostedApiCallsPerDay when the hosted sublimit was reached.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiErrorDto"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "description": "Positive whole-number seconds to wait before retrying the request.",
                "schema": {
                  "type": "string",
                  "pattern": "^[1-9][0-9]*$"
                }
              }
            }
          }
        },
        "security": [
          {
            "OrganizationSlug": []
          }
        ],
        "summary": "Consume a scoped customer action token, with factual return money.",
        "tags": [
          "customer-actions"
        ]
      }
    }
  },
  "components": {
    "schemas": {
      "ApiErrorDto": {
        "type": "object",
        "properties": {
          "code": {
            "type": "string",
            "description": "Open-ended stable string code. Branch on known codes and fall back to the HTTP status and generic error envelope for an unknown code.",
            "example": "VALIDATION_FAILED",
            "x-extensible-enum": [
              "VALIDATION_FAILED",
              "CANADIAN_OPERATING_PROFILE_UNAVAILABLE",
              "AUTH_MISSING_TOKEN",
              "AUTH_INVALID_TOKEN",
              "MEMBERSHIP_REQUIRED",
              "TEAM_REMOVAL_UNAVAILABLE",
              "ROLE_INSUFFICIENT",
              "PLATFORM_ACCESS_DENIED",
              "RESOURCE_NOT_FOUND",
              "RESOURCE_CONFLICT",
              "DATABASE_ERROR",
              "INTERNAL_ERROR",
              "STOREFRONT_CONSENT_UNAVAILABLE",
              "BAD_REQUEST",
              "LIMIT_EXCEEDED",
              "RATE_LIMIT_EXCEEDED",
              "ORGANIZATION_SUSPENDED",
              "ORGANIZATION_ARCHIVED",
              "ORGANIZATION_ACCESS_UNAVAILABLE",
              "API_KEY_SCOPE_INSUFFICIENT",
              "COMMERCE_REVISION_IMMUTABLE",
              "COMMERCE_REVISION_STALE",
              "HIGH_RISK_REASON_REQUIRED",
              "HIGH_RISK_STEP_UP_REQUIRED",
              "COMMERCE_IDEMPOTENCY_CONFLICT",
              "COMMERCE_EXTERNAL_ID_CONFLICT",
              "COMMERCE_LIFECYCLE_INVALID",
              "COMMERCE_PAYMENT_INVALID",
              "COMMERCE_OVERRIDE_ACTIVE",
              "COMMERCE_LINKED_INVOICE_UNAVAILABLE",
              "COMMERCE_INVOICE_ORDER_INELIGIBLE",
              "API_KEY_SCOPE_GATED",
              "IMPORT_ROW_VALIDATION_FAILED",
              "IMPORT_ROW_CONFLICT",
              "IMPORT_ROW_UNRESOLVED_REFERENCE",
              "IMPORT_BATCH_TOO_LARGE",
              "POS_NOT_READY",
              "POS_SESSION_INVALID",
              "POS_ORGANIZATION_REQUIRED",
              "BOOKING_CAPACITY_UNAVAILABLE",
              "BOOKING_IDEMPOTENCY_CONFLICT",
              "BOOKING_CONFIGURATION_BUSY",
              "BOOKING_GROUP_LIMIT_EXCEEDED",
              "BOOKING_GROUP_INCOMPATIBLE",
              "BOOKING_GROUP_SECURITY_AUTH_UNSUPPORTED",
              "BOOKING_GROUP_IDEMPOTENCY_CONFLICT",
              "BOOKING_GROUP_ACTION_REQUIRED",
              "BOOKING_GROUP_ACTION_INVALID",
              "PLATFORM_BILLING_UNAVAILABLE",
              "PLATFORM_BILLING_QUOTE_STALE",
              "PLATFORM_BILLING_RECOVERY_REQUIRED",
              "BOOKING_DELIVERY_INVALID",
              "BOOKING_DELIVERY_DESTINATION_INVALID",
              "BOOKING_DELIVERY_UNAVAILABLE",
              "BOOKING_DELIVERY_OUT_OF_RANGE",
              "BOOKING_DELIVERY_CONFIGURATION_CHANGED",
              "AGREEMENT_ACTION_REQUIRED",
              "AGREEMENT_POLICY_INVALID",
              "AGREEMENT_APPLICABILITY_INVALID",
              "AGREEMENT_WAIVER_REASON_REQUIRED",
              "AGREEMENT_REQUIREMENT_INVALID",
              "ENTITLEMENT_TOKENS_UNAVAILABLE",
              "ENTITLEMENT_NOT_CONSUMABLE",
              "SUBSCRIPTION_PAYMENT_RECOVERY_UNAVAILABLE",
              "SUBSCRIPTION_PAYMENT_RECOVERY_UNSUPPORTED",
              "COMPOSITION_REVISION_STALE",
              "COMPOSITION_INVALID",
              "COMPOSITION_INVENTORY_CONFLICT",
              "COMPOSITION_COMPONENT_MAPPING_MISSING",
              "COMPOSITION_COMPONENT_MAPPING_AMBIGUOUS",
              "SUPPORT_PROVIDER_CONFIGURATION_UNAVAILABLE",
              "SUPPORT_PROVIDER_CONNECTION_CONFLICT",
              "SUBSCRIPTION_PAYMENT_RECOVERY_RESEND_REJECTED",
              "CATALOG_MEDIA_QUARANTINED",
              "EMAIL_SENDING_DOMAIN_LIFECYCLE_UNAVAILABLE",
              "CHECKOUT_PREPARED_PAYMENT_CONFLICT",
              "HOSTED_CHECKOUT_POLICY_UNAVAILABLE",
              "CHECKOUT_UNAVAILABLE",
              "HOSTED_CHECKOUT_RESTART_REFUSED",
              "API_SCHEMA_IDENTITY_UNAVAILABLE",
              "PLATFORM_BILLING_PLAN_CHANGE_REJECTED",
              "BOOKING_PRICE_CONFIRMATION_REQUIRED",
              "BOOKING_PRICE_CONFIRMATION_UNAVAILABLE",
              "EMAIL_TEST_RECIPIENT_REJECTED",
              "EMAIL_TEST_DELIVERY_UNAVAILABLE",
              "PRICING_POLICY_INCOMPATIBLE",
              "CHECKOUT_IDENTITY_CHANGED",
              "CHECKOUT_IDENTITY_VERIFICATION_REQUIRED",
              "ORDER_REFERENCE_UNAVAILABLE",
              "ORDER_REFERENCE_SERVICE_UNAVAILABLE",
              "PLATFORM_TAX_UNAVAILABLE",
              "TENANT_TAX_NOT_CONFIGURED",
              "POS_SALE_REJECTED",
              "POS_SALE_FILTER_READ_UNAVAILABLE",
              "POS_SALE_REJECTION_PERSISTENCE_FAILED",
              "POS_CUSTOMER_CREATE_PERSISTENCE_UNAVAILABLE",
              "POS_SALE_CUSTOMER_CHANGE_UNAVAILABLE",
              "CHECKOUT_ALREADY_PAID",
              "CHECKOUT_SAVED_CARD_CHOICE_MISMATCH",
              "CHECKOUT_ANALYTICS_ADOPTION_UNAVAILABLE",
              "CHECKOUT_ANALYTICS_ADOPTION_REJECTED",
              "PAYMENT_POLICY_SETTINGS_UNAVAILABLE",
              "PAYMENT_POLICY_REVISION_CONFLICT",
              "PAYMENT_POLICY_SAVE_REJECTED",
              "POS_PAYMENT_PROOF_NOT_SETTLED",
              "POS_PAYMENT_PROOF_UNAVAILABLE",
              "POS_TERMINAL_OUTCOME_CONFLICT",
              "POS_TERMINAL_OUTCOME_UNAVAILABLE",
              "POS_TERMINAL_NOTIFICATION_UNAVAILABLE",
              "RETURN_STAFF_CREATION_UNAVAILABLE",
              "DOMAIN_VERIFICATION_UNAVAILABLE",
              "NUMBERING_SAVE_REJECTED",
              "NUMBERING_FORMAT_INVALID",
              "NUMBERING_FORMAT_LOCKED",
              "NUMBERING_WRITES_UNAVAILABLE",
              "NUMBERING_AUDIT_UNAVAILABLE",
              "RETURN_REQUESTED_REVIEW_STALE",
              "USAGE_ALERT_SETTINGS_UNAVAILABLE",
              "STOCK_LOCATION_WRITES_UNAVAILABLE",
              "STOCK_LOCATION_LOOKUP_UNAVAILABLE"
            ]
          },
          "message": {
            "type": "string",
            "description": "Human-readable explanation. Not localized.",
            "example": "Request body failed validation"
          },
          "details": {
            "type": "object",
            "description": "Optional structured context. Shape varies by error code; e.g. VALIDATION_FAILED returns the per-field violation list.",
            "additionalProperties": true
          }
        },
        "required": [
          "code",
          "message"
        ]
      },
      "CancelReturnDto": {
        "type": "object",
        "properties": {
          "customerEmail": {
            "type": "string",
            "description": "Customer email. Must match the order's customerEmail (case-folded, trimmed) — the same shared-secret check used to file the return.",
            "maxLength": 320
          }
        },
        "required": [
          "customerEmail"
        ],
        "additionalProperties": false
      },
      "ConsumeReturnActionDto": {
        "type": "object",
        "properties": {
          "reviewedEstimate": {
            "description": "Exact estimate deliberately reviewed before this consume. Omission means no monetary acknowledgement; a new Return has no requested-evidence row (NOT_CAPTURED) instead of an unseen total. Changed evidence returns 409 without creating a Return; review again and reuse this same token. A committed token replay always returns its original requested evidence.",
            "allOf": [
              {
                "$ref": "#/components/schemas/ReturnRequestedReviewDto"
              }
            ]
          }
        },
        "additionalProperties": false
      },
      "CreateReturnByReferenceDto": {
        "type": "object",
        "properties": {
          "customerName": {
            "type": "string",
            "description": "Optional display name for the requester.",
            "maxLength": 200
          },
          "reason": {
            "type": "string",
            "description": "Free-text reason for the return.",
            "maxLength": 4000
          },
          "items": {
            "description": "Lines being returned. 1-50 entries; cumulative quantity across non-cancelled returns may not exceed the original order line.",
            "minItems": 1,
            "maxItems": 50,
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CreateReturnItemDto"
            }
          },
          "reviewedEstimate": {
            "description": "Estimate deliberately reviewed for this selection. Omission leaves requested money uncaptured (NOT_CAPTURED), never an unseen amount. Changed reviewed evidence returns 409 before creation.",
            "allOf": [
              {
                "$ref": "#/components/schemas/ReturnRequestedReviewDto"
              }
            ]
          }
        },
        "required": [
          "items"
        ],
        "additionalProperties": false
      },
      "CreateReturnDto": {
        "type": "object",
        "properties": {
          "customerEmail": {
            "type": "string",
            "description": "Customer email. Must match the order's customerEmail (case-folded, trimmed) — slice 1A auth is shared-secret style.",
            "maxLength": 320
          },
          "customerName": {
            "type": "string",
            "description": "Optional display name for the requester.",
            "maxLength": 200
          },
          "reason": {
            "type": "string",
            "description": "Free-text reason for the return.",
            "maxLength": 4000
          },
          "items": {
            "description": "Lines being returned. 1-50 entries; cumulative quantity across non-cancelled returns may not exceed the original order line.",
            "minItems": 1,
            "maxItems": 50,
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CreateReturnItemDto"
            }
          }
        },
        "required": [
          "customerEmail",
          "items"
        ],
        "additionalProperties": false
      },
      "CreateReturnItemDto": {
        "type": "object",
        "properties": {
          "orderItemId": {
            "type": "string",
            "description": "Order item id this line is returning units from.",
            "minLength": 1
          },
          "quantity": {
            "type": "integer",
            "description": "How many units to return. Must be > 0 and <= the original order line's quantity minus what's already been requested on prior non-cancelled returns.",
            "minimum": 1
          }
        },
        "required": [
          "orderItemId",
          "quantity"
        ],
        "additionalProperties": false
      },
      "CustomerActionConsumeFactsResponseDto": {
        "type": "object",
        "properties": {
          "action": {
            "type": "string",
            "example": "order.return"
          },
          "status": {
            "type": "string",
            "example": "CONSUMED"
          },
          "returnRequest": {
            "description": "The return this token created. A replay returns the same return: its requested evidence never changes, while its approval and refund show their current state.",
            "allOf": [
              {
                "$ref": "#/components/schemas/CustomerReturnFactsDto"
              }
            ]
          }
        },
        "required": [
          "action",
          "status",
          "returnRequest"
        ]
      },
      "CustomerReturnApprovalItemOutcomeDto": {
        "type": "object",
        "properties": {
          "physicalDisposition": {
            "type": "string",
            "nullable": true,
            "description": "Explicit published v3 disposition for all approved units on this line; null for NOT_APPROVED. Omitted on legacy v2 outcomes, whose absence never proves a waiver. Historical revisions retain their own disposition; physical.keepPromises retains irrevocable grants. Unknown values mean unsupported disposition.",
            "x-extensible-enum": [
              "PHYSICAL_RETURN_REQUIRED",
              "NO_PHYSICAL_RETURN_REQUIRED"
            ]
          },
          "orderItemId": {
            "type": "string",
            "description": "Original requested order line covered by this outcome."
          },
          "outcome": {
            "type": "string",
            "enum": [
              "APPROVED",
              "NOT_APPROVED"
            ],
            "description": "Explicit published decision for this item; no decision is inferred from absence."
          },
          "approvedQuantity": {
            "type": "integer",
            "minimum": 0,
            "description": "Published approved units: positive for APPROVED and 0 for NOT_APPROVED."
          },
          "approvedAmountInCents": {
            "type": "integer",
            "minimum": 0,
            "nullable": true,
            "description": "Published approved contribution in this revision’s currency, including a genuine 0; `null` for NOT_APPROVED, which is never a zero-value approval."
          },
          "breakdownStatus": {
            "type": "string",
            "enum": [
              "COMPLETE",
              "UNAVAILABLE"
            ],
            "description": "Availability of this item’s published breakdown in the revision’s `components`. UNAVAILABLE has no item components and does not hide a known approved amount."
          },
          "customerNote": {
            "type": "string",
            "nullable": true,
            "description": "Stored customer-safe item note exactly as published, including refusal or reduction explanation; `null` when none was published. Never an internal note."
          },
          "requestedComparison": {
            "$ref": "#/components/schemas/CustomerReturnItemComparisonDto"
          }
        },
        "required": [
          "orderItemId",
          "outcome",
          "approvedQuantity",
          "approvedAmountInCents",
          "breakdownStatus",
          "customerNote",
          "requestedComparison"
        ]
      },
      "CustomerReturnApprovalMoneyDto": {
        "type": "object",
        "properties": {
          "availability": {
            "type": "string",
            "enum": [
              "AVAILABLE",
              "UNAVAILABLE"
            ],
            "description": "Whether an approval is in effect now. AVAILABLE only when the return has been approved (APPROVED, IN_TRANSIT, RECEIVED or COMPLETED) and the merchant has published an approval. An APPROVED status or a private refund draft alone never makes it AVAILABLE."
          },
          "unavailableReason": {
            "type": "string",
            "nullable": true,
            "description": "`null` when AVAILABLE. AWAITING_APPROVAL: the return is still REQUESTED, so nothing is approved yet, whatever the merchant has prepared. RETURN_CLOSED: the return was rejected or cancelled, so no approval is in effect; a return cancelled after approval keeps its `history`, while a rejected return, or one cancelled before approval, has none because no approval ever took effect. NOT_PUBLISHED: the return is approved but no approved amount has been published — including when money has since moved (see `refund`). Open-ended catalog: see x-extensible-enum; treat any other value as no approval in effect.",
            "x-extensible-enum": [
              "AWAITING_APPROVAL",
              "RETURN_CLOSED",
              "NOT_PUBLISHED"
            ]
          },
          "current": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/CustomerReturnApprovalRevisionDto"
              },
              {
                "type": "object",
                "nullable": true,
                "enum": [
                  null
                ]
              }
            ],
            "description": "The approval in effect now; `null` exactly when UNAVAILABLE."
          },
          "history": {
            "description": "Every revision that took effect for the customer, newest first, including `current` when there is one; a single entry means the approval was never replaced. Empty when UNAVAILABLE, except after a cancellation that followed approval: the return then reads UNAVAILABLE (RETURN_CLOSED) with `current` `null`, and this keeps every revision it carried while approved. No revision can be published after cancellation, so that history is final.",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CustomerReturnApprovalRevisionDto"
            }
          }
        },
        "required": [
          "availability",
          "unavailableReason",
          "current",
          "history"
        ]
      },
      "CustomerReturnApprovalRevisionDto": {
        "type": "object",
        "properties": {
          "revisionNumber": {
            "type": "integer",
            "minimum": 1,
            "description": "Publication sequence number; revision 1 is the first approval."
          },
          "approvedAmountInCents": {
            "type": "integer",
            "minimum": 0,
            "description": "Approved amount in minor units of `currency`; 0 is a genuine zero. An approval is a commitment, not money: refunds are reported by `refund`."
          },
          "currency": {
            "type": "string",
            "example": "usd",
            "description": "Lowercase ISO 4217 code of the order’s historical denomination."
          },
          "breakdownStatus": {
            "type": "string",
            "enum": [
              "COMPLETE",
              "UNAVAILABLE"
            ],
            "description": "COMPLETE when the merchant published a reconciled breakdown; UNAVAILABLE when only the total was published."
          },
          "lines": {
            "description": "Approved order lines and quantities, ascending by order line id; never empty. A requested line that is absent here was not approved in this revision.",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ReturnMoneyLineDto"
            }
          },
          "itemOutcomes": {
            "oneOf": [
              {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/CustomerReturnApprovalItemOutcomeDto"
                }
              },
              {
                "type": "object",
                "nullable": true,
                "enum": [
                  null
                ]
              }
            ],
            "description": "The complete version-2 or version-3 publication’s outcomes for every originally requested item, including refusals, in line-id order. `null` for legacy or unsupported versions; never an empty array or a reconstructed partial decision."
          },
          "itemOutcomesUnavailableReason": {
            "type": "string",
            "nullable": true,
            "description": "`null` when complete item outcomes are present. LEGACY_NOT_CAPTURED: a version-1 publication did not capture complete item outcomes. VERSION_UNSUPPORTED: this reader does not interpret that publication version. Open-ended catalog; other values also mean outcomes are unavailable.",
            "x-extensible-enum": [
              "LEGACY_NOT_CAPTURED",
              "VERSION_UNSUPPORTED"
            ]
          },
          "comparison": {
            "description": "This revision’s approved total compared with the immutable requested total in this revision’s historical currency. Retained independently for every history entry; a later revision never rewrites it.",
            "allOf": [
              {
                "$ref": "#/components/schemas/CustomerReturnMoneyComparisonDto"
              }
            ]
          },
          "components": {
            "description": "The published breakdown exactly as published; empty when the breakdown is UNAVAILABLE.",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CustomerReturnMoneyComponentDto"
            }
          },
          "requestComparison": {
            "type": "string",
            "enum": [
              "MATCHES_REQUEST",
              "DIFFERS_FROM_REQUEST",
              "REQUEST_NOT_CAPTURED",
              "REQUEST_UNAVAILABLE",
              "CURRENCY_NOT_COMPARABLE"
            ],
            "description": "How this revision compared with the requested evidence when published (amount and lines). Only MATCHES_REQUEST and DIFFERS_FROM_REQUEST are comparisons; the other values say why none exists."
          },
          "customerExplanation": {
            "type": "string",
            "nullable": true,
            "description": "Customer-safe explanation published with this revision. Always present on a replacement and on a first approval that differs from a known request; `null` when the publication needed none and included none."
          },
          "publishedAt": {
            "type": "string",
            "format": "date-time",
            "description": "When this revision was published."
          }
        },
        "required": [
          "revisionNumber",
          "approvedAmountInCents",
          "currency",
          "breakdownStatus",
          "lines",
          "itemOutcomes",
          "itemOutcomesUnavailableReason",
          "comparison",
          "components",
          "requestComparison",
          "customerExplanation",
          "publishedAt"
        ]
      },
      "CustomerReturnArrivedLineDto": {
        "type": "object",
        "properties": {
          "returnItemId": {
            "type": "string",
            "description": "Exact stable returned-item identity; not a new action capability."
          },
          "orderItemId": {
            "type": "string"
          },
          "quantity": {
            "type": "integer",
            "minimum": 1,
            "description": "Exact source-supported quantity, never a whole requested-row inference."
          },
          "condition": {
            "type": "string",
            "enum": [
              "RESELLABLE",
              "DAMAGED",
              "WRITE_OFF"
            ],
            "description": "Recorded actual arrival condition; independent of cash readiness."
          },
          "inventoryDisposition": {
            "type": "string",
            "enum": [
              "RESTOCKED",
              "NOT_ELIGIBLE",
              "NOT_APPLICABLE"
            ],
            "description": "Original inventory result. Receipt coverage does not itself prove sellable stock credit."
          }
        },
        "required": [
          "returnItemId",
          "orderItemId",
          "quantity",
          "condition",
          "inventoryDisposition"
        ]
      },
      "CustomerReturnFactsByReferenceDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Return id."
          },
          "orderNumber": {
            "type": "string",
            "example": "LC-100423"
          },
          "status": {
            "type": "string",
            "enum": [
              "REQUESTED",
              "APPROVED",
              "IN_TRANSIT",
              "RECEIVED",
              "COMPLETED",
              "REJECTED",
              "CANCELLED"
            ],
            "example": "REQUESTED"
          },
          "reason": {
            "type": "string",
            "nullable": true,
            "example": "Wrong size"
          },
          "requestedAt": {
            "type": "string",
            "example": "2026-06-05T14:36:18.000Z"
          },
          "updatedAt": {
            "type": "string",
            "example": "2026-06-05T14:36:18.000Z"
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CustomerReturnItemResponseDto"
            }
          },
          "createdByStoreStaff": {
            "type": "boolean",
            "example": false,
            "description": "`true` when the store's team started this return request for the customer from their admin; `false` when it was requested through a customer channel (the account, an emailed return link or the order-email form). Every return created before the store could start one is `false`."
          },
          "orderReference": {
            "type": "string",
            "nullable": false,
            "description": "The exact active reference used to address this return's parent Order.",
            "example": "or1_0123456789abcdef0123456789abcdef",
            "pattern": "^or1_[0-9a-f]{32}$"
          },
          "money": {
            "$ref": "#/components/schemas/CustomerReturnMoneyFactsDto"
          },
          "physical": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/CustomerReturnPhysicalFactsDto"
              },
              {
                "type": "object",
                "nullable": true,
                "enum": [
                  null
                ]
              }
            ],
            "description": "Safe version-3 physical facts, or null for legacy/unsupported/missing exact mapping or a publication withheld before lifecycle approval. Null never proves all-kept, zero arrival or zero settlement. Current instruction/document access remains on the authorized shipping reads."
          },
          "nonStripeCompletion": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/CustomerReturnNonStripeCompletionDto"
              },
              {
                "type": "object",
                "nullable": true,
                "enum": [
                  null
                ]
              }
            ],
            "description": "Safe deliberate genuine-zero completion receipt, or null when no supported receipt is available or publication is withheld. Null does not deny legacy/Stripe completion and is not proof of zero or positive manual/credit/exchange settlement. Actual issued/refund/correction facts remain in money.refund."
          }
        },
        "required": [
          "id",
          "orderNumber",
          "status",
          "reason",
          "requestedAt",
          "updatedAt",
          "items",
          "createdByStoreStaff",
          "orderReference",
          "money",
          "physical",
          "nonStripeCompletion"
        ]
      },
      "CustomerReturnFactsDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Return id."
          },
          "orderReference": {
            "type": "string",
            "nullable": true,
            "description": "Customer-safe stable reference for the parent order. Possession does not authorize return access. `null` only for a legacy Order awaiting the measured reference backfill.",
            "example": "or1_0123456789abcdef0123456789abcdef",
            "pattern": "^or1_[0-9a-f]{32}$"
          },
          "orderNumber": {
            "type": "string",
            "example": "LC-100423"
          },
          "status": {
            "type": "string",
            "enum": [
              "REQUESTED",
              "APPROVED",
              "IN_TRANSIT",
              "RECEIVED",
              "COMPLETED",
              "REJECTED",
              "CANCELLED"
            ],
            "example": "REQUESTED"
          },
          "reason": {
            "type": "string",
            "nullable": true,
            "example": "Wrong size"
          },
          "requestedAt": {
            "type": "string",
            "example": "2026-06-05T14:36:18.000Z"
          },
          "updatedAt": {
            "type": "string",
            "example": "2026-06-05T14:36:18.000Z"
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CustomerReturnItemResponseDto"
            }
          },
          "createdByStoreStaff": {
            "type": "boolean",
            "example": false,
            "description": "`true` when the store's team started this return request for the customer from their admin; `false` when it was requested through a customer channel (the account, an emailed return link or the order-email form). Every return created before the store could start one is `false`."
          },
          "money": {
            "$ref": "#/components/schemas/CustomerReturnMoneyFactsDto"
          },
          "physical": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/CustomerReturnPhysicalFactsDto"
              },
              {
                "type": "object",
                "nullable": true,
                "enum": [
                  null
                ]
              }
            ],
            "description": "Safe version-3 physical facts, or null for legacy/unsupported/missing exact mapping or a publication withheld before lifecycle approval. Null never proves all-kept, zero arrival or zero settlement. Current instruction/document access remains on the authorized shipping reads."
          },
          "nonStripeCompletion": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/CustomerReturnNonStripeCompletionDto"
              },
              {
                "type": "object",
                "nullable": true,
                "enum": [
                  null
                ]
              }
            ],
            "description": "Safe deliberate genuine-zero completion receipt, or null when no supported receipt is available or publication is withheld. Null does not deny legacy/Stripe completion and is not proof of zero or positive manual/credit/exchange settlement. Actual issued/refund/correction facts remain in money.refund."
          }
        },
        "required": [
          "id",
          "orderReference",
          "orderNumber",
          "status",
          "reason",
          "requestedAt",
          "updatedAt",
          "items",
          "createdByStoreStaff",
          "money",
          "physical",
          "nonStripeCompletion"
        ]
      },
      "CustomerReturnFactsListByReferenceResponseDto": {
        "type": "object",
        "properties": {
          "data": {
            "description": "Every return on the order, newest first; empty when it has none.",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CustomerReturnFactsByReferenceDto"
            }
          }
        },
        "required": [
          "data"
        ]
      },
      "CustomerReturnFactsListResponseDto": {
        "type": "object",
        "properties": {
          "data": {
            "description": "Every return on the order, newest first; empty when it has none.",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CustomerReturnFactsDto"
            }
          }
        },
        "required": [
          "data"
        ]
      },
      "CustomerReturnItemComparisonDto": {
        "type": "object",
        "properties": {
          "availability": {
            "type": "string",
            "enum": [
              "AVAILABLE",
              "UNAVAILABLE"
            ],
            "description": "AVAILABLE only for an approved item with an immutable requested contribution in this approval revision’s currency."
          },
          "unavailableReason": {
            "type": "string",
            "nullable": true,
            "description": "`null` when AVAILABLE. ITEM_NOT_APPROVED: a refusal has no approved amount to compare. REQUEST_UNAVAILABLE: no requested amount was captured. CURRENCY_NOT_COMPARABLE: the request and this revision use different currencies. ITEM_COMPARISON_UNAVAILABLE: exact item attribution is absent. VERSION_UNSUPPORTED: the requested item evidence version is unsupported. Open-ended catalog; other values also mean no comparison.",
            "x-extensible-enum": [
              "ITEM_NOT_APPROVED",
              "REQUEST_UNAVAILABLE",
              "CURRENCY_NOT_COMPARABLE",
              "ITEM_COMPARISON_UNAVAILABLE",
              "VERSION_UNSUPPORTED"
            ]
          },
          "requestedQuantity": {
            "type": "integer",
            "minimum": 1,
            "nullable": true,
            "description": "Original requested quantity, retained even when money cannot be compared; `null` when no matching immutable requested line was captured."
          },
          "requestedAmountInCents": {
            "type": "integer",
            "minimum": 0,
            "nullable": true,
            "description": "Requested contribution for the entire original requested quantity; never prorated to approved units. `null` exactly when UNAVAILABLE."
          },
          "differenceInCents": {
            "type": "integer",
            "nullable": true,
            "description": "Approved item amount minus the original requested item contribution; 0 is an evidenced equality. `null` exactly when UNAVAILABLE."
          },
          "currency": {
            "type": "string",
            "nullable": true,
            "description": "Shared historical currency of this revision and the immutable request; `null` exactly when UNAVAILABLE. No conversion or current-currency substitution."
          },
          "relation": {
            "oneOf": [
              {
                "type": "string",
                "enum": [
                  "BELOW",
                  "EQUAL",
                  "ABOVE"
                ]
              },
              {
                "type": "object",
                "nullable": true,
                "enum": [
                  null
                ]
              }
            ],
            "description": "Approved amount relative to the original requested contribution; `null` exactly when UNAVAILABLE."
          }
        },
        "required": [
          "availability",
          "unavailableReason",
          "requestedQuantity",
          "requestedAmountInCents",
          "differenceInCents",
          "currency",
          "relation"
        ]
      },
      "CustomerReturnItemResponseDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Return-item id."
          },
          "orderItemId": {
            "type": "string",
            "description": "Order-item handle this return line came from."
          },
          "name": {
            "type": "string",
            "example": "Trail Tent 2P"
          },
          "quantity": {
            "type": "number",
            "example": 1
          },
          "condition": {
            "type": "string",
            "enum": [
              "PENDING",
              "RESELLABLE",
              "DAMAGED",
              "WRITE_OFF"
            ],
            "example": "PENDING"
          }
        },
        "required": [
          "id",
          "orderItemId",
          "name",
          "quantity",
          "condition"
        ]
      },
      "CustomerReturnKeepPromiseDto": {
        "type": "object",
        "properties": {
          "orderItemId": {
            "type": "string"
          },
          "quantity": {
            "type": "integer",
            "minimum": 1,
            "description": "Immutable quantity granted at this revision. Later grants are separate lineage entries; never sum cumulative grants as additional units."
          },
          "approvalRevisionNumber": {
            "type": "integer",
            "minimum": 1,
            "description": "Revision that first granted or extended this exact keep quantity; later refusal/reduction/cancellation does not erase it."
          }
        },
        "required": [
          "orderItemId",
          "quantity",
          "approvalRevisionNumber"
        ]
      },
      "CustomerReturnMoneyComparisonDto": {
        "type": "object",
        "properties": {
          "availability": {
            "type": "string",
            "enum": [
              "AVAILABLE",
              "UNAVAILABLE"
            ],
            "description": "AVAILABLE only when both the requested amount and the selected approval revision are AVAILABLE in the same currency."
          },
          "unavailableReason": {
            "type": "string",
            "nullable": true,
            "description": "`null` when AVAILABLE. APPROVAL_UNAVAILABLE and REQUEST_UNAVAILABLE name the missing side (approval is checked first); CURRENCY_NOT_COMPARABLE means the two are in different currencies, which are never converted. Open-ended catalog: see x-extensible-enum; treat any other value as no comparison.",
            "x-extensible-enum": [
              "APPROVAL_UNAVAILABLE",
              "REQUEST_UNAVAILABLE",
              "CURRENCY_NOT_COMPARABLE"
            ]
          },
          "differenceInCents": {
            "type": "integer",
            "nullable": true,
            "description": "Approved minus requested, in minor units: negative when less was approved, 0 when equal. `null` exactly when UNAVAILABLE."
          },
          "currency": {
            "type": "string",
            "nullable": true,
            "example": "usd",
            "description": "Currency of `differenceInCents`; `null` exactly when UNAVAILABLE."
          }
        },
        "required": [
          "availability",
          "unavailableReason",
          "differenceInCents",
          "currency"
        ]
      },
      "CustomerReturnMoneyComponentDto": {
        "type": "object",
        "properties": {
          "kind": {
            "type": "string",
            "enum": [
              "ITEM",
              "DISCOUNT",
              "TAX",
              "WITHHOLDING",
              "SHIPPING"
            ]
          },
          "effect": {
            "type": "string",
            "enum": [
              "ADD",
              "SUBTRACT",
              "INCLUDED"
            ],
            "description": "How this component contributes to the total. ITEM and SHIPPING ADD; DISCOUNT and WITHHOLDING SUBTRACT; TAX either ADDs or is INCLUDED (disclosed inside item amounts and never added twice)."
          },
          "amountInCents": {
            "type": "integer",
            "minimum": 0,
            "maximum": 1000000000,
            "description": "Non-negative magnitude in minor units; `effect` gives the sign."
          },
          "orderItemId": {
            "type": "string",
            "nullable": true,
            "description": "Order line this component belongs to; `null` for a return-level component."
          }
        },
        "required": [
          "kind",
          "effect",
          "amountInCents",
          "orderItemId"
        ]
      },
      "CustomerReturnMoneyFactsDto": {
        "type": "object",
        "properties": {
          "requested": {
            "$ref": "#/components/schemas/CustomerReturnRequestedMoneyDto"
          },
          "approval": {
            "$ref": "#/components/schemas/CustomerReturnApprovalMoneyDto"
          },
          "comparison": {
            "$ref": "#/components/schemas/CustomerReturnMoneyComparisonDto"
          },
          "refund": {
            "$ref": "#/components/schemas/CustomerReturnRefundMoneyDto"
          }
        },
        "required": [
          "requested",
          "approval",
          "comparison",
          "refund"
        ]
      },
      "CustomerReturnNonStripeCompletionDto": {
        "type": "object",
        "properties": {
          "version": {
            "type": "number",
            "enum": [
              1
            ],
            "description": "Completion receipt version 1, distinct from lifecycle/publication version 3."
          },
          "returnId": {
            "type": "string"
          },
          "outcome": {
            "type": "string",
            "enum": [
              "ZERO_CASH"
            ],
            "description": "Authoritative genuine-zero outcome of the separate deliberate completion command. Does not attribute any owner-level manual ledger movement or claim a cash refund, credit/exchange settlement or provider action."
          },
          "amountInCents": {
            "type": "integer",
            "enum": [
              0
            ],
            "description": "Exact admitted current completion amount; approved/requested and issued history remain in money unchanged."
          },
          "currency": {
            "type": "string",
            "description": "Historical currency of the admitted zero completion."
          },
          "approvalRevisionNumber": {
            "type": "integer",
            "minimum": 1
          },
          "completedAt": {
            "type": "string",
            "format": "date-time",
            "description": "Original atomic completion time; subsequent real arrival preserves it."
          }
        },
        "required": [
          "version",
          "returnId",
          "outcome",
          "amountInCents",
          "currency",
          "approvalRevisionNumber",
          "completedAt"
        ]
      },
      "CustomerReturnPhysicalFactsDto": {
        "type": "object",
        "properties": {
          "version": {
            "type": "number",
            "enum": [
              1
            ],
            "description": "Safe factual projection version; lifecycle/publication version 3 is a separate boundary."
          },
          "approvalRevisionNumber": {
            "type": "integer",
            "minimum": 1
          },
          "requiredLines": {
            "description": "Exact required-back subset of the current publication. Empty means no current required-back goods, not no prior arrival. Terminal status keeps shipping closed; this list grants no shipping/document access.",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CustomerReturnPhysicalLineDto"
            }
          },
          "keepPromises": {
            "description": "Immutable published keep lineage, including earlier grants retained after reduction/refusal/cancellation. Empty means no recorded v3 grant, never an inferred legacy waiver. Does not assert the goods remain with the customer.",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CustomerReturnKeepPromiseDto"
            }
          },
          "receiptCoverage": {
            "type": "string",
            "x-extensible-enum": [
              "EXACT",
              "UNAVAILABLE",
              "NOT_CAPTURED"
            ],
            "description": "Ordinary required-goods receipt coverage only. EXACT is immutable exact coverage; UNAVAILABLE means legacy receipt detail is unknown; NOT_CAPTURED means no ordinary receipt captured. Protected arrival is separate. Unknown values mean unavailable."
          },
          "arrivedLines": {
            "description": "Disjoint ordinary/protected actual arrivals. Empty means no exact captured allocations; with UNAVAILABLE coverage it does not establish zero arrival. Never inferred from approval, status or stock markers.",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CustomerReturnArrivedLineDto"
            }
          },
          "refundReadiness": {
            "type": "string",
            "x-extensible-enum": [
              "QUALIFIED",
              "WAITING_FOR_REQUIRED_GOODS",
              "UNAVAILABLE",
              "TERMINAL"
            ],
            "description": "Necessary physical/publication/money qualification only; not a promise to refund or a command capability. Financial source ownership, capacity, frozen operations and current authorization still apply. TERMINAL preserves Completed/Cancelled/Rejected and closed shipping. Unknown values mean unavailable."
          },
          "ordinaryReceipt": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/CustomerReturnPhysicalReceiptDto"
              },
              {
                "type": "object",
                "nullable": true,
                "enum": [
                  null
                ]
              }
            ],
            "description": "Original ordinary receipt result, or null when no supported committed ordinary receipt exists. Null never substitutes for unknown legacy quantities or denies a protected arrival."
          },
          "protectedArrival": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/CustomerReturnProtectedArrivalDto"
              },
              {
                "type": "object",
                "nullable": true,
                "enum": [
                  null
                ]
              }
            ],
            "description": "Original protected actual arrival/result, including after Completed or Cancelled, or null when none was captured. Null does not prove waived goods remain with the customer. Arrival changes no money, status or shipping rights."
          }
        },
        "required": [
          "version",
          "approvalRevisionNumber",
          "requiredLines",
          "keepPromises",
          "receiptCoverage",
          "arrivedLines",
          "refundReadiness",
          "ordinaryReceipt",
          "protectedArrival"
        ]
      },
      "CustomerReturnPhysicalLineDto": {
        "type": "object",
        "properties": {
          "returnItemId": {
            "type": "string",
            "description": "Exact stable returned-item identity; not a new action capability."
          },
          "orderItemId": {
            "type": "string"
          },
          "quantity": {
            "type": "integer",
            "minimum": 1,
            "description": "Exact source-supported quantity, never a whole requested-row inference."
          }
        },
        "required": [
          "returnItemId",
          "orderItemId",
          "quantity"
        ]
      },
      "CustomerReturnPhysicalReceiptDto": {
        "type": "object",
        "properties": {
          "version": {
            "type": "number",
            "enum": [
              1
            ],
            "description": "Physical result version, distinct from lifecycle/publication version 3."
          },
          "returnId": {
            "type": "string"
          },
          "approvalRevisionNumber": {
            "type": "integer",
            "minimum": 1
          },
          "committedAt": {
            "type": "string",
            "format": "date-time",
            "description": "Original immutable operation commit time; not inferred from status."
          },
          "allocations": {
            "minItems": 1,
            "description": "Exact actual captured allocations with original condition/stock results. No extra receipt is manufactured by later completion or cancellation.",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CustomerReturnArrivedLineDto"
            }
          }
        },
        "required": [
          "version",
          "returnId",
          "approvalRevisionNumber",
          "committedAt",
          "allocations"
        ]
      },
      "CustomerReturnProtectedArrivalDto": {
        "type": "object",
        "properties": {
          "version": {
            "type": "number",
            "enum": [
              1
            ],
            "description": "Physical result version, distinct from lifecycle/publication version 3."
          },
          "returnId": {
            "type": "string"
          },
          "approvalRevisionNumber": {
            "type": "integer",
            "minimum": 1
          },
          "committedAt": {
            "type": "string",
            "format": "date-time",
            "description": "Original immutable operation commit time; not inferred from status."
          },
          "allocations": {
            "minItems": 1,
            "description": "Exact actual captured allocations with original condition/stock results. No extra receipt is manufactured by later completion or cancellation.",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CustomerReturnArrivedLineDto"
            }
          },
          "arrivedAt": {
            "type": "string",
            "format": "date-time",
            "description": "Actual protected parcel arrival time as recorded, separate from financial completion and operation commit time."
          }
        },
        "required": [
          "version",
          "returnId",
          "approvalRevisionNumber",
          "committedAt",
          "allocations",
          "arrivedAt"
        ]
      },
      "CustomerReturnRefundCorrectionDto": {
        "type": "object",
        "properties": {
          "state": {
            "type": "string",
            "description": "Current state of the correction. REIMBURSEMENT_PENDING: the issued refund was returned by the bank or card network and the merchant still owes `amountOwedInCents`. RECONCILIATION_REQUIRED: the merchant is confirming the outcome with the payment provider. REIMBURSEMENT_RECORDED: the merchant recorded paying the full amount another way. RESOLVED: the correction is closed. Open-ended catalog: see x-extensible-enum; treat any other value as a correction whose outcome is still open.",
            "x-extensible-enum": [
              "REIMBURSEMENT_PENDING",
              "RECONCILIATION_REQUIRED",
              "REIMBURSEMENT_RECORDED",
              "RESOLVED"
            ]
          },
          "reversedAmountInCents": {
            "type": "integer",
            "minimum": 0,
            "nullable": true,
            "description": "Amount of the issued refund that was returned; `null` only when the recorded currency is unusable (amounts are never published without one)."
          },
          "reimbursedInCents": {
            "type": "integer",
            "minimum": 0,
            "nullable": true,
            "description": "Total the merchant has recorded paying back another way; 0 when none yet. `null` under the same currency condition as `reversedAmountInCents`."
          },
          "amountOwedInCents": {
            "type": "integer",
            "minimum": 0,
            "nullable": true,
            "description": "Still owed: reversed minus reimbursed. 0 only when recorded reimbursements cover the reversal. `null` under the same currency condition as `reversedAmountInCents`."
          },
          "currency": {
            "type": "string",
            "nullable": true,
            "example": "usd",
            "description": "Lowercase ISO 4217 code of the correction amounts, from the recorded reversal; `null` only when that record’s currency is unusable."
          }
        },
        "required": [
          "state",
          "reversedAmountInCents",
          "reimbursedInCents",
          "amountOwedInCents",
          "currency"
        ]
      },
      "CustomerReturnRefundItemDto": {
        "type": "object",
        "properties": {
          "returnItemId": {
            "type": "string",
            "description": "The return item, as in the return’s `items[].id`."
          },
          "orderItemId": {
            "type": "string",
            "description": "The order item the return item refers to."
          },
          "amountInCents": {
            "type": "integer",
            "minimum": 0,
            "description": "This item’s share of the refund, in the refund’s `currency`. One amount: it does not separate price, discount or tax. Zero when the item received no share."
          }
        },
        "required": [
          "returnItemId",
          "orderItemId",
          "amountInCents"
        ]
      },
      "CustomerReturnRefundMoneyDto": {
        "type": "object",
        "properties": {
          "state": {
            "type": "string",
            "description": "Money for this return, from its own refund records only. NONE: no refund has started (a private draft amount is not a refund). PROCESSING: a refund is underway and not yet issued. NOT_ISSUED: the latest refund attempt did not go through and no money moved. RECONCILIATION_REQUIRED: the outcome is being confirmed with the payment provider. ISSUED: the payment provider confirmed the refund (see `correction` for anything that happened afterwards). COMPLETED_WITHOUT_PROVIDER_REFUND: the return was completed without a payment-provider refund — this does not prove that nothing is owed, nor that money was returned another way. UNAVAILABLE: the refund records cannot be presented (see `unavailableReason`). Refunds made from the order itself, outside this return, are not included. Open-ended catalog: see x-extensible-enum; treat any other value as UNAVAILABLE.",
            "x-extensible-enum": [
              "NONE",
              "PROCESSING",
              "NOT_ISSUED",
              "RECONCILIATION_REQUIRED",
              "ISSUED",
              "COMPLETED_WITHOUT_PROVIDER_REFUND",
              "UNAVAILABLE"
            ]
          },
          "unavailableReason": {
            "type": "string",
            "nullable": true,
            "description": "Set only when `state` is UNAVAILABLE; `null` for every other state. LEGACY_UNVERIFIED: the return was completed before refunds were tracked per return, so no exact refund record exists. EVIDENCE_INCONSISTENT: the refund records disagree and are under review. Neither means no refund happened. Open-ended catalog: see x-extensible-enum.",
            "x-extensible-enum": [
              "LEGACY_UNVERIFIED",
              "EVIDENCE_INCONSISTENT"
            ]
          },
          "amountInCents": {
            "type": "integer",
            "minimum": 0,
            "nullable": true,
            "description": "Amount of the refund for PROCESSING (in progress, not yet issued), NOT_ISSUED (attempted; no money moved), RECONCILIATION_REQUIRED (being confirmed) and ISSUED (issued). `null` for every other state, and when the recorded currency is unusable: an amount is never published without its currency."
          },
          "currency": {
            "type": "string",
            "nullable": true,
            "example": "usd",
            "description": "Lowercase ISO 4217 code of `amountInCents`, from the refund record itself; `null` exactly when `amountInCents` is."
          },
          "issuedAt": {
            "type": "string",
            "format": "date-time",
            "nullable": true,
            "description": "When the refund was confirmed issued; `null` unless `state` is ISSUED."
          },
          "breakdownStatus": {
            "type": "string",
            "enum": [
              "COMPLETE",
              "INCOMPLETE",
              "UNAVAILABLE"
            ],
            "description": "Currently always UNAVAILABLE: a refund records no price, discount or tax components, so none is derived (the per-item split it does record is `itemAmounts`). A later version may publish source-validated components under COMPLETE or INCOMPLETE with the same meanings as `requested`."
          },
          "components": {
            "description": "Always empty while `breakdownStatus` is UNAVAILABLE.",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CustomerReturnMoneyComponentDto"
            }
          },
          "itemAmounts": {
            "description": "How `amountInCents` is split across the returned items, as frozen when the refund started; the shares add up exactly to `amountInCents`. Ordered by `returnItemId`. Empty whenever `amountInCents` is `null`, and when no exact split is recorded: a split is never estimated or divided from the total. A later `correction` does not change it.",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CustomerReturnRefundItemDto"
            }
          },
          "correction": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/CustomerReturnRefundCorrectionDto"
              },
              {
                "type": "object",
                "nullable": true,
                "enum": [
                  null
                ]
              }
            ],
            "description": "A later correction of an ISSUED refund, kept separate so the original issue stays on record; `null` when there is none (always `null` unless `state` is ISSUED). When present, it is the current explanation of what is owed."
          }
        },
        "required": [
          "state",
          "unavailableReason",
          "amountInCents",
          "currency",
          "issuedAt",
          "breakdownStatus",
          "components",
          "itemAmounts",
          "correction"
        ]
      },
      "CustomerReturnRequestedItemComparatorDto": {
        "type": "object",
        "properties": {
          "orderItemId": {
            "type": "string",
            "description": "Original requested order line."
          },
          "quantity": {
            "type": "integer",
            "minimum": 1,
            "description": "Original requested quantity; the amount covers exactly this quantity."
          },
          "availability": {
            "type": "string",
            "enum": [
              "AVAILABLE",
              "UNAVAILABLE"
            ],
            "description": "AVAILABLE only when immutable submission evidence proves this item’s requested contribution, including a genuine zero. Independent of whether an approval exists. No current price, allocation or proration is used."
          },
          "amountInCents": {
            "type": "integer",
            "minimum": 0,
            "nullable": true,
            "description": "Requested contribution for this exact quantity, in minor units of `requested.currency`; `null` exactly when UNAVAILABLE."
          },
          "unavailableReason": {
            "type": "string",
            "nullable": true,
            "description": "`null` when AVAILABLE. REQUEST_UNAVAILABLE: submission has no known amount. ITEM_COMPARISON_UNAVAILABLE: it does not prove this exact item contribution. VERSION_UNSUPPORTED: this reader cannot interpret the stored item evidence version. Open-ended catalog; other values also mean no item amount is available.",
            "x-extensible-enum": [
              "REQUEST_UNAVAILABLE",
              "ITEM_COMPARISON_UNAVAILABLE",
              "VERSION_UNSUPPORTED"
            ]
          }
        },
        "required": [
          "orderItemId",
          "quantity",
          "availability",
          "amountInCents",
          "unavailableReason"
        ]
      },
      "CustomerReturnRequestedMoneyDto": {
        "type": "object",
        "properties": {
          "availability": {
            "type": "string",
            "enum": [
              "AVAILABLE",
              "UNAVAILABLE"
            ],
            "description": "AVAILABLE when the customer’s deliberate submission captured a requested amount (including a genuine 0). UNAVAILABLE carries no amount and is never a zero."
          },
          "unavailableReason": {
            "type": "string",
            "nullable": true,
            "description": "`null` when AVAILABLE. NOT_CAPTURED means no requested evidence exists for this return — every return submitted before capture shipped reads this way, and nothing is backfilled from prices, drafts or settings. The other reasons were recorded at submission. Open-ended catalog: see x-extensible-enum; any other value is still an unavailable request.",
            "x-extensible-enum": [
              "NOT_CAPTURED",
              "UNSUPPORTED_SELECTION",
              "MISSING_HISTORY",
              "MISSING_CURRENCY"
            ]
          },
          "amountInCents": {
            "type": "integer",
            "minimum": 0,
            "nullable": true,
            "description": "Requested amount in minor units; `null` exactly when UNAVAILABLE."
          },
          "currency": {
            "type": "string",
            "nullable": true,
            "example": "usd",
            "description": "Lowercase ISO 4217 code of `amountInCents`, recorded at submission; `null` exactly when UNAVAILABLE. Never a substituted default."
          },
          "breakdownStatus": {
            "type": "string",
            "enum": [
              "COMPLETE",
              "INCOMPLETE",
              "UNAVAILABLE"
            ],
            "description": "COMPLETE components reconcile exactly to the amount; INCOMPLETE is a known amount with only some components (the missing part is not derivable); UNAVAILABLE has none."
          },
          "lines": {
            "description": "Requested order lines and quantities as captured, ascending by order line id. Empty only when NOT_CAPTURED; `items` still lists the return’s lines.",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ReturnMoneyLineDto"
            }
          },
          "itemComparators": {
            "description": "One comparator for each immutable requested line, in line-id order. Empty when no requested evidence was captured; missing item money is otherwise explicit on each row. Never rebuilt from current prices or an approval.",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CustomerReturnRequestedItemComparatorDto"
            }
          },
          "components": {
            "description": "Components exactly as the estimate source supplied them; empty when the breakdown is UNAVAILABLE. Nothing is derived, prorated or divided.",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CustomerReturnMoneyComponentDto"
            }
          },
          "capturedAt": {
            "type": "string",
            "format": "date-time",
            "nullable": true,
            "description": "When the submission was captured; `null` when NOT_CAPTURED."
          }
        },
        "required": [
          "availability",
          "unavailableReason",
          "amountInCents",
          "currency",
          "breakdownStatus",
          "lines",
          "itemComparators",
          "components",
          "capturedAt"
        ]
      },
      "OrderReferenceReturnFactsDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Return id."
          },
          "status": {
            "type": "string",
            "enum": [
              "REQUESTED",
              "APPROVED",
              "IN_TRANSIT",
              "RECEIVED",
              "COMPLETED",
              "REJECTED",
              "CANCELLED"
            ],
            "example": "REQUESTED"
          },
          "reason": {
            "type": "string",
            "nullable": true,
            "example": "Wrong size"
          },
          "requestedAt": {
            "type": "string",
            "example": "2026-06-05T14:36:18.000Z"
          },
          "updatedAt": {
            "type": "string",
            "example": "2026-06-05T14:36:18.000Z"
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PublicReturnItemResponseDto"
            }
          },
          "createdByStoreStaff": {
            "type": "boolean",
            "example": false,
            "description": "`true` when the store's team started this return request for the customer from their admin; `false` when it was requested through a customer channel (the account, an emailed return link or the order-email form). Every return created before the store could start one is `false`."
          },
          "orderReference": {
            "type": "string",
            "nullable": false,
            "description": "The exact active reference used to address this return's parent Order.",
            "example": "or1_0123456789abcdef0123456789abcdef",
            "pattern": "^or1_[0-9a-f]{32}$"
          },
          "money": {
            "$ref": "#/components/schemas/CustomerReturnMoneyFactsDto"
          },
          "physical": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/CustomerReturnPhysicalFactsDto"
              },
              {
                "type": "object",
                "nullable": true,
                "enum": [
                  null
                ]
              }
            ],
            "description": "Safe version-3 physical facts, or null for legacy/unsupported/missing exact mapping or a publication withheld before lifecycle approval. Null never proves all-kept, zero arrival or zero settlement. Current instruction/document access remains on the authorized shipping reads."
          },
          "nonStripeCompletion": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/CustomerReturnNonStripeCompletionDto"
              },
              {
                "type": "object",
                "nullable": true,
                "enum": [
                  null
                ]
              }
            ],
            "description": "Safe deliberate genuine-zero completion receipt, or null when no supported receipt is available or publication is withheld. Null does not deny legacy/Stripe completion and is not proof of zero or positive manual/credit/exchange settlement. Actual issued/refund/correction facts remain in money.refund."
          }
        },
        "required": [
          "id",
          "status",
          "reason",
          "requestedAt",
          "updatedAt",
          "items",
          "createdByStoreStaff",
          "orderReference",
          "money",
          "physical",
          "nonStripeCompletion"
        ]
      },
      "PublicReturnFactsDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Return id."
          },
          "orderId": {
            "type": "string",
            "description": "Legacy raw Order id retained only for measured compatibility.",
            "deprecated": true
          },
          "orderReference": {
            "type": "string",
            "nullable": true,
            "description": "Customer-safe stable reference for the parent order. Possession does not authorize return access. `null` only for a legacy Order awaiting the measured reference backfill.",
            "example": "or1_0123456789abcdef0123456789abcdef",
            "pattern": "^or1_[0-9a-f]{32}$"
          },
          "status": {
            "type": "string",
            "enum": [
              "REQUESTED",
              "APPROVED",
              "IN_TRANSIT",
              "RECEIVED",
              "COMPLETED",
              "REJECTED",
              "CANCELLED"
            ],
            "example": "REQUESTED"
          },
          "reason": {
            "type": "string",
            "nullable": true,
            "example": "Wrong size"
          },
          "requestedAt": {
            "type": "string",
            "example": "2026-06-05T14:36:18.000Z"
          },
          "updatedAt": {
            "type": "string",
            "example": "2026-06-05T14:36:18.000Z"
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PublicReturnItemResponseDto"
            }
          },
          "createdByStoreStaff": {
            "type": "boolean",
            "example": false,
            "description": "`true` when the store's team started this return request for the customer from their admin; `false` when it was requested through a customer channel (the account, an emailed return link or the order-email form). Every return created before the store could start one is `false`."
          },
          "money": {
            "$ref": "#/components/schemas/CustomerReturnMoneyFactsDto"
          },
          "physical": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/CustomerReturnPhysicalFactsDto"
              },
              {
                "type": "object",
                "nullable": true,
                "enum": [
                  null
                ]
              }
            ],
            "description": "Safe version-3 physical facts, or null for legacy/unsupported/missing exact mapping or a publication withheld before lifecycle approval. Null never proves all-kept, zero arrival or zero settlement. Current instruction/document access remains on the authorized shipping reads."
          },
          "nonStripeCompletion": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/CustomerReturnNonStripeCompletionDto"
              },
              {
                "type": "object",
                "nullable": true,
                "enum": [
                  null
                ]
              }
            ],
            "description": "Safe deliberate genuine-zero completion receipt, or null when no supported receipt is available or publication is withheld. Null does not deny legacy/Stripe completion and is not proof of zero or positive manual/credit/exchange settlement. Actual issued/refund/correction facts remain in money.refund."
          }
        },
        "required": [
          "id",
          "orderId",
          "orderReference",
          "status",
          "reason",
          "requestedAt",
          "updatedAt",
          "items",
          "createdByStoreStaff",
          "money",
          "physical",
          "nonStripeCompletion"
        ]
      },
      "PublicReturnItemResponseDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Return line id."
          },
          "orderItemId": {
            "type": "string",
            "description": "Order line this return line claims."
          },
          "quantity": {
            "type": "number",
            "example": 1
          },
          "condition": {
            "type": "string",
            "enum": [
              "PENDING",
              "RESELLABLE",
              "DAMAGED",
              "WRITE_OFF"
            ],
            "example": "PENDING"
          }
        },
        "required": [
          "id",
          "orderItemId",
          "quantity",
          "condition"
        ]
      },
      "ReturnMoneyLineDto": {
        "type": "object",
        "properties": {
          "orderItemId": {
            "type": "string",
            "description": "Order line id."
          },
          "quantity": {
            "type": "integer",
            "minimum": 1
          }
        },
        "required": [
          "orderItemId",
          "quantity"
        ]
      },
      "ReturnRequestedReviewBreakdownDto": {
        "type": "object",
        "properties": {
          "itemTotalInCents": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "discountInCents": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "taxInCents": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "capacityReductionInCents": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          }
        },
        "required": [
          "itemTotalInCents",
          "discountInCents",
          "taxInCents",
          "capacityReductionInCents"
        ],
        "additionalProperties": false
      },
      "ReturnRequestedReviewDto": {
        "type": "object",
        "properties": {
          "items": {
            "minItems": 1,
            "maxItems": 50,
            "description": "Exact reviewed selection. Duplicate identities are normalized before comparison with the submission.",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ReturnRequestedReviewLineDto"
            }
          },
          "state": {
            "type": "string",
            "enum": [
              "AVAILABLE",
              "UNAVAILABLE"
            ],
            "description": "Estimate state the customer deliberately reviewed for this exact submission selection. AVAILABLE requires amount, historical currency and breakdown (null only for a proven zero without itemized basis). UNAVAILABLE carries no monetary values. This acknowledges a view and supplies no calculation authority."
          },
          "amountInCents": {
            "type": "integer",
            "nullable": true,
            "minimum": 0,
            "maximum": 9007199254740991,
            "description": "Reviewed estimate total in minor units; required for AVAILABLE, absent/null for UNAVAILABLE."
          },
          "currency": {
            "type": "string",
            "nullable": true,
            "pattern": "^[a-zA-Z]{3}$",
            "description": "Reviewed historical ISO currency, required for AVAILABLE; absent/null for UNAVAILABLE. Never current store currency."
          },
          "breakdown": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/ReturnRequestedReviewBreakdownDto"
              },
              {
                "type": "object",
                "nullable": true,
                "enum": [
                  null
                ]
              }
            ],
            "description": "Reviewed estimate components, including any capacity reduction; null for a supported unitemized zero, absent/null for UNAVAILABLE."
          }
        },
        "required": [
          "items",
          "state"
        ],
        "additionalProperties": false
      },
      "ReturnRequestedReviewLineDto": {
        "type": "object",
        "properties": {
          "orderItemId": {
            "type": "string",
            "description": "The exact reviewed order-item handle.",
            "minLength": 1,
            "maxLength": 64
          },
          "quantity": {
            "type": "integer",
            "minimum": 1,
            "maximum": 1000000,
            "description": "Reviewed quantity within the existing Return request range. A normalized selection outside the requested-evidence storage envelope remains NOT_CAPTURED; it is never clamped or partially captured."
          }
        },
        "required": [
          "orderItemId",
          "quantity"
        ],
        "additionalProperties": false
      }
    },
    "securitySchemes": {
      "CustomerSession": {
        "scheme": "bearer",
        "bearerFormat": "opaque",
        "type": "http",
        "description": "Customer session — opaque session token (not a JWT); the __Host- session cookie is the browser-side alternative."
      },
      "OrganizationSlug": {
        "type": "apiKey",
        "in": "header",
        "name": "x-organization-slug"
      }
    }
  },
  "tags": [
    {
      "name": "customer-account",
      "description": ""
    },
    {
      "name": "customer-actions",
      "description": ""
    }
  ],
  "x-provider-source": {
    "repository": "idahoprodigital/cartonium",
    "repositoryId": 1185695641,
    "protectedBranch": "staging",
    "commit": "d3e8606dd5e1d775c65ca7162cfdada8a4119dea",
    "contractPath": "apps/docs/src/app/api-reference/openapi.json",
    "contractUrl": "https://github.com/idahoprodigital/cartonium/blob/d3e8606dd5e1d775c65ca7162cfdada8a4119dea/apps/docs/src/app/api-reference/openapi.json",
    "contractGitBlob": "1fae50ef42cc4306730e47f83039dbd5761c2e7b",
    "fullCanonicalSchemaIdentity": "sha256:bc74c459bddd6abb7a0e008bfcc798f772dc777a78b6f035fa422f2426a62ae8",
    "rawBytes": 6082884,
    "rawSha256": "30512e230bf122116adbf482870d053b92d1603e007925e581c72737508498f1",
    "preparedAtUtc": "2026-11-24T20:01:18Z"
  }
}
