Skip to main content
POST
/
v1
/
transactions
/
build
curl --request POST \
  --url https://api.bookie.app/v1/transactions/build \
  --header 'Authorization: Bearer bookie_live_abc123def456' \
  --header 'Content-Type: application/json' \
  --data '{
    "intentId": "intent_abc123def456",
    "walletAddress": "7xKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsU",
    "simulate": true
  }'
{
  "transaction": "AQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAQAHEAoMCg...",
  "simulation": {
    "success": true,
    "computeUnits": 185432,
    "logs": [
      "Program JUP6LkbZbjS1jKKwapdH673ZbPzwpKeZ9wH2TUXzQf4 invoke [1]",
      "Program log: Instruction: Swap",
      "Program JUP6LkbZbjS1jKKwapdH673ZbPzwpKeZ9wH2TUXzQf4 success"
    ]
  },
  "expectedOutput": {
    "outputAmount": "736250000",
    "priceImpact": 0.12,
    "fee": 5000
  }
}

Authorization

Authorization
string
required
Bearer token. Format: Bearer bookie_live_abc123def456

Body Parameters

intentId
string
required
Intent ID from parse intent endpoint
walletAddress
string
required
Solana wallet address that will sign the transaction
simulate
boolean
default:"true"
Run pre-flight simulation before building

Response

transaction
string
Base64 encoded serialized transaction
simulation
object
Simulation results (if enabled)Properties:
  • success (boolean): Whether simulation passed
  • computeUnits (number): Compute units consumed
  • logs (array): Program execution logs
expectedOutput
object
Expected transaction outcomeProperties:
  • outputAmount (string): Expected output amount
  • priceImpact (number): Price impact percentage
  • fee (number): Transaction fee in lamports
curl --request POST \
  --url https://api.bookie.app/v1/transactions/build \
  --header 'Authorization: Bearer bookie_live_abc123def456' \
  --header 'Content-Type: application/json' \
  --data '{
    "intentId": "intent_abc123def456",
    "walletAddress": "7xKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsU",
    "simulate": true
  }'
{
  "transaction": "AQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAQAHEAoMCg...",
  "simulation": {
    "success": true,
    "computeUnits": 185432,
    "logs": [
      "Program JUP6LkbZbjS1jKKwapdH673ZbPzwpKeZ9wH2TUXzQf4 invoke [1]",
      "Program log: Instruction: Swap",
      "Program JUP6LkbZbjS1jKKwapdH673ZbPzwpKeZ9wH2TUXzQf4 success"
    ]
  },
  "expectedOutput": {
    "outputAmount": "736250000",
    "priceImpact": 0.12,
    "fee": 5000
  }
}
Always simulate transactions before presenting them to users. Failed simulations indicate the transaction would fail on-chain.