Create Order
curl --request POST \
--url https://api.chessa.ai/v1/orders \
--header 'Content-Type: application/json' \
--data '
{
"chain": "Solana",
"destinationAsset": "NGN",
"originAmount": 10,
"originAsset": "USDC",
"recipientId": "cd9bcac5-5710-4e6c-ba15-63b8fb7b44e3"
}
'import requests
url = "https://api.chessa.ai/v1/orders"
payload = {
"chain": "Solana",
"destinationAsset": "NGN",
"originAmount": 10,
"originAsset": "USDC",
"recipientId": "cd9bcac5-5710-4e6c-ba15-63b8fb7b44e3"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
chain: 'Solana',
destinationAsset: 'NGN',
originAmount: 10,
originAsset: 'USDC',
recipientId: 'cd9bcac5-5710-4e6c-ba15-63b8fb7b44e3'
})
};
fetch('https://api.chessa.ai/v1/orders', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.chessa.ai/v1/orders",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'chain' => 'Solana',
'destinationAsset' => 'NGN',
'originAmount' => 10,
'originAsset' => 'USDC',
'recipientId' => 'cd9bcac5-5710-4e6c-ba15-63b8fb7b44e3'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.chessa.ai/v1/orders"
payload := strings.NewReader("{\n \"chain\": \"Solana\",\n \"destinationAsset\": \"NGN\",\n \"originAmount\": 10,\n \"originAsset\": \"USDC\",\n \"recipientId\": \"cd9bcac5-5710-4e6c-ba15-63b8fb7b44e3\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.chessa.ai/v1/orders")
.header("Content-Type", "application/json")
.body("{\n \"chain\": \"Solana\",\n \"destinationAsset\": \"NGN\",\n \"originAmount\": 10,\n \"originAsset\": \"USDC\",\n \"recipientId\": \"cd9bcac5-5710-4e6c-ba15-63b8fb7b44e3\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.chessa.ai/v1/orders")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"chain\": \"Solana\",\n \"destinationAsset\": \"NGN\",\n \"originAmount\": 10,\n \"originAsset\": \"USDC\",\n \"recipientId\": \"cd9bcac5-5710-4e6c-ba15-63b8fb7b44e3\"\n}"
response = http.request(request)
puts response.read_body{
"order": {
"createdAt": "2025-03-18T06:05:27.754Z",
"cryptoAddress": null,
"cryptoAddressChain": "Solana",
"cryptoAddressId": null,
"cryptoAddressTag": null,
"cryptoDepositId": null,
"destinationAmount": "1500",
"destinationAsset": "NGN",
"destinationCountry": "NG",
"expiresAt": "2025-03-18T08:05:27.751Z",
"feeAmount": "0.00000000",
"feeCurrency": "USDC",
"feeUsd": "0.00000000",
"id": "b647214f-3c33-4027-986b-3a46f041e800",
"note": null,
"originAmount": "0.95",
"originAsset": "USDC",
"partnerId": "4646e61e-33cf-452b-8bba-c138b78a57f0",
"recipientId": "f12b990c-d4dc-4dc7-8b42-cbaa90308820",
"refundAddress": null,
"senderConfirmedAt": null,
"shortId": "N3LBXEUI",
"status": "created",
"updatedAt": "2025-03-18T06:05:27.754Z",
"userId": "02e31a45-9474-4858-a833-06e89e494003"
}
}{
"error": "validation_error",
"message": "Invalid crypto asset",
"statusCode": 400
}{
"error": "not_found",
"message": "Recipient not found",
"statusCode": 404
}Orders
Create Order
Create a new order for crypto to fiat exchange.
When creating the order, you can specify either the exact origin Asset / originAmount, or the exact destinationAsset / destinationAmount but not both.
Once an order is created, you then confirm you accept the order quote by calling the prepare order funding endpoint with that orderId.
POST
/
v1
/
orders
Create Order
curl --request POST \
--url https://api.chessa.ai/v1/orders \
--header 'Content-Type: application/json' \
--data '
{
"chain": "Solana",
"destinationAsset": "NGN",
"originAmount": 10,
"originAsset": "USDC",
"recipientId": "cd9bcac5-5710-4e6c-ba15-63b8fb7b44e3"
}
'import requests
url = "https://api.chessa.ai/v1/orders"
payload = {
"chain": "Solana",
"destinationAsset": "NGN",
"originAmount": 10,
"originAsset": "USDC",
"recipientId": "cd9bcac5-5710-4e6c-ba15-63b8fb7b44e3"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
chain: 'Solana',
destinationAsset: 'NGN',
originAmount: 10,
originAsset: 'USDC',
recipientId: 'cd9bcac5-5710-4e6c-ba15-63b8fb7b44e3'
})
};
fetch('https://api.chessa.ai/v1/orders', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.chessa.ai/v1/orders",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'chain' => 'Solana',
'destinationAsset' => 'NGN',
'originAmount' => 10,
'originAsset' => 'USDC',
'recipientId' => 'cd9bcac5-5710-4e6c-ba15-63b8fb7b44e3'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.chessa.ai/v1/orders"
payload := strings.NewReader("{\n \"chain\": \"Solana\",\n \"destinationAsset\": \"NGN\",\n \"originAmount\": 10,\n \"originAsset\": \"USDC\",\n \"recipientId\": \"cd9bcac5-5710-4e6c-ba15-63b8fb7b44e3\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.chessa.ai/v1/orders")
.header("Content-Type", "application/json")
.body("{\n \"chain\": \"Solana\",\n \"destinationAsset\": \"NGN\",\n \"originAmount\": 10,\n \"originAsset\": \"USDC\",\n \"recipientId\": \"cd9bcac5-5710-4e6c-ba15-63b8fb7b44e3\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.chessa.ai/v1/orders")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"chain\": \"Solana\",\n \"destinationAsset\": \"NGN\",\n \"originAmount\": 10,\n \"originAsset\": \"USDC\",\n \"recipientId\": \"cd9bcac5-5710-4e6c-ba15-63b8fb7b44e3\"\n}"
response = http.request(request)
puts response.read_body{
"order": {
"createdAt": "2025-03-18T06:05:27.754Z",
"cryptoAddress": null,
"cryptoAddressChain": "Solana",
"cryptoAddressId": null,
"cryptoAddressTag": null,
"cryptoDepositId": null,
"destinationAmount": "1500",
"destinationAsset": "NGN",
"destinationCountry": "NG",
"expiresAt": "2025-03-18T08:05:27.751Z",
"feeAmount": "0.00000000",
"feeCurrency": "USDC",
"feeUsd": "0.00000000",
"id": "b647214f-3c33-4027-986b-3a46f041e800",
"note": null,
"originAmount": "0.95",
"originAsset": "USDC",
"partnerId": "4646e61e-33cf-452b-8bba-c138b78a57f0",
"recipientId": "f12b990c-d4dc-4dc7-8b42-cbaa90308820",
"refundAddress": null,
"senderConfirmedAt": null,
"shortId": "N3LBXEUI",
"status": "created",
"updatedAt": "2025-03-18T06:05:27.754Z",
"userId": "02e31a45-9474-4858-a833-06e89e494003"
}
}{
"error": "validation_error",
"message": "Invalid crypto asset",
"statusCode": 400
}{
"error": "not_found",
"message": "Recipient not found",
"statusCode": 404
}Body
application/json
Response
Success Response
Show child attributes
Show child attributes
Was this page helpful?