createOrder
POSThttps://api.jup.ag/trigger/v1/createOrder
Request for a base64-encoded unsigned trigger order creation transaction to be used in POST /trigger/v1/execute
note
- Refer to Trigger API doc for more information
Request
- application/json
Body
- A token account (via the Referral Program) that will receive the fees
- Refer to Referral Program Github for more information
inputMintstringrequired
outputMintstringrequired
makerstringrequired
payerstringrequired
params objectrequired
computeUnitPricestring
In microlamports, defaults to 95th percentile of priority fees
Default value:
auto
feeAccountstring
wrapAndUnwrapSolboolean
If either input or output mint is native SOL
Default value:
true
Responses
- 200
- 400
- 500
Returns the base64-encoded unsigned transaction from the provided request body.
- application/json
- Schema
- Example (auto)
Schema
requestIdstringrequired
Required to make a request to /execute
transactionstringrequired
Unsigned base-64 encoded transaction
orderstring
Base-58 account which is the Trigger Order account
{
"requestId": "f7d5dd40-a416-4dae-8367-7dc10cab6554",
"transaction": "AQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAkOCWPK8t5w2W1nIsonBw2T/TCNCKkrgBQia9/YVlLEcjM9zTXA2aZIqK0k40U/eCZ0Zu1176lxIuHLsY6UyQjTdash6wigo20Auc3RVYRWME9FjnpbdgdRKYjLJLe0lVi47IZO5XCZ/U0AirZsOIWLoumtNiLomxcYL6d2R2rSxzkNgnQl2IV0spQPT+7K7zraa8oytEZyZ4HSFpxmV2v3WgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEImJzcxhjwZ2dKxnfimarbEo/iDZzNgo5QjJ8b+bMOuSf2yH7EMQBZfZLsgOHg/C5SyLv/x1D4MHZgRX7jOy4YyXJY9OJInxuz0QKRSODYMLWhOZ2v8QhASOe9jb6fhZAwZGb+UhFzL/7K26csOb57yM5bvF9xJrLEObOkAAAADG+nrzvtutOj1l82qryXQxsbvkwtL24OR8pgIDRS9dYQrDSpbBZnFaYMEjPsolig3zCx7IWOB0XHNqEmJmY0siBpuIV/6rgYT7aH9jRhjANdrEOdwa6ztVmKDwAAAAAAEG3fbh12Whk9nL4UbO63msHLSF7V9bN5E6jPWFfv8AqXeleaIpvDk6bHUITYxyjNU3ParFA70LbecfV6NupbbBCAkABQKgAwIACQAJAy48AAAAAAAACAYABAAMBQ0BAQUCAAQMAgAAAIDw+gIAAAAADQEEAREIBgABAAoFDQEBCw8AAAIDBAYLDAoNDQUIBwsihW5Kr3Cf9Z9OyUY1qj0LZYDw+gIAAAAAAOH1BQAAAAAAAA0DBAAAAQk=\n",
"order": "CX2iPk4nxarGPkk7ziViJTfL1z2e1LnGWRDimVQ4tzYf"
}
Bad request body
- application/json
- Schema
- Example (auto)
Schema
errorstringrequired
codenumberrequired
causestring
signaturestring
Signature of the transaction, if generated
Example:
38CtpugRBobyj1JMkHj9umQyj1D8q6bs1jcMRcw7Fiyp4BXv4uh4bD4TyJs6fsqYCDDfQpeRewA7HjLA1Eprc8uR
statusstring
Possible values: [Failed
]
{
"error": "invalid create order request",
"cause": "input mint making amount must be at least 5 USD, received: 1",
"code": 400
}
Internal error
- application/json
- Schema
- Example (auto)
Schema
errorstringrequired
codenumberrequired
causestring
signaturestring
Signature of the transaction, if generated
Example:
38CtpugRBobyj1JMkHj9umQyj1D8q6bs1jcMRcw7Fiyp4BXv4uh4bD4TyJs6fsqYCDDfQpeRewA7HjLA1Eprc8uR
statusstring
Possible values: [Failed
]
{
"error": "unable to get latest blockhash",
"code": 500
}
- curl
- nodejs
- python
- rust
- CURL
curl -L 'https://api.jup.ag/trigger/v1/createOrder' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-d '{
"maker": "jdocuPgEAjMfihABsPgKEvYtsmMzjUHeq9LX4Hvs7f3",
"payer": "jdocuPgEAjMfihABsPgKEvYtsmMzjUHeq9LX4Hvs7f3",
"inputMint": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
"outputMint": "So11111111111111111111111111111111111111112",
"params": {
"makingAmount": "100000000",
"takingAmount": "50000000"
},
"computeUnitPrice": "auto"
}'
ResponseClear