Quote an exchange between two coins
package main
import ( "fmt" "strings" "net/http" "io")
func main() {
url := "https://api.feitpay.com/v1/conversions"
payload := strings.NewReader("{ \"from_asset\": \"example\", \"to_asset\": \"example\", \"amount\": \"59.90\" }")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("FeitPay-Environment", "test") 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(res) fmt.Println(string(body))
}const url = 'https://api.feitpay.com/v1/conversions';const options = { method: 'POST', headers: { 'FeitPay-Environment': 'test', Authorization: 'Bearer <token>', 'Content-Type': 'application/json' }, body: '{"from_asset":"example","to_asset":"example","amount":"59.90"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.feitpay.com/v1/conversions \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --header 'FeitPay-Environment: test' \ --data '{ "from_asset": "example", "to_asset": "example", "amount": "59.90" }'Live mode only, between assets listed in exchange_assets of GET /v1/wallet. Returns a quote (status: quoted) valid until quote_expires_at (about a minute): the estimated amount of to_asset, FeitPay’s exchange fee (fee_bps of the amount received) and the estimated net amount. Nothing is held until it is confirmed. The amount actually credited is what the exchange delivers minus the fee, so it can differ from the estimate.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Header Parameters
Section titled “Header Parameters”Active organization for dashboard sessions. Ignored for API keys (the key determines the organization).
test (default) or live for dashboard sessions. API keys determine the environment. Until the platform is in production, configuration (stores, webhook endpoints, payment links) is live and money movement answers payments_not_enabled.
Request Bodyrequired
Section titled “Request Bodyrequired”object
Amount of from_asset to exchange.
Responses
Section titled “Responses”The quote.
object
Quoted (not held; confirm before quote_expires_at) → processing (held, being exchanged) → finished (credited in to_asset). rejected: refused, the held amount is back. failed: the outcome is being checked by FeitPay, the amount stays held meanwhile. expired: a quote that was not confirmed in time.
Decimal string. Never a float.
Integer amount in the asset’s smallest unit.
The exchange’s estimate at quote time.
Decimal string. Never a float.
Decimal string. Never a float.
What the exchange delivered (finished).
FeitPay’s fee taken from received_amount (finished).
Received_amount − fee, credited in to_asset.
Example
{ "object": "conversion", "status": "quoted", "from_amount": "59.90", "from_amount_units": "99834", "estimated_to_amount": "59.90", "fee_rate": "1%", "estimated_fee": "59.90", "estimated_net_amount": "59.90", "failure_code": "processor_refused"}Missing or invalid credentials.
object
object
Stable machine-readable reason. Known values are listed in ErrorCode; clients localize by code and show message (English) only for a code they do not know. New codes may be added at any time.
Human-readable explanation in English.
Example
{ "error": { "type": "invalid_request_error" }}Authenticated but not permitted. Any route may also answer request_blocked when abuse protection has blocked the client IP for a while.
object
object
Stable machine-readable reason. Known values are listed in ErrorCode; clients localize by code and show message (English) only for a code they do not know. New codes may be added at any time.
Human-readable explanation in English.
Example
{ "error": { "type": "invalid_request_error" }}State conflict.
object
object
Stable machine-readable reason. Known values are listed in ErrorCode; clients localize by code and show message (English) only for a code they do not know. New codes may be added at any time.
Human-readable explanation in English.
Example
{ "error": { "type": "invalid_request_error" }}Validation failed.
object
object
Stable machine-readable reason. Known values are listed in ErrorCode; clients localize by code and show message (English) only for a code they do not know. New codes may be added at any time.
Human-readable explanation in English.
Example
{ "error": { "type": "invalid_request_error" }}Too many requests. See Retry-After.
object
object
Stable machine-readable reason. Known values are listed in ErrorCode; clients localize by code and show message (English) only for a code they do not know. New codes may be added at any time.
Human-readable explanation in English.
Example
{ "error": { "type": "invalid_request_error" }}