Exchange rates
Get exchange rate quote
Generate a time-limited exchange rate quote with fee breakdown for currency conversion. These quotes are designed to be used with transaction endpoints.
AuthorizationBearer <token>
In: header
chainstring
Blockchain network associated with the cryptocurrency in this exchange. This should match the chain of the currency that is a crypto asset (e.g., USDC or USDT), whether it is the source or destination currency.
Value in
"ETHEREUM" | "POLYGON" | "BASE" | "ARBITRUM"sourceCurrencystring
Source currency code
Value in
"USDT" | "USDC" | "BRL"customerIdstring
Customer UUID
Format
uuidsourceAmountstring
Source amount as string, will be truncated to 2 decimal places
destinationCurrencystring
Destination currency code
Value in
"USDT" | "USDC" | "BRL"lockDurationstring
Duration for which the exchange rate quote will be locked
Value in
"30s" | "1m" | "5m"Response Body
curl -X POST "https://api.sandbox.sdigital2.com/v1/exchange-rates" \ -H "Content-Type: application/json" \ -d '{ "chain": "ETHEREUM", "sourceCurrency": "BRL", "customerId": "3190d115-987f-402f-b558-0316d3a22ebd", "sourceAmount": "60000.00", "destinationCurrency": "USDC", "lockDuration": "1m" }'{
"id": "3190d115-987f-402f-b558-0316d3a22ebd",
"sourceCurrency": "BRL",
"sourceAmount": "100.50",
"destinationCurrency": "USDC",
"destinationAmount": "100.50",
"grossDestinationAmount": "100.50",
"baseExchangeRate": "1.00",
"appliedExchangeRate": "1.00",
"fees": {
"bps": "10",
"flatAmount": "1",
"totalAmount": "11",
"currency": "USDC"
},
"expiresAt": "2026-05-05T00:00:00Z"
}{
"status": 401,
"title": "Unauthorized",
"detail": "Authentication credentials are missing or invalid",
"code": "UNAUTHORIZED",
"instance": "/api/v1/transactions",
"correlationId": "2065cb12-a9fe-42f9-8c75-d63257b3844a"
}{
"status": 403,
"title": "Forbidden",
"detail": "You do not have permission to access this resource",
"code": "FORBIDDEN",
"instance": "/api/v1/transactions",
"correlationId": "2065cb12-a9fe-42f9-8c75-d63257b3844a"
}{
"status": 404,
"title": "Not Found",
"detail": "The requested resource could not be found",
"code": "RESOURCE_NOT_FOUND",
"instance": "/api/v1/transactions/f133bef1-226c-458a-b6d9-8312edb8d77a",
"correlationId": "2065cb12-a9fe-42f9-8c75-d63257b3844a"
}{
"status": 422,
"title": "Validation Error",
"detail": "The request contains invalid data",
"code": "VALIDATION_ERROR",
"instance": "/api/v1/transactions",
"correlationId": "2065cb12-a9fe-42f9-8c75-d63257b3844a",
"errors": [
{
"detail": "sourceAmount must be a positive number",
"pointer": "/sourceAmount"
},
{
"detail": "destination.currency is required when providing sourceAmount",
"pointer": "/destination/currency"
}
]
}{
"status": 500,
"title": "Internal Server Error",
"detail": "An unexpected error occurred while processing your request",
"code": "INTERNAL_SERVER_ERROR",
"instance": "/api/v1/transactions",
"correlationId": "2065cb12-a9fe-42f9-8c75-d63257b3844a"
}