Create Quote - (Crypto)
This endpoint generates a quote for converting one cryptocurrency to another.
Endpoint
POST
{{baseURL}}/v1/ramp/quote
Headers
Header | Value | Required | Description |
---|---|---|---|
Content-Type | application/json | Yes | Specifies that the request body is JSON. |
x-api-key | YOUR_API_KEY | Yes | API key for authentication. |
Request Body
{
"source": {
"amount": 5000,
"symbol": "POL",
"blockchain": "MATIC"
},
"target": {
"symbol": "POL",
"blockchain": "MATIC"
},
"feeLevel": {
"type": "MEDIUM"
},
"recipient": {
"address": "0xa0b86991c6218b36c1d1xxxxxxxxxxxxxxxx"
}
}
### Request Breakdown
| **Field** | **Type** | **Description** |
|-----------------------------|---------|------------------------------------------------------------------------------|
| `source.amount` | number | Amount of the source cryptocurrency to convert |
| `source.symbol` | string | Symbol of the source cryptocurrency (e.g., `"POL"`) |
| `source.blockchain` | string | Blockchain network of the source cryptocurrency (e.g., `"MATIC"`) |
| `target.symbol` | string | Symbol of the target cryptocurrency |
| `target.blockchain` | string | Blockchain network of the target cryptocurrency |
| `feeLevel.type` | string | Transaction fee level (`"LOW"`, `"MEDIUM"`, `"HIGH"`) |
| `recipient.address` | string | Wallet address of the recipient where the crypto will be sent |
---
## Success Response 200 OK
```json
{
"message": "quote successfully created",
"status": "success",
"data": {
"id": "92da6ea0-79fe-4000-971d-c481ed495a6a",
"source": {
"currency": "Polygon",
"symbol": "POL",
"addressRegex": "^(0x)[0-9A-Fa-f]{40}$",
"amount": 0.12,
"blockchain": "MATIC",
"type": "CRYPTOCURRENCY"
},
"target": {
"currency": "Polygon",
"symbol": "POL",
"addressRegex": "^(0x)[0-9A-Fa-f]{40}$",
"amount": 0.12,
"blockchain": "MATIC",
"type": "CRYPTOCURRENCY"
},
"rate": 0.00102300,
"fees": {
"symbol": "POL",
"amount": 0.00,
"gas": {
"type": "MEDIUM",
"amount": 0.01909123
}
},
"rules": [
{
"category": "LIMIT",
"appliedCurrency": "USDC",
"transaction": {
"minimum": 10.00,
"maximum": 2000000.00
},
"invoice": 2000000.00
}
],
"summary": {
"total": 0.12
}
}
}
Response Breakdown
Field | Type | Description |
---|---|---|
message | string | Status message (e.g., "quote successfully created" ) |
status | string | Status of the request (e.g., "success" ) |
data.id | string | Unique identifier of the created quote |
data.source | object | Details of the source cryptocurrency |
data.source.currency | string | Name of the source currency (e.g., "Polygon" ) |
data.source.symbol | string | Symbol of the source cryptocurrency (e.g., "POL" ) |
data.source.addressRegex | string | Regular expression pattern for validating crypto addresses |
data.source.amount | number | Amount of source cryptocurrency converted |
data.source.blockchain | string | Blockchain network (e.g., "MATIC" ) |
data.source.type | string | Type of the asset ("CRYPTOCURRENCY" ) |
data.target | object | Details of the target cryptocurrency |
data.target.currency | string | Name of the target currency (e.g., "Polygon" ) |
data.target.symbol | string | Symbol of the target cryptocurrency (e.g., "POL" ) |
data.target.addressRegex | string | Regular expression pattern for validating target crypto addresses |
data.target.amount | number | Amount of target cryptocurrency received |
data.target.blockchain | string | Blockchain network of the target currency |
data.target.type | string | Type of the asset ("CRYPTOCURRENCY" ) |
data.rate | number | Exchange rate between the source and target currency |
data.fees | object | Fee breakdown for the transaction |
data.fees.symbol | string | Currency symbol for fees |
data.fees.amount | number | Fee amount charged |
data.fees.gas | object | Gas fee details |
data.fees.gas.type | string | Gas fee level ("MEDIUM" ) |
data.fees.gas.amount | number | Gas fee amount |
data.rules | array | Rules that apply to this transaction |
data.rules[].category | string | Rule category (e.g., "LIMIT" ) |
data.rules[].appliedCurrency | string | Currency to which the rule applies (e.g., "USDC" ) |
data.rules[].transaction | object | Transaction limits |
data.rules[].transaction.minimum | number | Minimum amount allowed for the transaction |
data.rules[].transaction.maximum | number | Maximum amount allowed for the transaction |
data.rules[].invoice | number | Maximum invoice amount |
data.summary | object | Summary of the transaction |
data.summary.total | number | Total amount of the source currency involved in the transaction |
Error Responses
HTTP Status | Error Code | Message | Description |
---|---|---|---|
400 | INVALID_INPUT | Invalid request payload | One or more fields are missing or have invalid values. |
401 | UNAUTHORIZED | Missing or invalid API key | The x-api-key header is missing or incorrect. |
403 | FORBIDDEN | Access denied | The authenticated user is not allowed to create quotes. |
404 | NOT_FOUND | Resource not found | The requested network or currency does not exist. |
500 | SERVER_ERROR | Internal server error | An unexpected error occurred on the server. |