> ## Documentation Index
> Fetch the complete documentation index at: https://developers.jup.ag/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Withdraw Price Order

> Deprecated: Withdraw funds from a price-based recurring order. Use time-based orders instead.

> [!WARNING]
>
> The Recurring API is no longer actively maintained and has been superseded by [DCA](https://developers.jup.ag/docs/trigger/dca.md).

**This endpoint is deprecated.** Price-based recurring orders are no longer supported via the API. Use time-based orders (`params.time`) with the [`/createOrder` endpoint](https://developers.jup.ag/docs/recurring/create-order) instead. The documentation below is preserved for reference only.

> [!WARNING]
>
> **CAUTION**
>
> Price-based orders via API is deprecated.

## Withdraw Order

If you want to withdraw funds from a price-based order, you need to do these steps:

**Step 1**

Get a list of the order accounts you want to withdraw via `/getRecurringOrders` endpoint.

**Step 2**

Choose the order account to deposit by making a post request to the `/priceDeposit` endpoint to get the transaction to deposit into the order.

**Step 3**

Sign then send the transaction to the network either via `/execute` endpoint or by yourself.

> [!NOTE]
>
> **GET RECURRING ORDERS**
>
> [Refer to the `/getRecurringOrders` section](https://developers.jup.ag/docs/recurring/get-recurring-orders) to prepare order account you want to withdraw from.

> [!WARNING]
>
> **WARNING**
>
> If you do not pass in `amount`, the transaction will be built to withdraw the full amount of the order.

```js theme={null}
const priceWithdrawResponse = await (
    await fetch('https://api.jup.ag/recurring/v1/priceWithdraw', {
        method: 'POST',
        headers: {
            'Content-Type': 'application/json',
            'x-api-key': 'your-api-key',
        },
        body: JSON.stringify({
            order: "EpTsCUnKComCd8FDNZn3kVrQBQo2uEn5rRzYk9ocqFPH",
            user: wallet.publicKey,
            inputOrOutput: "In", // either "In" or "Out" mint, note that price-based orders auto withdraws the output tokens to the user's wallet every time the order is executed
            amount: 1000000
        }),
    })
).json();
```

## Withdraw Order Response

**Success Example Response**

```js theme={null}
{
  "requestId": "cb1c0e03-8e4a-4f85-ac36-e353c7981f5b",
  "transaction": "AQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAcNRL7cu4ZNuxh1wI9W7GVURyr3A06dH348HDpIQzcAJ4oHNtIX+MwRgQakd3fYovqoEXuKqaHTmdCmjuWoQiMiby7TSszpu+tgf+jdiEM5n3uMiCD/N3AS0uVWTp10QrcFd1R4MYi595YUO8ViNwpWb17+Q9DxkVcz5fWpSqjtDyjKhKdx27tkl2VPxhBBJcKx9gSuUqMJnrF2JWtuKPpRPM1Qmt8G5sH80c9QL+SQJRbRoHSG7z7KaEAztDAAXRb0AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADBkZv5SEXMv/srbpyw5vnvIzlu8X3EmssQ5s6QAAAAAabiFf+q4GE+2h/Y0YYwDXaxDncGus7VZig8AAAAAABBt324ddloZPZy+FGzut5rBy0he1fWzeROoz1hX7/AKmMlyWPTiSJ8bs9ECkUjg2DC1oTmdr/EIQEjnvY2+n4Wcb6evO+2606PWXzaqvJdDGxu+TC0vbg5HymAgNFL11h22bCn6+jaw4yO0OzNgqgKrh+NYPQDG7Wi2D35hzKmzcjGx2VRtfxzpYauPv7ArfDDH2VHlwLKs45O0rZTboL4wMHAAUCnqwAAAcACQNADQMAAAAAAAEOAAAFCwgCAwEEBgkKDAEStxJGnJRtoSIBQEIPAAAAAAAA"
}
```

**Failed Example Response**

```js theme={null}
{
  "code": 400,
  "error": "Failed to deserialize account data: failed to fill whole buffer",
  "status": "Bad Request"
}
```

## Execute Withdraw Order

To sign then send the transaction to the network to execute the withdrawal, you can use the `/execute` endpoint or by yourself.

Refer to the [Execute Order](https://developers.jup.ag/docs/recurring/execute-order) section for more details.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.