> For the complete documentation index, see [llms.txt](https://docs.coridor.fun/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.coridor.fun/developers/close-interactive-flow.md).

# Close Interactive Flow

When to close the Coridor popup / webview during deposit and withdraw.

***

## How Coridor signals progress

Coridor’s interactive widget **does not** emit `postMessage` events. **Poll the anchor SEP-24 transaction** (recommended) or use Demo Wallet’s built-in handling.

| Flow         | When to close popup                                           |
| ------------ | ------------------------------------------------------------- |
| **Withdraw** | Status = **`pending_user_transfer_start`**                    |
| **Deposit**  | Keep open until user finishes IDR payment (or user dismisses) |

***

## Withdraw — close popup at `pending_user_transfer_start`

When status becomes **`pending_user_transfer_start`**:

1. Transaction includes `withdraw_anchor_account`, `withdraw_memo`, `amount_in`
2. **Close** the interactive popup
3. Build and submit the Stellar **USDC payment** in the wallet ([send funds](/developers/send-receive-usdc.md))

**Recommended — poll SEP-24:**

```typescript
watcher.watchOneTransaction({
  authToken,
  assetCode: "USDC",
  id: transactionId,
  onMessage: (tx) => {
    if (tx.status === "pending_user_transfer_start") {
      popup?.close();
      // submit USDC payment with tx.withdraw_memo, etc.
    }
  },
});
```

***

## Deposit — do not close early

For **deposit**, the user must **finish IDR payment** in the widget (VA transfer, QR scan, OVO confirm, or Simulate).

Closing early does not complete the deposit. Wait for status **`completed`** (or user dismisses intentionally).

***

## more\_info redirect

Some wallets redirect to **`more_info_url`** after submit. Coridor serves status at:

```
https://api.coridor.fun/sep24/transaction/more_info?token=<jwt>
```

Auto-refreshes every 5s — useful if the popup is closed before completion.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://docs.coridor.fun/developers/close-interactive-flow.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
