> ## Documentation Index
> Fetch the complete documentation index at: https://developer.me-cash.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Create Quote (Crypto)

> Generate a quote for converting one cryptocurrency to another

<Warning>
  🚧 **The Ramp API is currently under construction.** Endpoints and features described here are subject to change. Do not use in production until this notice is removed.
</Warning>

<Tip>
  **New to the Ramp API?** Read [How meCash Ramp Works](/ramp-docs/about-ramp) for the full lifecycle, both transaction flows, and integration considerations. See [Supported Assets & Destinations](/ramp-docs/supported-assets) for the complete token and network reference.
</Tip>

## 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 Example

<CodeGroup>
  ```bash cURL theme={null}
  curl --location '{{baseURL}}/v1/ramp/quote' \
  --header 'x-api-key: YOUR_API_KEY' \
  --header 'Content-Type: application/json' \
  --data '{
      "source": {
          "amount": 5000,
          "symbol": "POL",
          "blockchain": "MATIC"
      },
      "target": {
          "symbol": "POL",
          "blockchain": "MATIC"
      },
      "feeLevel": {
          "type": "MEDIUM"
      },
      "recipient": {
          "address": "0xa0b86991c6218b36c1d1xxxxxxxxxxxxxxxx"
      }
  }'
  ```

  ```js JavaScript (fetch) theme={null}
  const quoteDetails = {
    source: {
      amount: 5000,
      symbol: "POL",
      blockchain: "MATIC"
    },
    target: {
      symbol: "POL",
      blockchain: "MATIC"
    },
    feeLevel: {
      type: "MEDIUM"
    },
    recipient: {
      address: "0xa0b86991c6218b36c1d1xxxxxxxxxxxxxxxx"
    }
  };

  fetch('{{baseURL}}/v1/ramp/quote', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
      'x-api-key': 'YOUR_API_KEY'
    },
    body: JSON.stringify(quoteDetails)
  })
  .then(res => res.json())
  .then(console.log)
  .catch(console.error);
  ```

  ```python Python (requests) theme={null}
  import requests

  url = "{{baseURL}}/v1/ramp/quote"

  payload = {
      "source": {
          "amount": 5000,
          "symbol": "POL",
          "blockchain": "MATIC"
      },
      "target": {
          "symbol": "POL",
          "blockchain": "MATIC"
      },
      "feeLevel": {
          "type": "MEDIUM"
      },
      "recipient": {
          "address": "0xa0b86991c6218b36c1d1xxxxxxxxxxxxxxxx"
      }
  }

  headers = {
      "x-api-key": "YOUR_API_KEY",
      "Content-Type": "application/json"
  }

  response = requests.post(url, json=payload, headers=headers)
  print(response.json())
  ```

  ```js Node.js (axios) theme={null}
  const axios = require('axios');

  const quoteDetails = {
    source: {
      amount: 5000,
      symbol: 'POL',
      blockchain: 'MATIC'
    },
    target: {
      symbol: 'POL',
      blockchain: 'MATIC'
    },
    feeLevel: {
      type: 'MEDIUM'
    },
    recipient: {
      address: '0xa0b86991c6218b36c1d1xxxxxxxxxxxxxxxx'
    }
  };

  axios.post('{{baseURL}}/v1/ramp/quote', quoteDetails, {
    headers: {
      'x-api-key': 'YOUR_API_KEY',
      'Content-Type': 'application/json'
    }
  })
    .then((response) => {
      console.log(response.data);
    })
    .catch((error) => {
      console.error(error.response?.data ?? error.message);
    });
  ```
</CodeGroup>

### 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 theme={null}
{
  "message": "quote successfully created",
  "status": "success",
  "data": {
    "id": "92da6ea0-79fe-4000-971d-xxxxxxxxxxxxx",
    "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.             |


## OpenAPI

````yaml post /v1/ramp/quote
openapi: 3.0.3
info:
  title: meCash API
  version: 3.0.3
  description: >-
    API for meCash services, including FIAT and Ramp operations. This is the
    OpenAPI specification for the meCash API, covering all available endpoints
    for wallet management, currency quotes, and payouts.


    It follows a design-first approach based on OpenAPI 3.0.


    Authentication is handled via an API key passed in the `x-api-key` header.
    Replace `YOUR_API_KEY` with your actual key when making requests.


    Some useful links:

    - [meCash Documentation](https://docs.me-cash.com/)

    - [Authentication Guide](https://docs.me-cash.com/authentication)
servers:
  - url: https://sandboxapi.me-cash.com
    description: Sandbox Server for Testing
security:
  - ApiKeyAuth: []
tags:
  - name: Wallet
    description: Wallet management operations
  - name: Quote
    description: Currency quote operations
  - name: Payout
    description: Payout operations
  - name: Transaction
    description: Transaction management
  - name: Virtual Account
    description: Virtual account operations for static and dynamic accounts
  - name: Bank
    description: Bank account and list operations
  - name: Ramp
    description: Ramp operations for crypto
  - name: Miscellaneous
    description: Utility and miscellaneous operations
  - name: Collection
    description: Mobile money and wallet funding operations
  - name: Bulk Payout
    description: >-
      Bulk transfer operations for sending to multiple beneficiaries in a single
      request
paths:
  /v1/ramp/quote:
    post:
      tags:
        - Ramp
      summary: Create Quote
      description: >-
        Generates a guaranteed exchange rate and fee estimate for a
        crypto-to-fiat (offramp) or crypto-to-crypto conversion.
      operationId: createRampQuote
      requestBody:
        required: true
        content:
          application/json:
            schema:
              oneOf:
                - $ref: '#/components/schemas/CreateRampOfframpQuoteRequest'
                - $ref: '#/components/schemas/CreateRampCryptoQuoteRequest'
      responses:
        '201':
          description: Quote generated successfully.
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/CreateRampOfframpQuoteResponse'
                  - $ref: '#/components/schemas/CreateRampCryptoQuoteResponse'
        '401':
          $ref: '#/components/responses/PayoutUnauthorized'
        '500':
          $ref: '#/components/responses/PayoutInternalServerError'
components:
  schemas:
    CreateRampOfframpQuoteRequest:
      type: object
      required:
        - paymentChannel
        - source
        - target
      properties:
        paymentChannel:
          type: string
          example: BANK_TRANSFER
        source:
          type: object
          required:
            - amount
            - symbol
            - blockchain
          properties:
            amount:
              type: number
              example: 5
            symbol:
              type: string
              example: USDC
            blockchain:
              type: string
              example: MATIC-AMOY
        target:
          type: object
          required:
            - country
            - currency
          properties:
            country:
              type: string
              example: NG
            currency:
              type: string
              example: NGN
    CreateRampCryptoQuoteRequest:
      type: object
      required:
        - paymentChannel
        - source
        - target
        - recipient
      properties:
        paymentChannel:
          type: string
          example: BANK_TRANSFER
        source:
          type: object
          required:
            - amount
            - symbol
            - blockchain
          properties:
            amount:
              type: number
              example: 2
            symbol:
              type: string
              example: USDC
            blockchain:
              type: string
              example: MATIC-AMOY
        target:
          type: object
          required:
            - symbol
            - blockchain
          properties:
            symbol:
              type: string
              example: USDC
            blockchain:
              type: string
              example: MATIC-AMOY
        feeLevel:
          type: object
          required:
            - type
          properties:
            type:
              type: string
              example: MEDIUM
        recipient:
          type: object
          required:
            - address
          properties:
            address:
              type: string
              example: '0xd62acd62fdb155afaa5d12c6caf01119d413dfd9'
    CreateRampOfframpQuoteResponse:
      type: object
      properties:
        status:
          type: string
          example: success
        message:
          type: string
          example: quote generated successfully
        data:
          type: object
          properties:
            id:
              type: string
              format: uuid
              example: 3f41daaa-029c-44a2-b7c6-ed922a68177b
            source:
              type: object
              properties:
                currency:
                  type: string
                  example: USDC
                symbol:
                  type: string
                  example: USDC
                type:
                  type: string
                  example: CRYPTOCURRENCY
                amount:
                  type: number
                  example: 5
                network:
                  type: object
                  properties:
                    id:
                      type: string
                      format: uuid
                      example: f8fc48ff-81e6-4b5f-9a70-44fb744e3572
                    name:
                      type: string
                      example: USDC
                    blockchain:
                      type: string
                      example: MATIC-AMOY
            target:
              type: object
              properties:
                currency:
                  type: string
                  example: NGN
                country:
                  type: string
                  example: NG
                type:
                  type: string
                  example: FIAT
                paymentChannel:
                  type: string
                  example: BANK_TRANSFER
                amount:
                  type: number
                  example: 5537.1
            rate:
              type: number
              example: 1107.42
            fees:
              type: array
              items:
                type: object
                properties:
                  amount:
                    type: number
                    example: 0.025
                  gas:
                    type: object
                    properties:
                      type:
                        type: string
                        example: MEDIUM
                      total:
                        type: number
                        example: 0.29237925
            summary:
              type: object
              properties:
                total:
                  type: number
                  example: 5.31737925
            expiresInSeconds:
              type: integer
              example: 600
    CreateRampCryptoQuoteResponse:
      type: object
      properties:
        status:
          type: string
          example: success
        message:
          type: string
          example: quote generated successfully
        data:
          type: object
          properties:
            id:
              type: string
              format: uuid
              example: 59628a6c-3d05-406a-ad39-77f92b09137c
            source:
              type: object
              properties:
                currency:
                  type: string
                  example: USDC
                symbol:
                  type: string
                  example: USDC
                blockchain:
                  type: string
                  example: MATIC-AMOY
                type:
                  type: string
                  example: CRYPTOCURRENCY
                amount:
                  type: number
                  example: 2
            target:
              type: object
              properties:
                currency:
                  type: string
                  example: USDC
                symbol:
                  type: string
                  example: USDC
                blockchain:
                  type: string
                  example: MATIC-AMOY
                type:
                  type: string
                  example: CRYPTOCURRENCY
                amount:
                  type: number
                  example: 2
            rate:
              type: number
              example: 1
            fees:
              type: object
              properties:
                amount:
                  type: number
                  example: 0.01
                gas:
                  type: object
                  properties:
                    type:
                      type: string
                      example: LOW
                    amount:
                      type: number
                      example: 0.01875321
            summary:
              type: object
              properties:
                total:
                  type: number
                  example: 2.02875321
            expiresInSeconds:
              type: integer
              example: 600
    PayoutFailedResponse:
      type: object
      properties:
        message:
          type: string
          description: A human-readable error message.
        status:
          type: string
          example: failed
      required:
        - message
        - status
  responses:
    PayoutUnauthorized:
      description: Unauthorized. The provided API key is invalid or missing.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/PayoutFailedResponse'
          example:
            message: Invalid API key
            status: failed
    PayoutInternalServerError:
      description: Internal Server Error. The server failed to process the request.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/PayoutFailedResponse'
          example:
            message: Server failed to process request.
            status: failed
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key

````