> 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/initiate-transaction-sep-24.md).

# Initiate Transaction (SEP-24)

Start a deposit or withdrawal using **SEP-24**. Coridor returns an **interactive URL** (popup) on `api.coridor.fun`.

## Deposit (on-ramp: IDR → USDC)

After SEP-10 auth:

```typescript
const { url, id } = await anchor.sep24().deposit({
  authToken,
  assetCode: "USDC",
  lang: "en",
});
// Open `url` in popup / webview — user pays IDR in Coridor widget
```

**User actions in widget:**

* Enter IDR amount
* Choose VA, QRIS, or OVO
* Complete payment (or Simulate in sandbox)

Anchor sends **USDC to the user** after Xendit confirms IDR payment.

## Withdraw (off-ramp: USDC → IDR)

```typescript
const { url, id } = await anchor.sep24().withdraw({
  authToken,
  assetCode: "USDC",
  lang: "en",
  // amount optional for non-custodial; user enters in wallet/widget
});
// Open `url` — user enters bank account details
```

After the widget completes KYC/bank capture, status becomes **`pending_user_transfer_start`** — wallet must send USDC (see [send/receive funds](/developers/send-receive-usdc.md)).

## Required fields

| Field        | Deposit                   | Withdraw                        |
| ------------ | ------------------------- | ------------------------------- |
| `authToken`  | ✅ SEP-10 JWT              | ✅                               |
| `assetCode`  | `USDC`                    | `USDC`                          |
| `lang`       | optional (`en`)           | optional                        |
| Bank details | —                         | Collected in interactive widget |
| `amount`     | User enters IDR in widget | User enters USDC in wallet      |

Optional [customer fields](/developers/customer-and-bank-info.md) are not required on Coridor staging.

## Open the interactive URL

Open in **popup, webview, or new tab**:

```javascript
const popup = window.open(url, "coridor-sep24", "width=480,height=720");
```

The URL points to:

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

## Save the transaction id

Keep **`id`** from the SEP-24 response for polling ([poll status](/developers/poll-transaction-status.md)).


---

# 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/initiate-transaction-sep-24.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.
