---
title: "Execute funding allocation"
url: https://docs.truemarkets.co/api/gateway/execute-allocation
description: "Takes the signatures for the payloads a funding allocation was created with, converts the funds into the allocation's stablecoin in the caller's wallet, and allocates them. Answers the allocation in crediting; poll GET /custody/allocations/{id} until it is completed or rejected. An allocation past funding is returned as it stands, so retrying after a lost response converts and allocates nothing more. A conversion that can no longer run, for example because its payloads expired, leaves the allocation rejected; create a new one."
---

Docs index: https://docs.truemarkets.co/llms.txt

# Execute funding allocation

Takes the signatures for the `payloads` a `funding` allocation was created with, converts the funds into the allocation's stablecoin in the caller's wallet, and allocates them. Answers the allocation in `crediting`; poll `GET /custody/allocations/{id}` until it is `completed` or `rejected`. An allocation past `funding` is returned as it stands, so retrying after a lost response converts and allocates nothing more. A conversion that can no longer run, for example because its payloads expired, leaves the allocation `rejected`; create a new one.

## Request

```
POST https://api.truemarkets.co/v1/gateway/custody/allocations/{id}/execute
```

### Authentication

Bearer token in `Authorization`

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `TM-On-Behalf-Of` | header | string (uuid) | no | Act as one of your organization's users. The value is the `user_id` returned when the user was created; the request then reads and writes that user's account. Requires an organization token and a user your organization created: `400` for a personal token, a repeated header or a non-UUID, `403` for a user outside your organization. Not accepted on organization-scoped routes. |
| `id` | path | string (uuid) | yes | Allocation ID (UUID) |

### Body

`application/json`, required

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `signatures` | array of string | yes | One stamp per payload, in the same order as the payloads. Each entry has the form `ExecuteOrderRequest.signatures` describes for the `auth_type`. |
| `auth_type` | string, one of `web_authn`, `api_key` | yes | The authentication method used to sign transaction payloads. * **web_authn** — Signed using a passkey (WebAuthn/FIDO2 credential) via the browser. * **api_key** — Signed using an API key. Suitable for programmatic/headless access. |

## Responses

Every error status returns the same body, described in [Errors](https://docs.truemarkets.co/developer-resources/errors.md).

### 200

Allocation funded and allocated

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | string (uuid) | yes | Allocation identifier |
| `status` | string, one of `funding`, `allocating`, `crediting`, `releasing`, `completed`, `rejected`, `stranded` | yes | Where the allocation stands. * **funding**: The allocation waits on the caller's signatures to convert the funds into its stablecoin. * **allocating** — The amount is being allocated in the wallet. * **crediting** — The amount is allocated and is being credited to CeFi. * **releasing** — The allocation was refused and the amount is being freed in the wallet. * **completed** — The amount is available to trade on CeFi. * **rejected** — The allocation was refused and the amount is free in the wallet again. * **stranded** — The outcome is unknown and support has to resolve it. |
| `asset_id` | string (uuid) | yes | DeFi listing identifier (UUID) |
| `asset_symbol` | string | yes | Symbol of the listing |
| `amount` | string | yes | Amount this allocation sets aside, as a decimal string |
| `allocated_total` | string | no | Everything the caller has allocated of the listing after this allocation, as a decimal string |
| `transfer` | object | no | The CeFi transfer an allocation or release started, under the exchange's id |
| `transfer.id` | string | yes | Exchange transfer identifier |
| `transfer.status` | string, one of `INITIALIZED`, `PENDING`, `PROCESSING`, `COMPLETED`, `REJECTED`, `FAILED` | yes | Status as last seen from the exchange |
| `failure_reason` | string | no | Why the allocation was refused or stranded |
| `payloads` | array of object | no | What the caller signs to convert the funds of a `funding` allocation, in order. Returned only when the allocation is created. |
| `payloads[].digest` | string | yes | Lowercase hex SHA-256 of the `payload` bytes. A signing API that takes a pre-hashed input signs the hex-decoded digest; a library that hashes its input takes `payload` instead. Passing the hex digest to a library that hashes signs the wrong bytes. |
| `payloads[].payload` | string | yes | The exact text to sign: a Turnkey activity as JSON, including its trailing newline. Sign its UTF-8 bytes as-is with ECDSA P-256 and SHA-256; never decode, reformat or re-serialize it. |
| `created_at` | string (date-time) | yes |  |
| `updated_at` | string (date-time) | yes |  |

### 400

Bad request

### 401

Unauthorized

### 403

Forbidden. On order creation this also covers an asset that is not available to trade from the country the request came from.

### 404

Not found

### 409

Conflict

### 422

Request is well-formed but cannot be processed (e.g. leverage missing or out of range for a perp order)

### 500

Internal server error

### 503

Service unavailable
