# Fiat To Crypto

Operations for fiat to crypto conversions (on-ramp)

## Request on-ramp quote

> Generate a quote for converting fiat currency to cryptocurrency.\
> \
> \### Authentication\
> \
> All API requests to Orda require HMAC signatures using your project's client ID and client secret. The signature is a HMAC-SHA256 hash of the request body, using your Client Secret as the key.\
> \
> \#### Required Headers\
> \
> \| Header | Description |\
> \|--------|-------------|\
> \| \`x-client-id\` | Your project's client ID |\
> \| \`x-signature\` | HMAC-SHA256 signature derived from your client secret |\
> \| \`Content-Type\` | \`application/json\` for this request |\
> \
> \---\
> \
> \*\*Intent Specification:\*\*\
> The quote request uses an \`intent\` object to specify the amount calculation method:\
> \- \`fromAmount\`: Specify exact fiat amount to spend\
> \- \`toAmount\`: Specify exact crypto amount to receive\
> \- \`usd\`: Specify USD value for conversion\
> \
> \*\*Important Notes:\*\*\
> \- Currently supports BRL to BRZ conversions\
> \- Provide EITHER \`recipientId\` OR \`settlementDetails\` (not both)\
> \- If using \`recipientId\`, recipient must have crypto settlement details configured\
> \- If using \`settlementDetails\`, provide destination chain, token, and address inline\
> \- Quote includes PIX payment instructions for BRL\
> \- Quotes expire after 5-10 minutes (check \`expiresAt\` field)\
> \- Exchange rates include all fees<br>

```json
{"openapi":"3.0.3","info":{"title":"Orda API","version":"1.1.0"},"tags":[{"name":"Fiat-to-crypto","description":"Operations for fiat to crypto conversions (on-ramp)"}],"servers":[{"url":"https://api.orda.network/v1","description":"Default API path"}],"security":[{"ClientId":[],"Signature":[],"Timestamp":[]}],"components":{"securitySchemes":{"ClientId":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your project client ID from orda dashboard"}},"parameters":{"ClientIdHeader":{"name":"x-client-id","in":"header","required":true,"description":"Your project client ID from orda dashboard","schema":{"type":"string","default":"prj_abc123def456ghi789"}},"SignatureHeader":{"name":"x-signature","in":"header","required":true,"description":"HMAC-SHA256 signature of canonical request body using your client secret","schema":{"type":"string","default":"a1b2c3d4e5f6789abc123def456ghi789abc123def456"}},"TimestampHeader":{"name":"x-timestamp","in":"header","required":false,"description":"Unix timestamp in milliseconds for replay protection (recommended)","schema":{"type":"string","default":"1704067200000"}}},"schemas":{"Error":{"type":"object","properties":{"error":{"type":"string","description":"Error type identifier"},"message":{"type":"string","description":"Human-readable error message"},"correlationId":{"type":"string","description":"Request correlation ID for debugging"}}}}},"paths":{"/onramp/quote":{"post":{"summary":"Request on-ramp quote","description":"Generate a quote for converting fiat currency to cryptocurrency.\n\n### Authentication\n\nAll API requests to Orda require HMAC signatures using your project's client ID and client secret. The signature is a HMAC-SHA256 hash of the request body, using your Client Secret as the key.\n\n#### Required Headers\n\n| Header | Description |\n|--------|-------------|\n| `x-client-id` | Your project's client ID |\n| `x-signature` | HMAC-SHA256 signature derived from your client secret |\n| `Content-Type` | `application/json` for this request |\n\n---\n\n**Intent Specification:**\nThe quote request uses an `intent` object to specify the amount calculation method:\n- `fromAmount`: Specify exact fiat amount to spend\n- `toAmount`: Specify exact crypto amount to receive\n- `usd`: Specify USD value for conversion\n\n**Important Notes:**\n- Currently supports BRL to BRZ conversions\n- Provide EITHER `recipientId` OR `settlementDetails` (not both)\n- If using `recipientId`, recipient must have crypto settlement details configured\n- If using `settlementDetails`, provide destination chain, token, and address inline\n- Quote includes PIX payment instructions for BRL\n- Quotes expire after 5-10 minutes (check `expiresAt` field)\n- Exchange rates include all fees\n","tags":["Fiat-to-crypto"],"parameters":[{"$ref":"#/components/parameters/ClientIdHeader"},{"$ref":"#/components/parameters/SignatureHeader"},{"$ref":"#/components/parameters/TimestampHeader"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["fromCurrency","intent"],"properties":{"fromCurrency":{"type":"string","description":"Source fiat currency code (currently only \"BRL\" supported)","enum":["BRL","ARS","USD","EUR","NGN"]},"intent":{"type":"object","required":["method","value"],"properties":{"method":{"type":"string","enum":["fromAmount","toAmount","usd"],"description":"Quote calculation method:\n- `fromAmount`: Exact fiat amount to spend\n- `toAmount`: Exact crypto amount to receive\n- `usd`: USD value for conversion\n"},"value":{"type":"string","description":"Amount value for the specified method"}}},"recipientId":{"type":"string","description":"UUID of the recipient to receive cryptocurrency (provide either this OR settlementDetails)"},"settlementDetails":{"type":"object","description":"Inline crypto settlement details (provide either this OR recipientId)","properties":{"toChain":{"type":"string","description":"Destination blockchain chain ID"},"toToken":{"type":"string","description":"Destination token contract address (BRZ token)"},"toAddress":{"type":"string","description":"Destination wallet address"}}}}}}}},"responses":{"200":{"description":"On-ramp quote generated successfully","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"},"transactionId":{"type":"string"},"depositInstructions":{"type":"object","properties":{"method":{"type":"string","description":"Payment method (e.g., \"PIX\")"},"amount":{"type":"string","description":"Exact fiat amount to deposit"},"currency":{"type":"string","description":"Fiat currency code"},"pixQrCode":{"type":"string","description":"Base64-encoded PIX QR code (BRL only)"},"pixKey":{"type":"string","description":"PIX payment string (BRL only)"},"expiresAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp for quote expiration"},"referenceId":{"type":"string","description":"Reference ID for the deposit"}}},"quote":{"type":"object","properties":{"provider":{"type":"string","description":"Liquidity provider name"},"fromCurrency":{"type":"string","description":"Source fiat currency"},"toCrypto":{"type":"string","description":"Target cryptocurrency token address"},"fromAmount":{"type":"string","description":"Fiat amount"},"toAmount":{"type":"string","description":"Crypto amount to receive"},"toAddress":{"type":"string","description":"Recipient's wallet address"},"exchangeRate":{"type":"number","description":"Current exchange rate"},"estimatedDuration":{"type":"integer","description":"Estimated processing time in seconds"}}}}}}}},"400":{"description":"Bad Request - Invalid parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Unauthorized - Invalid authentication","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not Found - Recipient not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too Many Requests","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Bad Gateway - External service error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}}}
```

## Get on-ramp status

> Check the status of a fiat-to-crypto transaction.\
> \
> \### Authentication\
> \
> All API requests to Orda require HMAC signatures using your project's client ID and client secret. The signature is a HMAC-SHA256 hash of the request body (use \`"{}"\` for GET requests), using your Client Secret as the key.\
> \
> \#### Required Headers\
> \
> \| Header | Description |\
> \|--------|-------------|\
> \| \`x-client-id\` | Your project's client ID |\
> \| \`x-signature\` | HMAC-SHA256 signature derived from your client secret |\
> \
> \---\
> \
> \*\*Status Values:\*\*\
> \- \`In\_progress\`: Payment pending or being processed\
> \- \`Completed\`: Cryptocurrency successfully delivered\
> \- \`Failed\`: Payment failed or was rejected\
> \
> \*\*Deposit Status Values:\*\*\
> \- \`awaiting\`: Waiting for fiat deposit\
> \- \`received\`: Deposit received, processing\
> \- \`confirmed\`: Deposit confirmed, converting to crypto\
> \- \`completed\`: Crypto sent to wallet<br>

```json
{"openapi":"3.0.3","info":{"title":"Orda API","version":"1.1.0"},"tags":[{"name":"Fiat-to-crypto","description":"Operations for fiat to crypto conversions (on-ramp)"}],"servers":[{"url":"https://api.orda.network/v1","description":"Default API path"}],"security":[{"ClientId":[],"Signature":[],"Timestamp":[]}],"components":{"securitySchemes":{"ClientId":{"type":"apiKey","in":"header","name":"x-client-id","description":"Your project client ID from orda dashboard"}},"parameters":{"ClientIdHeader":{"name":"x-client-id","in":"header","required":true,"description":"Your project client ID from orda dashboard","schema":{"type":"string","default":"prj_abc123def456ghi789"}},"SignatureHeader":{"name":"x-signature","in":"header","required":true,"description":"HMAC-SHA256 signature of canonical request body using your client secret","schema":{"type":"string","default":"a1b2c3d4e5f6789abc123def456ghi789abc123def456"}},"TimestampHeader":{"name":"x-timestamp","in":"header","required":false,"description":"Unix timestamp in milliseconds for replay protection (recommended)","schema":{"type":"string","default":"1704067200000"}}},"schemas":{"Error":{"type":"object","properties":{"error":{"type":"string","description":"Error type identifier"},"message":{"type":"string","description":"Human-readable error message"},"correlationId":{"type":"string","description":"Request correlation ID for debugging"}}}}},"paths":{"/onramp/status":{"get":{"summary":"Get on-ramp status","description":"Check the status of a fiat-to-crypto transaction.\n\n### Authentication\n\nAll API requests to Orda require HMAC signatures using your project's client ID and client secret. The signature is a HMAC-SHA256 hash of the request body (use `\"{}\"` for GET requests), using your Client Secret as the key.\n\n#### Required Headers\n\n| Header | Description |\n|--------|-------------|\n| `x-client-id` | Your project's client ID |\n| `x-signature` | HMAC-SHA256 signature derived from your client secret |\n\n---\n\n**Status Values:**\n- `In_progress`: Payment pending or being processed\n- `Completed`: Cryptocurrency successfully delivered\n- `Failed`: Payment failed or was rejected\n\n**Deposit Status Values:**\n- `awaiting`: Waiting for fiat deposit\n- `received`: Deposit received, processing\n- `confirmed`: Deposit confirmed, converting to crypto\n- `completed`: Crypto sent to wallet\n","tags":["Fiat-to-crypto"],"parameters":[{"$ref":"#/components/parameters/ClientIdHeader"},{"$ref":"#/components/parameters/SignatureHeader"},{"$ref":"#/components/parameters/TimestampHeader"},{"name":"transactionId","in":"query","description":"UUID of the transaction to check","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Transaction status retrieved successfully","content":{"application/json":{"schema":{"type":"object","properties":{"transactionId":{"type":"string","description":"Unique transaction identifier"},"status":{"type":"string","enum":["In_progress","Completed","Failed"],"description":"Current transaction status"},"type":{"type":"string","description":"Transaction type (always \"FIAT_TO_CRYPTO\")"},"fromCurrency":{"type":"string","description":"Source fiat currency"},"toCrypto":{"type":"string","description":"Target cryptocurrency token address"},"toChain":{"type":"string","description":"Destination blockchain ID"},"fiatAmount":{"type":"string","description":"Amount of fiat currency deposited"},"cryptoAmount":{"type":"string","description":"Amount of cryptocurrency to receive"},"settlementAddress":{"type":"string","description":"Recipient's wallet address"},"depositMethod":{"type":"string","description":"Payment method used (e.g., \"PIX\")"},"depositStatus":{"type":"string","enum":["awaiting","received","confirmed","completed"],"description":"Status of fiat deposit"},"transferoOrderId":{"type":"string","description":"Provider's order identifier"},"transferoReferenceId":{"type":"string","description":"Provider's reference ID"},"createdAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp of transaction creation"},"updatedAt":{"type":"string","format":"date-time","description":"ISO 8601 timestamp of last update"}}}}}},"400":{"description":"Bad Request - Invalid parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Unauthorized - Invalid authentication","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not Found - Transaction not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too Many Requests","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}}}
```
