Skip to main content

Swap Endpoint

The swap endpoint handles the execution of verified swap requests. When a user accepts a quote, Jupiter sends the swap request to your webhook with a prepared transaction that you must verify, sign, and submit to the Solana network.

Endpoint Details

Method: POST
Path: /swap
Full URL: {baseUrl}/swap
Timeout: 25 seconds maximum response time

Request Format

Headers

POST /jupiter/rfq/swap HTTP/1.1
Host: your-api-endpoint.com
Content-Type: application/json
X-API-KEY: your-api-key (if configured)

Request Body

{
"request_id": "629bddf3-0038-43a6-8956-f5433d6b1191",
"quote_id": "59db3e19-c7b0-4753-a8aa-206701004498",
"transaction": "base64-encoded-transaction-data"
}

Request Parameters

ParameterTypeRequiredDescription
request_idstringYesUnique identifier for the request
quote_idstringYesUnique identifier for the quote
transactionstringYesBase64-encoded transaction data

Response Format

Success Response (200 OK)

{
"quote_id": "59db3e19-c7b0-4753-a8aa-206701004498",
"state": "accepted",
"tx_signature": "base64-encoded-transaction-signature",
"rejection_reason": null
}

Response Parameters

ParameterTypeRequiredDescription
quote_idstringYesEcho of the quote ID
statestringYes"accepted" or "rejected"
tx_signaturestringYesBase64-encoded transaction signature
rejection_reasonstringNoReason for rejection, if applicable

Next: Testing - Learn how to test your webhook implementation