# Payload Return URL

The Return URL (`return_url)` determines where the user is sent when the payload is signed. If none is given, the user will simply be displayed `Close` button in Xumm. Otherwise, the user will be presented a button which launches the Return URL.

{% hint style="warning" %}
**Warning!** iOS and Android **do not allow** the user to return to the browser tab they came from (if your flow starts in a browser). Make sure you restore state based on the payload / session / custom identifier or custom metadata assigned to the payload.
{% endhint %}

{% hint style="info" %}
When a payload is created using the Xumm SDK in an xApp flow, the return URL is ignoded as the user will return to the xApp post signing, where an SDK event will be triggered.
{% endhint %}

## Replacement variables

#### You can add the following replacement tags in your Return URL. They will be replaced with the appropriate values by Xumm.

* `{id}` will be replaced with the xumm payload UUID.
* `{cid}` will be replaced with the optional custom payload identifier.
* `{txid}` will be replaced with the signed transaction hash.
* `{txblob}` will be replaced with the signed transaction HEX blob.

## Routing / origin logic

If both the `app` and `web` return URL values are present, and **if they are identical**, the XUMM platform will execute logic to see if the user is coming from a browser tab (local device or remote, e.g. desktop browser). If so, and **if the origin browser window is still active**, only the origin browser window will redirect, and the app won't. Else (if the browser window is not active anymore) XUMM will redirect to the return URL.

This behaviour prevents a double redirect (both on mobile and on desktop / browser window).

## Sample payload body

```json
{
  "txjson": {
    "TransactionType": "..."
  },
  "options": {
    "return_url": {
      "app": "https://...",
      "web": "https://..."
    }
  }
}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.xaman.dev/concepts/payloads-sign-requests/payload-return-url.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
