---
title: "Prepare Transaction"
method: POST
path: "/v1/register/prepare-transaction"
tags: ["registration"]
---

# Prepare Transaction

`POST /v1/register/prepare-transaction`

## Request

- Base URL: `https://alive-api.alphakek.ai` (the document declares no server; this is the origin it was published from)
- URL: `https://alive-api.alphakek.ai/v1/register/prepare-transaction`
- Auth: none declared

Prepare an unsigned CREATE ENVIRONMENT transaction for wallet signing.

Absorbs check-token + check-authority + get-blockhash + tx building
into a single call. The frontend signs the returned transaction
and sends it via /send-transaction.

Requires a pending registration (call /start first).

==== Observability ====
Every decision branch in this function emits a structured log line
via the `log` binding (see below). Each log event includes every
value that affected the decision, so grepping
`kubectl logs | grep register_prepare` for a given token_address
or user_wallet gives the complete picture of what the user saw
without having to ask them.

## Request body

- PrepareTransactionRequest: Request to prepare a CREATE ENVIRONMENT transaction.
  - `token_address` string, required
  - `user_wallet_address` string, required

## Response `200`

Successful Response

- PrepareTransactionResponse: Response with unsigned transaction ready for wallet signing. `transaction` stays optional because the `already_transferred` branch returns without building one. Every failure path raises HTTPException, so there is no `error` field — a vestigial one existed until PR #164, removed after confirming no call site ever populated it.
  - `transaction` string, nullable
  - `needs_signing` boolean
  - `already_transferred` boolean
  - `is_graduated` boolean
  - `pool_address` string, nullable
  - `instruction_count` integer

## Other responses

- `422`: Validation Error

## Changes

- **2026-10-16** `b6d96e7673dc`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/alphakek-ai/apis/aikek-api/changes/v1/register/prepare-transaction/post.md)

---

[API](https://skmtc.dev/alphakek-ai/apis/aikek-api.md) - [All operations](https://skmtc.dev/alphakek-ai/apis/aikek-api/llms.txt) - [OpenAPI document](https://skmtc.dev/alphakek-ai/apis/aikek-api/revisions/b6d96e7673dc?raw)
