# Funding

> Send native tokens from a funder to many wallets, directly or through an exchange.

A funding job moves native tokens from one of your [funders](/reference/funders/) to a list of wallets. It starts as a draft holding a plan (one line per recipient and amount). [Retrieve a funding quote](#retrieve-a-funding-quote) for the total the funder needs, update the draft if necessary, then execute it. Execution runs in the background; follow it with [List funding jobs](#list-funding-jobs).

A `Classic` job pays recipients on-chain from the funder, optionally spacing lines by `funding_delay` seconds. A `Cex` job sends each line through an exchange named by the line's `kind`, using the `husher` provider; [List funding sources](#list-funding-sources) lists the exchanges available per chain.

This resource covers account-level funding, used by the Fund wallets and Clean dust flows. Funding tied to a launch is documented with launches.

Base URL: `https://api-mig.proxima.tools`

## Endpoints

- `GET /funding/get`: List funding jobs
- `GET /funding/get-quote/{funding_id}`: Retrieve a funding quote
- `POST /funding/{chain_id}/create-draft`: Create a funding draft
- `POST /funding/update-draft/{funding_id}`: Update a funding draft
- `POST /funding/execute/{funding_id}`: Execute a funding draft
- `POST /funding/discard/{funding_id}`: Discard a funding job
- `GET /funding/get-funding-sources`: List funding sources
- `POST /funding/rescue/{funding_id}`: Rescue a funding job
- `POST /funding/cancel/{funding_id}`: Cancel a funding job

## The Funding object

A funding job. SVM and EVM jobs share this shape.

- `id` (string): Funding job ID (UUID).
- `chain_id` (enum): Chain the job funds on. Possible values: `sol`, `eth`, `bsc`, `base`, `robinhood`, `monad`, `arc`, `xlayer`.
- `status` (enum): Job state. Possible values: `Draft`, `Running`, `Completed`, `Failed`.
- `funding_type` (enum): `Classic` pays recipients on-chain from the funder; `Cex` routes each line through an exchange. Possible values: `Classic`, `Cex`.
- `plan` (array<object>): One line per recipient.
  - `amount_out` (integer): Amount the recipient receives, in native base units.
  - `to` (string): Recipient wallet address.
  - `kind` (string): Exchange that funds this line, for example `binance`, from [List funding sources](#list-funding-sources). Set it on every line for a CEX job, on none for a classic job.
- `funder_pubkey` (string | null): Funder that pays for the job.
- `funding_delay` (integer): Seconds between two consecutive lines. `0` sends them back to back.
- `cex_provider` (string | null): Exchange routing provider of a CEX job: `husher`.
- `cex_order_id` (string | null): Exchange order ID of a CEX job.
- `cex_order_map` (object): Exchange order IDs recorded for the job.
- `started_indexes` (array<integer>): Indexes into `plan` of the lines whose transfer has started.
- `funded_indexes` (array<integer>): Indexes into `plan` of the lines delivered.
- `wallets_funded` (integer): Number of lines delivered.
- `launch_id` (string | null): Launch the job belongs to. Always `null` in [List funding jobs](#list-funding-jobs), which excludes launch funding.
- `license_key` (string): License that owns the job.
- `safety_sol` (number): Solana-only safety amount; always `0` on EVM jobs.
- `created_at` (integer): Unix timestamp (seconds) at which the job was created.
- `started_at` (integer | null): Unix timestamp (seconds) at which execution started. Always `null` on EVM jobs.

```json
{
  "id": "bba9fee8-4598-44fb-b1c0-6d0ae46ddc85",
  "chain_id": "sol",
  "status": "Running",
  "funding_type": "Classic",
  "plan": [
    {
      "amount_out": 250000000,
      "to": "C31EeqtSvpjYHFQxBoP9bBTpqtUWV2avNhjdaN1yem44"
    },
    {
      "amount_out": 310000000,
      "to": "ART7zvRihsxp6iuCegVRED44XZMov9u6fnFJHF7HqcN4"
    }
  ],
  "funder_pubkey": "91Xgc8gCBPK92v2i3CPnoMLNT8BJBRbL9WZ9ouiL5NVy",
  "funding_delay": 30,
  "cex_provider": null,
  "cex_order_id": null,
  "cex_order_map": {},
  "started_indexes": [
    0,
    1
  ],
  "funded_indexes": [
    0
  ],
  "wallets_funded": 1,
  "launch_id": null,
  "license_key": "a0dfc12e-7daa-4f7d-b694-85f791a35f80",
  "safety_sol": 0,
  "created_at": 1793560000,
  "started_at": 1793560120
}
```

### List funding jobs

`GET /funding/get`

Returns the account's funding jobs on every chain, excluding launch funding. (Bearer JWT)

- Token: Upgraded session token, bound to a license.
- Read-only tokens: allowed.
- Retry: Safe to retry.

The web app polls it every 3 seconds while a job is `Running` and every 10 seconds otherwise.

#### Returns 200 OK

Returns a list of [Funding](#object-funding) objects.

- `fundings` (array<object>): Funding jobs.

#### Example request

```bash
curl "https://api-mig.proxima.tools/funding/get" \
  -H "Authorization: Bearer $PROXIMA_JWT"
```

#### Example response

```json
{
  "fundings": [
    {
      "id": "bba9fee8-4598-44fb-b1c0-6d0ae46ddc85",
      "chain_id": "sol",
      "status": "Running",
      "funding_type": "Classic",
      "plan": [
        {
          "amount_out": 250000000,
          "to": "C31EeqtSvpjYHFQxBoP9bBTpqtUWV2avNhjdaN1yem44"
        },
        {
          "amount_out": 310000000,
          "to": "ART7zvRihsxp6iuCegVRED44XZMov9u6fnFJHF7HqcN4"
        }
      ],
      "funder_pubkey": "91Xgc8gCBPK92v2i3CPnoMLNT8BJBRbL9WZ9ouiL5NVy",
      "funding_delay": 30,
      "cex_provider": null,
      "cex_order_id": null,
      "cex_order_map": {},
      "started_indexes": [
        0,
        1
      ],
      "funded_indexes": [
        0
      ],
      "wallets_funded": 1,
      "launch_id": null,
      "license_key": "a0dfc12e-7daa-4f7d-b694-85f791a35f80",
      "safety_sol": 0,
      "created_at": 1793560000,
      "started_at": 1793560120
    }
  ]
}
```

### Retrieve a funding quote

`GET /funding/get-quote/{funding_id}`

Returns the total native amount the funder needs to execute a draft. (Bearer JWT)

- Token: Upgraded session token, bound to a license.
- Read-only tokens: allowed.
- Retry: Safe to retry.

The web app polls it every 10 seconds on the funding confirmation screen.

#### Path parameters

- `funding_id` (string, required): ID of the draft.

#### Returns 200 OK

- `fund_required` (integer): Native amount the funder must hold, in base units, including the job's fee reserve. EVM chains return it as a decimal string (wei).
- `expired_at` (integer): Unix timestamp (seconds) after which the quote is stale. The web app treats a missing value as no expiry.

#### Errors

| Status | Code | Message | When | What to do |
| --- | --- | --- | --- | --- |
| 404 | `not_found` | `No funding job found with corresponding UUID` | No funding job with this ID exists. | Use an `id` from [List funding jobs](/reference/funding/#list-funding-jobs). |
| 404 | `not_found` | `funding draft not found` | On EVM chains, the job belongs to another account. | Use an `id` from [List funding jobs](/reference/funding/#list-funding-jobs). |
| 400 | `bad_request` | `Unsupported exchange for Husher` | On Solana, a CEX line names an exchange the provider does not support. | Use an exchange from [List funding sources](/reference/funding/#list-funding-sources). |
| 400 | `unsupported_chain` | `this endpoint is not supported for this chain` | The job belongs to a chain this API no longer serves. | Remove the job with [Discard a funding job](/reference/funding/#discard-a-funding-job), which still works on retired chains. |

#### Example request

```bash
curl "https://api-mig.proxima.tools/funding/get-quote/bba9fee8-4598-44fb-b1c0-6d0ae46ddc85" \
  -H "Authorization: Bearer $PROXIMA_JWT"
```

#### Example response

```json
{
  "fund_required": 572000000,
  "expired_at": 1793560600
}
```

### Create a funding draft

`POST /funding/{chain_id}/create-draft`

Creates a funding job in `Draft` status. (Bearer JWT)

- Token: Upgraded session token, bound to a license.
- Read-only tokens: refused with `403 read_only_token`.
- Retry: Check before retrying. Each call creates a new draft. Before retrying, call [List funding jobs](/reference/funding/#list-funding-jobs), which includes drafts, and remove any duplicate with [Discard a funding job](/reference/funding/#discard-a-funding-job).

Nothing moves until the draft is executed. The web app picks the default funder of the chain as `funder_pubkey`.

#### Path parameters

- `chain_id` (enum, required): Chain to fund on. Possible values: `sol`, `eth`, `bsc`, `base`, `robinhood`, `monad`, `arc`, `xlayer`.

#### Body parameters

- `plan` (array<object>, required): One line per recipient.
  - `amount_out` (integer, required): Amount the recipient receives, in native base units.
  - `to` (string, required): Recipient wallet address.
  - `kind` (string, optional): Exchange that funds this line, for example `binance`, from [List funding sources](#list-funding-sources). Set it on every line for a CEX job, on none for a classic job.
- `funding_delay` (integer, required): Seconds between two consecutive lines, from 0 to 7,200.
- `funder_pubkey` (string, required): Funder that pays for the job.
- `cex_provider` (enum, optional): Exchange routing provider. Sent for CEX jobs only. Possible values: `husher`.

#### Returns 200 OK

- `uuid` (string): ID of the funding job.
- `funder_pubkey` (string | null): Funder resolved for the job.

#### Errors

| Status | Code | Message | When | What to do |
| --- | --- | --- | --- | --- |
| 400 | `bad_request` | `unknown chain_id: <chain_id>` | `chain_id` is not a chain the API serves. | Use a supported `chain_id`; `monad` is no longer accepted. |
| 400 | `bad_request` | `plan is required when creating a draft` | On Solana, `plan` is missing. | Send at least one line in `plan`. |
| 400 | `bad_request` | `invalid funder pubkey` | On Solana, `funder_pubkey` is not a valid address. | Use a funder address from [List funders](/reference/funders/#list-funders). |
| 400 | `bad_request` | `funder <address> not found for this license (must be a universal funder)` | On EVM chains, `funder_pubkey` is a `0x` address that is not a funder of the account. | Use a funder address from [List funders](/reference/funders/#list-funders). |
| 500 | `internal_error` | `Funding delay out of bounds` | On Solana, `funding_delay` is above 7,200 seconds. Returned as a 500, not a 400. | Set `funding_delay` between 0 and 7,200. |
| 422 | `upstream_failure` | `husher api issue: <address> on <exchange>: <reason> (receive=<amount> <token>, min=<minimum> <token>); raise the amount or drop this exchange` | The exchange provider refused a CEX line, usually because its amount is below the exchange minimum. | Raise the line's `amount_out` above the minimum or fund that recipient from another exchange. |

#### Example request

```bash
curl -X POST "https://api-mig.proxima.tools/funding/sol/create-draft" \
  -H "Authorization: Bearer $PROXIMA_JWT" \
  -H "Content-Type: application/json" \
  -d '{
  "plan": [
    {
      "to": "C31EeqtSvpjYHFQxBoP9bBTpqtUWV2avNhjdaN1yem44",
      "amount_out": 250000000
    },
    {
      "to": "ART7zvRihsxp6iuCegVRED44XZMov9u6fnFJHF7HqcN4",
      "amount_out": 310000000
    }
  ],
  "funding_delay": 30,
  "funder_pubkey": "91Xgc8gCBPK92v2i3CPnoMLNT8BJBRbL9WZ9ouiL5NVy"
}'
```

#### Example response

```json
{
  "uuid": "bba9fee8-4598-44fb-b1c0-6d0ae46ddc85",
  "funder_pubkey": "91Xgc8gCBPK92v2i3CPnoMLNT8BJBRbL9WZ9ouiL5NVy"
}
```

### Update a funding draft

`POST /funding/update-draft/{funding_id}`

Changes the plan, delay, provider or funder of a draft. (Bearer JWT)

- Token: Upgraded session token, bound to a license.
- Read-only tokens: refused with `403 read_only_token`.
- Retry: Safe to retry. Sending the same update again leaves the draft in the same state.

Omitted fields are left unchanged, except `funder_pubkey` on Solana: omitting it resets the draft's funder to the account's default funder.

#### Path parameters

- `funding_id` (string, required): ID of the draft.

#### Body parameters

- `plan` (array<object>, optional): New plan, replacing the current one.
  - `amount_out` (integer, required): Amount the recipient receives, in native base units.
  - `to` (string, required): Recipient wallet address.
  - `kind` (string, optional): Exchange that funds this line, for example `binance`, from [List funding sources](#list-funding-sources). Set it on every line for a CEX job, on none for a classic job.
- `funding_delay` (integer, optional): Seconds between two consecutive lines, from 0 to 7,200.
- `cex_provider` (enum, optional): Exchange routing provider. Possible values: `husher`.
- `funder_pubkey` (string | null, optional): Funder that pays for the job. On Solana, send it on every update: an omitted value resets the draft to the default funder.

#### Returns 200 OK

- `uuid` (string): ID of the funding job.
- `funder_pubkey` (string | null): Funder resolved for the job.

#### Errors

| Status | Code | Message | When | What to do |
| --- | --- | --- | --- | --- |
| 404 | `not_found` | `No funding job found with corresponding UUID` | No funding job with this ID exists. | Use an `id` from [List funding jobs](/reference/funding/#list-funding-jobs). |
| 409 | `conflict` | `Can only update draft funding jobs` | The job is no longer a draft. | Create a new draft with [Create a funding draft](/reference/funding/#create-a-funding-draft). |
| 400 | `bad_request` | `invalid funder pubkey` | On Solana, `funder_pubkey` is not a valid address. | Use a funder address from [List funders](/reference/funders/#list-funders). |
| 400 | `bad_request` | `funder <address> not found for this license (must be a universal funder)` | On EVM chains, `funder_pubkey` is a `0x` address that is not a funder of the account. | Use a funder address from [List funders](/reference/funders/#list-funders). |
| 400 | `bad_request` | `funder not found` | On EVM chains, `funder_pubkey` is not a `0x` address and the account has no default funder for the chain. | Send a funder address from [List funders](/reference/funders/#list-funders), or set a default with [Set the default funder](/reference/funders/#set-the-default-funder). |
| 500 | `internal_error` | `Funding delay out of bounds` | On Solana, `funding_delay` is above 7,200 seconds. Returned as a 500, not a 400. | Set `funding_delay` between 0 and 7,200. |
| 422 | `upstream_failure` | `husher api issue: <address> on <exchange>: <reason> (receive=<amount> <token>, min=<minimum> <token>); raise the amount or drop this exchange` | The exchange provider refused a CEX line, usually because its amount is below the exchange minimum. | Raise the line's `amount_out` above the minimum or fund that recipient from another exchange. |
| 400 | `unsupported_chain` | `this endpoint is not supported for this chain` | The job belongs to a chain this API no longer serves. | Remove the job with [Discard a funding job](/reference/funding/#discard-a-funding-job), which still works on retired chains. |

#### Example request

```bash
curl -X POST "https://api-mig.proxima.tools/funding/update-draft/bba9fee8-4598-44fb-b1c0-6d0ae46ddc85" \
  -H "Authorization: Bearer $PROXIMA_JWT" \
  -H "Content-Type: application/json" \
  -d '{
  "funding_delay": 60
}'
```

#### Example response

```json
{
  "uuid": "bba9fee8-4598-44fb-b1c0-6d0ae46ddc85",
  "funder_pubkey": "91Xgc8gCBPK92v2i3CPnoMLNT8BJBRbL9WZ9ouiL5NVy"
}
```

### Execute a funding draft

`POST /funding/execute/{funding_id}`

Starts sending funds for a draft. (Bearer JWT)

- Token: Upgraded session token, bound to a license.
- Read-only tokens: refused with `403 read_only_token`.
- Retry: Check before retrying. Before retrying, call [List funding jobs](/reference/funding/#list-funding-jobs): if the job's `status` is no longer `Draft`, the first call started it. A repeat on a started job is refused (409 on Solana, 400 on EVM chains).

No request body. The job moves to `Running` and continues in the background.

> Moves funds from the funder to every recipient in the plan. Lines already sent are not reversible.

#### Path parameters

- `funding_id` (string, required): ID of the draft.

#### Returns 200 OK

- `ok` (boolean): Always `true` on success.
- `message` (string): Human-readable confirmation.

#### Errors

| Status | Code | Message | When | What to do |
| --- | --- | --- | --- | --- |
| 404 | `not_found` | `No funding job found with corresponding UUID` | No funding job with this ID exists. | Use an `id` from [List funding jobs](/reference/funding/#list-funding-jobs). |
| 404 | `not_found` | `funding draft not found` | On EVM chains, the job belongs to another account. | Use an `id` from [List funding jobs](/reference/funding/#list-funding-jobs). |
| 409 | `conflict` | `Funding job must be a draft to execute it` | On Solana, the job is not a draft. | Check the job's `status` in [List funding jobs](/reference/funding/#list-funding-jobs). |
| 400 | `bad_request` | `funding job is not in draft status` | On EVM chains, the job is not a draft. Solana returns 409 instead. | Check the job's `status` in [List funding jobs](/reference/funding/#list-funding-jobs). |
| 400 | `bad_request` | `Invalid funder pubkey` | On Solana, the job's funder address is invalid. | Set a funder from [List funders](/reference/funders/#list-funders) with [Update a funding draft](/reference/funding/#update-a-funding-draft). |
| 404 | `not_found` | `Funder wallet not found` | On Solana, the job's funder is not on the account. | Set a funder from [List funders](/reference/funders/#list-funders) with [Update a funding draft](/reference/funding/#update-a-funding-draft). |
| 500 | `internal_error` | `Funder don't have enough funds` | On Solana, the funder holds less than the job needs. Returned as a 500. | Top up the funder to the amount from [Retrieve a funding quote](/reference/funding/#retrieve-a-funding-quote). |
| 500 | `internal_error` | `Funding plan has no recipients` | On Solana, the plan has no recipient. Returned as a 500. | Add lines to the plan with [Update a funding draft](/reference/funding/#update-a-funding-draft). |
| 400 | `bad_request` | `funder unavailable: <reason>` | On EVM chains, the job's funder cannot be used. | Set another funder with [Update a funding draft](/reference/funding/#update-a-funding-draft). |
| 400 | `bad_request` | `no default <chain> funder set, use /wallets/funders/set-default or assign one to the draft` | On EVM chains, the draft has no funder and the account has no default funder for the chain. | Set a default with [Set the default funder](/reference/funders/#set-the-default-funder), or a funder on the draft. |
| 422 | `upstream_failure` | `husher api issue: <message>` | On EVM chains, the exchange provider refused the CEX order. | Check the message, adjust the plan, then retry. |
| 500 | `internal_error` | `funding failed: <error>` | On EVM chains, a job without `funding_delay` runs at once and a send failed. The job is marked `Failed`. | Check the job in [List funding jobs](/reference/funding/#list-funding-jobs) and rescue or discard it. |
| 400 | `unsupported_chain` | `this endpoint is not supported for this chain` | The job belongs to a chain this API no longer serves. | Remove the job with [Discard a funding job](/reference/funding/#discard-a-funding-job), which still works on retired chains. |

#### Example request

```bash
curl -X POST "https://api-mig.proxima.tools/funding/execute/bba9fee8-4598-44fb-b1c0-6d0ae46ddc85" \
  -H "Authorization: Bearer $PROXIMA_JWT"
```

#### Example response

```json
{
  "ok": true,
  "message": "Successfully started funding"
}
```

### Discard a funding job

`POST /funding/discard/{funding_id}`

Deletes a draft or a finished funding job from the list. (Bearer JWT)

- Token: Upgraded session token, bound to a license.
- Read-only tokens: refused with `403 read_only_token`.
- Retry: Safe to retry. A repeat after a successful discard returns 404.

No request body.

#### Path parameters

- `funding_id` (string, required): ID of the funding job (`id` of the Funding object).

#### Returns 200 OK

- `ok` (boolean): Always `true` on success.
- `message` (string): Human-readable confirmation.

#### Errors

| Status | Code | Message | When | What to do |
| --- | --- | --- | --- | --- |
| 404 | `not_found` | `No funding job found with corresponding UUID` | No funding job with this ID exists. | Use an `id` from [List funding jobs](/reference/funding/#list-funding-jobs). |
| 404 | `not_found` | `funding job not found` | On EVM chains, the job belongs to another account. | Use an `id` from [List funding jobs](/reference/funding/#list-funding-jobs). |
| 409 | `conflict` | `Cannot discard a running funding job` | On Solana, the job is running. | Cancel it with [Cancel a funding job](/reference/funding/#cancel-a-funding-job) first. |
| 400 | `bad_request` | `cannot discard a running job — cancel it first` | On EVM chains, the job is running. Solana returns 409 instead. | Cancel it with [Cancel a funding job](/reference/funding/#cancel-a-funding-job) first. |
| 409 | `conflict` | `Some funds are stuck, please rescue before discarding` | On Solana, funds are stuck in the job's intermediate wallets. | Sweep them with [Rescue a funding job](/reference/funding/#rescue-a-funding-job) first. |

#### Example request

```bash
curl -X POST "https://api-mig.proxima.tools/funding/discard/bba9fee8-4598-44fb-b1c0-6d0ae46ddc85" \
  -H "Authorization: Bearer $PROXIMA_JWT"
```

#### Example response

```json
{
  "ok": true,
  "message": "Successfully discarded funding job"
}
```

### List funding sources

`GET /funding/get-funding-sources`

Returns the exchanges available for CEX funding on each chain, with their minimums. (Bearer JWT)

- Token: Upgraded session token, bound to a license.
- Read-only tokens: allowed.
- Retry: Safe to retry.

Availability comes from a live rate check with the provider. The web app caches the result for 60 seconds.

#### Returns 200 OK

- `sources` (object): Exchanges per chain ID.
  - `<chain_id>` (array<object>): Exchanges usable on this chain.
    - `id` (string): Exchange ID, used as `kind` in a plan line.
    - `is_available` (boolean): Whether the exchange currently routes.
    - `image` (string): Logo URL.
    - `min_native_funding` (integer): Smallest line amount the exchange accepts, in native base units.
    - `provider` (enum): Routing provider. Possible values: `husher`.

#### Example request

```bash
curl "https://api-mig.proxima.tools/funding/get-funding-sources" \
  -H "Authorization: Bearer $PROXIMA_JWT"
```

#### Example response

```json
{
  "sources": {
    "sol": [
      {
        "id": "binance",
        "is_available": true,
        "image": "https://cdn.example.com/cex/binance.png",
        "min_native_funding": 120000000,
        "provider": "husher"
      },
      {
        "id": "kucoin",
        "is_available": false,
        "image": "https://cdn.example.com/cex/kucoin.png",
        "min_native_funding": 90000000,
        "provider": "husher"
      }
    ]
  }
}
```

### Rescue a funding job

`POST /funding/rescue/{funding_id}`

Sweeps funds left in a classic job's intermediate wallets back to the default funder. (Bearer JWT)

- Token: Upgraded session token, bound to a license.
- Read-only tokens: refused with `403 read_only_token`.
- Retry: Safe to retry. Only what is left in the intermediate wallets is swept, so a repeat moves nothing new.

No request body. On Solana a classic job hops through intermediate wallets; use this when a stopped or failed job left funds in them. An EVM classic job pays recipients directly, so on EVM chains the call always returns `No fund to rescue`.

#### Path parameters

- `funding_id` (string, required): ID of the funding job (`id` of the Funding object).

#### Returns 200 OK

- `ok` (boolean): Always `true` on success.
- `message` (string): Human-readable confirmation.

#### Errors

| Status | Code | Message | When | What to do |
| --- | --- | --- | --- | --- |
| 404 | `not_found` | `No funding job found with corresponding UUID` | No funding job with this ID exists. | Use an `id` from [List funding jobs](/reference/funding/#list-funding-jobs). |
| 409 | `conflict` | `Cannot rescue a running funding job` | On Solana, the job is running. | Wait for it to end, or cancel it with [Cancel a funding job](/reference/funding/#cancel-a-funding-job). |
| 409 | `conflict` | `Cannot rescue a CEX funding job` | On Solana, the job is a CEX job. | Rescue only classic jobs. |
| 400 | `unsupported_chain` | `this endpoint is not supported for this chain` | The job belongs to a chain this API no longer serves. | Remove the job with [Discard a funding job](/reference/funding/#discard-a-funding-job), which still works on retired chains. |

#### Example request

```bash
curl -X POST "https://api-mig.proxima.tools/funding/rescue/bba9fee8-4598-44fb-b1c0-6d0ae46ddc85" \
  -H "Authorization: Bearer $PROXIMA_JWT"
```

#### Example response

```json
{
  "ok": true,
  "message": "Successfully withdrew"
}
```

### Cancel a funding job

`POST /funding/cancel/{funding_id}`

Stops a running job before its remaining lines are sent. (Bearer JWT)

- Token: Upgraded session token, bound to a license.
- Read-only tokens: refused with `403 read_only_token`.
- Retry: Safe to retry. Cancelling an already cancelled job changes nothing; once the job stops, a repeat returns 409.

No request body.

> Only lines not yet sent are stopped. Funds already delivered stay with their recipients.

#### Path parameters

- `funding_id` (string, required): ID of the funding job (`id` of the Funding object).

#### Returns 200 OK

- `ok` (boolean): `true` when the cancellation was accepted.
- `message` (string): Human-readable result.

#### Errors

| Status | Code | Message | When | What to do |
| --- | --- | --- | --- | --- |
| 404 | `not_found` | `No funding job found with corresponding UUID` | No funding job with this ID exists. | Use an `id` from [List funding jobs](/reference/funding/#list-funding-jobs). |
| 409 | `conflict` | `Funding job is not running` | The job is not running. | Check the job's `status` in [List funding jobs](/reference/funding/#list-funding-jobs). |
| 409 | `conflict` | `This funding job cannot be cancelled (no delay or unsupported provider)` | On Solana, the job cannot be cancelled: a classic job without `funding_delay`, or a CEX job. | Let the job finish. |
| 409 | `conflict` | `This funding job cannot be cancelled (no delay)` | On EVM chains, the job has no `funding_delay` and cannot be cancelled. | Let the job finish. |
| 409 | `conflict` | `Funding job is being walked elsewhere, retry in a moment` | Another server instance is processing the job. | Retry after a few seconds. |
| 409 | `conflict` | `Funding job just resumed here, retry in a moment` | The job has just resumed on this instance. | Retry after a few seconds. |
| 400 | `unsupported_chain` | `this endpoint is not supported for this chain` | The job belongs to a chain this API no longer serves. | Remove the job with [Discard a funding job](/reference/funding/#discard-a-funding-job), which still works on retired chains. |

#### Example request

```bash
curl -X POST "https://api-mig.proxima.tools/funding/cancel/bba9fee8-4598-44fb-b1c0-6d0ae46ddc85" \
  -H "Authorization: Bearer $PROXIMA_JWT"
```

#### Example response

```json
{
  "ok": true,
  "message": "Funding cancellation requested"
}
```
