Quotes
2 operations under quotes. Examples read $API and $KEY from your shell.
POST /v1/quotes
Send an Idempotency-Key header on every POST so a retry never repeats the request.
Request body
application/json, required
object
sourceobject requiredassetstring required
destinationobject requiredassetstring required
source_amountdecimal string optionaldestination_amountdecimal string optional
Responses
201 Default Response
object
idstring requiredobjectstring required one ofquotestatusstring required one ofopen,accepted,expiredsourceobject requiredassetstring requiredamountdecimal string required
destinationobject requiredassetstring requiredamountdecimal string required
ratestring requiredspread_bpsinteger requiredexpires_atstring requiredtransfer_idstring required (nullable)created_atstring required
Errors are RFC 9457 problem documents (application/problem+json).
curl
curl -s \
-X POST \
"$API/v1/quotes" \
-H "authorization: Bearer $KEY" \
-H "idempotency-key: $(uuidgen)" \
-H "content-type: application/json" \
-d '{"source":{"asset":"<asset>"},"destination":{"asset":"<asset>"}}'SDK
import { createScrClient } from "@scr/sdk";
// The client sends the API key and an Idempotency-Key for you.
const client = createScrClient({ baseUrl: process.env.API!, apiKey: process.env.KEY! });
const { data, error } = await client.POST("/v1/quotes", {
body: {
"source": {
"asset": "<asset>"
},
"destination": {
"asset": "<asset>"
}
},
});GET /v1/quotes/{id}
Parameters
idstring required in path
Responses
200 Default Response
object
idstring requiredobjectstring required one ofquotestatusstring required one ofopen,accepted,expiredsourceobject requiredassetstring requiredamountdecimal string required
destinationobject requiredassetstring requiredamountdecimal string required
ratestring requiredspread_bpsinteger requiredexpires_atstring requiredtransfer_idstring required (nullable)created_atstring required
Errors are RFC 9457 problem documents (application/problem+json).
curl
curl -s \
"$API/v1/quotes/$ID" \
-H "authorization: Bearer $KEY"SDK
import { createScrClient } from "@scr/sdk";
// The client sends the API key for you.
const client = createScrClient({ baseUrl: process.env.API!, apiKey: process.env.KEY! });
const { data, error } = await client.GET("/v1/quotes/{id}", {
params: { path: { id: "<id>" } },
});