> ## 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 (Offramp)

> Create a quote for converting cryptocurrency to fiat currency

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

## Create Quote (Off Ramp)

This endpoint creates a quote for converting a cryptocurrency (crypto-to-fiat) in an off-ramp scenario.
The data generated includes calculated rates, fees, and applicable transaction limits.

<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 Ramp Assets & Destinations](/ramp-docs/supported-assets) for supported fiat corridors and transaction limits.
</Tip>

***

## Endpoint

**POST** `{{baseURL}}/v1/ramp/quote`

## Header

| **Header**     | **Value**          | **Required** |
| -------------- | ------------------ | ------------ |
| `Content-Type` | `application/json` | Yes          |
| `x-api-key`    | YOUR\_API\_KEY     | Yes          |

***

## Example Request Body

<CodeGroup>
  ```bash cURL theme={null}
  curl --location --request POST '{{baseURL}}/v1/ramp/quote' \
    --header 'x-api-key: YOUR_API_KEY' \
    --header 'Content-Type: application/json' \
    --data '{
      "paymentChannel": "BANK_TRANSFER",
      "source": {
        "amount": 5000,
        "symbol": "USDC",
        "blockchain": "MATIC"
      },
      "target": {
        "country": "NG",
        "currency": "NGN"
      }
    }'
  ```

  ```js JavaScript (fetch) theme={null}
  const quoteDetails = {
    paymentChannel: 'BANK_TRANSFER',
    source: {
      amount: 5000,
      symbol: 'USDC',
      blockchain: 'MATIC'
    },
    target: {
      country: 'NG',
      currency: 'NGN'
    }
  };

  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((data) => console.log(data))
    .catch((error) => console.error(error));
  ```

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

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

  payload = {
      "paymentChannel": "BANK_TRANSFER",
      "source": {
          "amount": 5000,
          "symbol": "USDC",
          "blockchain": "MATIC"
      },
      "target": {
          "country": "NG",
          "currency": "NGN"
      }
  }

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

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

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

  const quoteDetails = {
    paymentChannel: 'BANK_TRANSFER',
    source: {
      amount: 5000,
      symbol: 'USDC',
      blockchain: 'MATIC'
    },
    target: {
      country: 'NG',
      currency: 'NGN'
    }
  };

  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));
  ```
</CodeGroup>

<Callout type="info" emoji="ℹ️">
  Note: Gas fee level defaults to `MEDIUM`.
</Callout>

## Success Response 200 OK

```json theme={null}
{
  "message": "quote successfully created",
  "status": "success",
  "data": {
    "id": "92da6ea0-79fe-4000-971d-xxxxxxxxxx",
    "source": {
      "currency": "USDC",
      "symbol": "USDC",
      "addressRegex": "^(0x)[0-9A-Fa-f]{40}$",
      "amount": 0.12,
      "type": "CRYPTOCURRENCY",
      "network": {
        "id": "24d4025f-46fb-4021-b0c4-xxxxxxxxxx",
        "name": "USDC",
        "blockchain": "MATIC"
      }
    },
    "target": {
      "currency": "NGN",
      "country": "NG",
      "amount": 117.30,
      "type": "FIAT"
    },
    "rate": 0.00102300,
    "fees": {
      "amount": 0.00
    },
    "rules": [
      {
        "category": "LIMIT",
        "appliedCurrency": "NGN",
        "appliedCountry": "NG",
        "transaction": {
          "minimum": 10.00,
          "maximum": 2000000.00
        },
        "invoice": 2000000.00
      }
    ],
    "gasFee": {
      "feeLevel": {
        "type": "MEDIUM",
        "fee": {
          "name": "USDC",
          "symbol": "USDC",
          "amount": 0.02440458
        }
      }
    },
    "summary": {
      "total": 0.12
    }
  }
}
```

### Response Fields Breakdown

| **Field** | **Type** | **Description**                          |
| --------- | -------- | ---------------------------------------- |
| `message` | string   | Result message.                          |
| `status`  | string   | Status of the request (e.g., `success`). |
| `data.id` | string   | Unique identifier for the created quote. |

#### Source Object

| **Field**                        | **Type** | **Description**                                    |
| -------------------------------- | -------- | -------------------------------------------------- |
| `data.source.currency`           | string   | Name of the source currency (e.g., `USDC`).        |
| `data.source.symbol`             | string   | Symbol of the source currency (e.g., `USDC`).      |
| `data.source.addressRegex`       | string   | Regular expression to validate addresses.          |
| `data.source.amount`             | number   | Amount of the source asset.                        |
| `data.source.type`               | string   | Type of the source asset (e.g., `CRYPTOCURRENCY`). |
| `data.source.network.id`         | string   | Unique ID of the source network.                   |
| `data.source.network.name`       | string   | Name of the source network (e.g., `USDC`).         |
| `data.source.network.blockchain` | string   | Blockchain name (e.g., `MATIC`).                   |

#### Target Object

| **Field**              | **Type** | **Description**                                        |
| ---------------------- | -------- | ------------------------------------------------------ |
| `data.target.currency` | string   | Target currency (e.g., `NGN`).                         |
| `data.target.country`  | string   | Country code of the target (e.g., `NG`).               |
| `data.target.amount`   | number   | Amount in the target currency.                         |
| `data.target.type`     | string   | Type of the target asset (`FIAT` or `CRYPTOCURRENCY`). |

#### Rate and Fees

| **Field**          | **Type** | **Description**                        |
| ------------------ | -------- | -------------------------------------- |
| `data.rate`        | number   | Conversion rate from source to target. |
| `data.fees.amount` | number   | Fee amount applied to the transaction. |

#### Rules Array

| **Field**                          | **Type** | **Description**                        |
| ---------------------------------- | -------- | -------------------------------------- |
| `data.rules[].category`            | string   | Rule category (e.g., `LIMIT`).         |
| `data.rules[].appliedCurrency`     | string   | Currency to which the rule is applied. |
| `data.rules[].appliedCountry`      | string   | Country where the rule is applied.     |
| `data.rules[].transaction.minimum` | number   | Minimum allowable transaction amount.  |
| `data.rules[].transaction.maximum` | number   | Maximum allowable transaction amount.  |
| `data.rules[].invoice`             | number   | Invoice amount limit.                  |

#### Gas Fee Object

| **Field**                         | **Type** | **Description**                                    |
| --------------------------------- | -------- | -------------------------------------------------- |
| `data.gasFee.feeLevel.type`       | string   | Selected gas fee level (e.g., `MEDIUM`).           |
| `data.gasFee.feeLevel.fee.name`   | string   | Name of the token used for gas fee (e.g., `USDC`). |
| `data.gasFee.feeLevel.fee.symbol` | string   | Symbol of the gas fee token.                       |
| `data.gasFee.feeLevel.fee.amount` | number   | Gas fee amount in the token.                       |

#### Summary

| **Field**            | **Type** | **Description**                      |
| -------------------- | -------- | ------------------------------------ |
| `data.summary.total` | number   | Total amount to be sent by the user. |

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

````