For AI agents: the documentation index is at /llms.txt, and this page is available as Markdown at /api/gateway/execute-allocation.md.

Execute funding allocation

Organization tokenNo token

POST
/custody/allocations/{id}/execute

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.

Authorization

bearerAuth
headerAuthorizationBearer <JWT>

An access token from POST /v1/auth/api-key/token. An organization token lasts one hour and has no refresh token; a personal token can be refreshed.

Path Parameters

id*string

Allocation ID (UUID)

Formatuuid

Header Parameters

TM-On-Behalf-Of?string

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.

Formatuuid

Request Body

application/json
  1. body

Signatures for a funding allocation's payloads, one per payload in the order they were returned.

signatures*array<string>

One stamp per payload, in the same order as the payloads. Each entry has the form ExecuteOrderRequest.signatures describes for the auth_type.

Items1 <= items
auth_type*SigningMethod

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.
Value in"web_authn""api_key"

Response Body

Allocation funded and allocated

application/json
  1. response

An allocation and what it has left behind on each side so far.

id*string

Allocation identifier

Formatuuid
status*AllocationStatus

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.
Value in"funding""allocating""crediting""releasing""completed""rejected""stranded"
asset_id*string

DeFi listing identifier (UUID)

Formatuuid
asset_symbol*string

Symbol of the listing

amount*string

Amount this allocation sets aside, as a decimal string

allocated_total?string

Everything the caller has allocated of the listing after this allocation, as a decimal string

transfer?

The CeFi transfer an allocation or release started, under the exchange's id

failure_reason?string

Why the allocation was refused or stranded

payloads?array<>

What the caller signs to convert the funds of a funding allocation, in order. Returned only when the allocation is created.

created_at*string
Formatdate-time
updated_at*string
Formatdate-time
Example Request
curl -X POST 'https://api.truemarkets.co/v1/gateway/custody/allocations/497f6eca-6276-4993-bfeb-53cbbbba6f08/execute' \  -H 'TM-On-Behalf-Of: 3f6d2c0e-8a41-4c2b-9f1e-2b7d5c0a9e11' \  -H 'Content-Type: application/json' \  -d '{  "signatures": [    "string"  ],  "auth_type": "api_key"}'
Example Response
{  "id": "c1d2e3f4-5a6b-4c7d-8e9f-0a1b2c3d4e5f",  "status": "crediting",  "asset_id": "b3d9e5f2-1a4c-4e7b-9f0d-2c8a6b3e5f91",  "asset_symbol": "USDC",  "amount": "100.00",  "allocated_total": "250.00",  "transfer": {    "id": "a7f3c2e1-9b4d-4e6f-8a1c-3d5e7f9b2c4a",    "status": "COMPLETED"  },  "failure_reason": "cefi REJECTED",  "payloads": [    {      "digest": "string",      "payload": "string"    }  ],  "created_at": "2019-08-24T14:15:22Z",  "updated_at": "2019-08-24T14:15:22Z"}