Create a buy order
curl --request POST \
--url https://b2b-api-sandbox.easyonramp.com/api/v1/business/trading/buy \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"amount": 100000
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({amount: 100000})
};
fetch('https://b2b-api-sandbox.easyonramp.com/api/v1/business/trading/buy', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://b2b-api-sandbox.easyonramp.com/api/v1/business/trading/buy"
payload = { "amount": 100000 }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://b2b-api-sandbox.easyonramp.com/api/v1/business/trading/buy"
payload := strings.NewReader("{\n \"amount\": 100000\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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))
}{
"pay": "ZAR",
"receive": "USDC",
"payAmount": 100000,
"receiveAmount": 5432,
"price": 0.00005432,
"expiresAt": "2026-07-09T10:00:30.000Z",
"id": "550e8400-e29b-41d4-a716-446655440099",
"createdAt": "2026-07-09T10:00:00.000Z"
}Trading
Create a buy order
Convert fiat to crypto at the quoted rate. Debits pay currency and credits receive currency immediately. Returns trade details (no status field). Emits trade.approved.
POST
/
api
/
v1
/
business
/
trading
/
buy
Create a buy order
curl --request POST \
--url https://b2b-api-sandbox.easyonramp.com/api/v1/business/trading/buy \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"amount": 100000
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({amount: 100000})
};
fetch('https://b2b-api-sandbox.easyonramp.com/api/v1/business/trading/buy', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://b2b-api-sandbox.easyonramp.com/api/v1/business/trading/buy"
payload = { "amount": 100000 }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://b2b-api-sandbox.easyonramp.com/api/v1/business/trading/buy"
payload := strings.NewReader("{\n \"amount\": 100000\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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))
}{
"pay": "ZAR",
"receive": "USDC",
"payAmount": 100000,
"receiveAmount": 5432,
"price": 0.00005432,
"expiresAt": "2026-07-09T10:00:30.000Z",
"id": "550e8400-e29b-41d4-a716-446655440099",
"createdAt": "2026-07-09T10:00:00.000Z"
}Authorizations
Bearer JWT issued to your business account during onboarding
Body
application/json
Response
201 - application/json
Example:
"ZAR"
Example:
"USDC"
Pay amount in minor units (cents)
Example:
100000
Receive amount in minor units after fees
Example:
5432
Conversion rate (receive per 1 pay unit)
Example:
0.00005432
Example:
"2026-07-09T10:00:30.000Z"
Example:
"550e8400-e29b-41d4-a716-446655440099"
Example:
"2026-07-09T10:00:00.000Z"