Skip to main content
POST
Create Buy Transaction

Body

application/json
encoded_user_defined_event_data
string
required

Arbitrary user-defined event data to include in the transaction for tracking purposes

Example:

""

payer
string
required

Public key of the account that will pay for the transaction

Example:

"GrX8TXKsPNokXKzfUg7tYmWs6MLhNseScc4PnzyiqpP7"

quote_response
object
required

The full quote response object from the Quote Buy endpoint. Pass the entire response without modification.

compute_unit_limit
integer | null
default:200000

Maximum compute units to use for the transaction

Required range: x >= 0
compute_unit_price
integer | null
default:40000000

Price per compute unit in micro-lamports

Required range: x >= 0
source
string | null

Public key of the token account to debit tokens from. If not provided, the payer's associated token account will be used.

Example:

"GrX8TXKsPNokXKzfUg7tYmWs6MLhNseScc4PnzyiqpP7"

Response

200 - application/json
tx
string
required

A Base64 encoded transaction that can be signed and submitted to the Solana network.

Example:

"BASE64_ENCODED_TRANSACTION"