# Returns portal

The Returns portal and the values it reads.

At /returns: finding an order, asking to return or exchange delivered items, and following the returns already on it. Surface `returns`.

## States

The step the page is on is `page.State`. The editor previews each state with sample data.

| State | The page |
| --- | --- |
| `lookup` | Find an order by its number and email or phone. |
| `code` | Enter the one-time code sent to the email or phone. |
| `orders` | A signed-in customer's orders. |
| `order` | The order: returns so far and the return request form. |

## What the code must keep

The lookup, code, orders and return request controls, `<section class="returns-controls" data-returns-controls>`. Keep it exactly as the default has it.

Keep `{{ page.BrandingStyles }}`, `{{ page.PreviewNotice }}` and `{{ page.Heading }}`, and the document's `</head>` and `</body>`. See [the rules for all store pages](/ctx/store-pages).

## Values

Every value the page's code can read. `[]` marks a list item: read it inside `{% for item in list %}` as `item.Name`. A value that is empty in a particular case prints nothing; test it with `{% if %}` first.

| Value | Type | Description |
| --- | --- | --- |
| `page.AnotherLabel` | Text | The label of the link to find another order. |
| `page.AnotherURL` | URL | Opens the order lookup again, to find another order. |
| `page.BrandingStyles` | HTML | A `<style>` element with the page appearance: colours, font and corners as `--co-*` CSS variables. Required. |
| `page.BrandName` | Text | The brand name from the checkout appearance, or the store name when none is set. |
| `page.Code` | Object | The one-time code form (`code` state). Platform-owned. |
| `page.Code.Action` | URL | Where the form posts. |
| `page.Code.CodeLabel` | Text | Label of the code field. |
| `page.Code.Contact` | Text | The email or phone number the code was sent to. |
| `page.Code.CSRF` | Text | The form's security token. |
| `page.Code.OrderNumber` | Text | The order number being verified. |
| `page.Code.Submit` | Text | Label of the button. |
| `page.Dir` | Text | `ltr` or `rtl`, the writing direction of the language. Set it as the document's `dir`. |
| `page.Error` | Text | What went wrong with the last step, in the shopper's language. Empty otherwise. |
| `page.Heading` | Text | The page heading. Required. |
| `page.Intro` | Text | The text under the heading. Empty when the current step has none. |
| `page.Locale` | Text | The shopper's language as a locale code, such as `en` or `de-CH`. Set it as the document's `lang`. |
| `page.LogoURL` | URL | The checkout appearance logo. Empty when the store has no logo. |
| `page.Lookup` | Object | The order lookup form (`lookup` state). Platform-owned. |
| `page.Lookup.Action` | URL | Where the form posts. |
| `page.Lookup.Contact` | Text | The email or phone number the shopper entered. |
| `page.Lookup.ContactLabel` | Text | Label of the email or phone field. |
| `page.Lookup.CSRF` | Text | The form's security token. |
| `page.Lookup.OrderLabel` | Text | Label of the order number field. |
| `page.Lookup.OrderNumber` | Text | The order number the shopper entered. |
| `page.Lookup.Submit` | Text | Label of the button. |
| `page.Message` | Text | A confirmation of what just happened, such as a code being sent. Empty otherwise. |
| `page.Order` | Object | The order found (`order` state). |
| `page.Order.Action` | URL | Where the return request posts. |
| `page.Order.Closed` | Text | Why returns are closed, worded. Empty while open. |
| `page.Order.CSRF` | Text | The form's security token. |
| `page.Order.ExchangeNote` | Text | A note about exchanges, when any line offers one. |
| `page.Order.Existing` | List | Returns already on the order, newest first. |
| `page.Order.Existing[].Address` | List | Where to send the items, one line each, when the customer ships them. |
| `page.Order.Existing[].Items` | List | The items. |
| `page.Order.Existing[].Items[].Detail` | Text | The variant, or the exchange asked for. |
| `page.Order.Existing[].Items[].Image` | URL |  |
| `page.Order.Existing[].Items[].Quantity` | Number |  |
| `page.Order.Existing[].Items[].Title` | Text |  |
| `page.Order.Existing[].LabelExpires` | Text | When the label stops working, worded. |
| `page.Order.Existing[].LabelURL` | URL | The return label to print. |
| `page.Order.Existing[].Next` | Text | What the customer does next, worded. |
| `page.Order.Existing[].Note` | Text | Why the return was declined, worded. |
| `page.Order.Existing[].Number` | Text | The return number. |
| `page.Order.Existing[].QRURL` | URL | A QR code to show instead of a printed label. |
| `page.Order.Existing[].Status` | Text | The status, worded. |
| `page.Order.Existing[].Tone` | Text | `wait`, `go`, `done` or `off`, for styling the status. |
| `page.Order.Existing[].Tracking` | Text | The return carrier and tracking number. |
| `page.Order.Existing[].TrackingURL` | URL |  |
| `page.Order.ExistingHeading` | Text |  |
| `page.Order.How` | Text | How the items come back, worded. |
| `page.Order.HowHeading` | Text |  |
| `page.Order.InstructionsLabel` | Text |  |
| `page.Order.Label` | Text | The order, worded with its number. |
| `page.Order.LabelButton` | Text |  |
| `page.Order.Lines` | List | The items the customer can return now. |
| `page.Order.Lines[].Exchanges` | List | Variants the line can be exchanged for. |
| `page.Order.Lines[].Exchanges[].Label` | Text |  |
| `page.Order.Lines[].Exchanges[].Value` | Text |  |
| `page.Order.Lines[].ID` | Text | The order line. |
| `page.Order.Lines[].Image` | URL |  |
| `page.Order.Lines[].Quantities` | List | The quantities that can be returned, 1 up to the most. |
| `page.Order.Lines[].Title` | Text |  |
| `page.Order.Lines[].Variant` | Text |  |
| `page.Order.Mode` | Text | `self_ship`, `pickup`, `return_label` or `returnless`. |
| `page.Order.NewHeading` | Text |  |
| `page.Order.NoteLabel` | Text |  |
| `page.Order.NoteMax` | Number | Most characters in the note. |
| `page.Order.Nothing` | Text | Shown when nothing can be returned. |
| `page.Order.PreferenceLabel` | Text |  |
| `page.Order.QRHint` | Text |  |
| `page.Order.QuantityLabel` | Text |  |
| `page.Order.ReasonLabel` | Text |  |
| `page.Order.ReasonPlaceholder` | Text |  |
| `page.Order.Reasons` | List | The return reasons. |
| `page.Order.Reasons[].Label` | Text |  |
| `page.Order.Reasons[].Value` | Text |  |
| `page.Order.RefundHeading` | Text |  |
| `page.Order.RefundLabel` | Text |  |
| `page.Order.RefundMethods` | List | Where a refund can go. |
| `page.Order.RefundMethods[].Checked` | Boolean |  |
| `page.Order.RefundMethods[].Label` | Text |  |
| `page.Order.RefundMethods[].Value` | Text |  |
| `page.Order.RefundOnly` | Text | The one refund method, when there is only one. |
| `page.Order.StatusLabel` | Text |  |
| `page.Order.StatusURL` | URL | The order status page. |
| `page.Order.Submit` | Text |  |
| `page.Order.TrackLabel` | Text |  |
| `page.Order.Window` | Text | Until when items can be returned, worded. Empty when closed. |
| `page.Orders` | Object | A signed-in customer's orders (`orders` state). |
| `page.Orders.Empty` | Text | Shown when the customer has no order this page can help with. |
| `page.Orders.Heading` | Text | Heading of the order list. |
| `page.Orders.Items` | List | The orders. |
| `page.Orders.Items[].Date` | Text | The order date, in the shopper's language. |
| `page.Orders.Items[].Label` | Text | The order, worded with its number. |
| `page.Orders.Items[].URL` | URL | Opens the order on this page. |
| `page.Orders.Open` | Text | Label of the link that opens an order. |
| `page.Portal` | Object | The brand half of the page. |
| `page.Portal.BackgroundSrcset` | Text | A `srcset` of the background image in several widths. |
| `page.Portal.BackgroundURL` | URL | The order status page's background image, when the store set one. Empty otherwise. |
| `page.Portal.Links` | List | The store's checkout footer policies, as links. |
| `page.Portal.Links[].Label` | Text | The policy title. |
| `page.Portal.Links[].URL` | URL | The policy page. |
| `page.Portal.Style` | Text | Inline CSS custom properties for the brand half: `--portal-logo` (the checkout logo width) and `--portal-dim` (how much the background image is dimmed). Put it in a `style` attribute. |
| `page.PortalStyles` | HTML | A `<style>` element with the portal layout: the brand on one half and the page on the other on wide screens, the brand above the page on phones. |
| `page.PreviewNotice` | Text | In the editor preview, a notice that the page shows sample data. Empty on the storefront. Required. |
| `page.RootURL` | URL | The storefront home page (`/`). `#` in the editor preview. |
| `page.State` | Text | The step the page is on. See the states above. |
| `page.Steps` | List | The steps of a return, worded, shown on the lookup. |

