> ## Documentation Index
> Fetch the complete documentation index at: https://docs.dollarpe.xyz/llms.txt
> Use this file to discover all available pages before exploring further.

# Create Quotation

> Creates a payin quotation locking in the exchange rate. Returns a quotation ID valid for a fixed time window.

<Prompt description="Create Quotation" actions={["cursor"]}>
  Integrate the DollarPe Create Payin Quotation endpoint into my application.

  Endpoint: POST /payin/quotation
  Base URL: [https://api.dollarpe.in](https://api.dollarpe.in) (production) | [https://sandbox.dollarpe.in](https://sandbox.dollarpe.in) (sandbox)

  Auth headers required on every request:

  * X-API-KEY: your API key
  * X-TIMESTAMP: current Unix time in seconds
  * X-SIGNATURE: Base64(HMAC-SHA256(X-API-KEY + X-TIMESTAMP + sortedJSONBody, apiSecret))

  Payin quotation flow:

  1. POST /payin/quotation → get quotation\_id and locked exchange rate
  2. POST /payin/initiate → create the order using quotation\_id
  3. Customer transfers fiat to the returned bank details
  4. Poll GET /payin/{payin_id} or listen to webhooks for status updates

  Note: If this call returns 400 "EDD required", collect EDD information from the customer and submit it via POST /ren/api/v1/payin/edd/save before retrying.

  Task: Write a typed function that:

  1. Accepts customer\_id, fiat\_currency, crypto\_asset, and amount
  2. Builds the signed auth headers
  3. Calls POST /payin/quotation
  4. Returns quotation\_id, locked rate, and expiry time
  5. Handles 400 (EDD required, customer unverified, unsupported pair) and 500 errors

  Language: TypeScript
</Prompt>

<Tip>
  * Ensure you're using the correct `bank_id` type based on the payment method:
    * **UPI:** `vpa`
    * **IMPS:** `bank_account`
  * For QR-based payments, refer to the [Generate QR](/api-reference-exchange/integration-guides/generate-qr) guide.
  * For **UPI** integrations:
    * Use the `deep_link` field for Android and web flows.
    * Use the `ios_checkout_link` field for iOS devices.
</Tip>

## Error Codes and Messages

| API Status Code | Response                                               | Reason                                                                                                                  |
| --------------- | ------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------- |
| 400             | Customer is unverified                                 | Customer is added but KYC is unverified                                                                                 |
| 400             | Customer is unverified                                 | Customer does not belong to Organization                                                                                |
| 400             | Bank account is unverified                             | Bank account is not added                                                                                               |
| 400             | Bank account is unverified                             | Bank account is added but under processing                                                                              |
| 400             | Bank account is unverified                             | Name mismatch between PAN and Bank account                                                                              |
| 400             | Bank account is unverified                             | Bank account is linked to some other customer                                                                           |
| 400             | Onramp is disabled                                     | Customer is KYC verified using Passport / Driver’s License / Voter ID, but Aadhar is not verified                       |
| 400             | Entered amount is less than minimum transaction amount | Entered amount must be greater than INR 2500                                                                            |
| 400             | Entered amount exceeds maximum transaction amount      | Entered amount must be less than: <br />• INR 500,000# for IMPS <br />• INR 100,000# for UPI                            |
| 400             | AML SCREENING FAILED                                   | Customer appears in sanction lists and the Politically Exposed Persons (PEP) database and/or has material adverse media |
| 400             | EDD required                                           | Suspicious activity or Red Flag Indicator is triggered                                                                  |
| 400             | EDD required                                           | Transaction milestone since last EDD is reached^                                                                        |
| 400             | EDD required                                           | Annual EDD is due or overdue                                                                                            |
| 400             | Daily onramp limit exhausted                           | Daily onramp limit exhausted                                                                                            |
| 500             | Internal Server Error                                  | Internal Server Error                                                                                                   |
| 503             | Service unavailable                                    | Unexpected Error Occurred                                                                                               |


## OpenAPI

````yaml POST /payin/quotation
openapi: 3.1.0
info:
  title: DollarPe API
  description: API for DollarPe - Customer, Payout, and Webhook services
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://sandbox.dollarpe.xyz/pos/api/v1
    description: Payout API Base URL
    variables:
      base_url:
        default: https://sandbox.dollarpe.xyz
  - url: https://sandbox.dollarpe.xyz/cms/api/v1
    description: Customer API Base URL
    variables:
      base_url:
        default: https://sandbox.dollarpe.xyz
security:
  - ApiKeyAuth: []
    TimestampAuth: []
    SignatureAuth: []
tags:
  - name: Customer
    description: Customer related operations
    x-displayName: Customer
    x-traitTag: true
  - name: Payout
    description: Payout related operations
  - name: Webhooks
    description: Webhook related operations
  - name: Widget
    description: Hosted buy/sell widget session initialization
paths:
  /payin/quotation:
    post:
      tags:
        - Payin
      description: Create a quotation for cryptocurrency to fiat conversion
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - asset
                - fiat
                - sending_amount
                - customer_id
                - bank_id
                - payment_method
                - risk_parameters
              properties:
                asset:
                  type: string
                  description: The cryptocurrency asset code
                  example: usdt
                fiat:
                  type: string
                  description: The fiat currency code
                  example: inr
                sending_amount:
                  type: string
                  description: The amount to be sent
                  example: '51'
                customer_id:
                  type: string
                  format: uuid
                  description: Customer's unique identifier
                  example: def8b740-99f9-4cba-bc9e-99de57e927b4
                bank_id:
                  type: string
                  format: uuid
                  description: >-
                    Customer's Bank's unique identifier from which the payin
                    will be made
                  example: 4e6f1b20-a73c-11ec-b909-0242ac120002
                payment_method:
                  type: string
                  example: IMPS
                risk_parameters:
                  type: object
                  properties:
                    ip_address:
                      type: string
                      example: 127.0.0.1
                    device_id:
                      type: string
                    suspicious_activity_report:
                      type: boolean
                      example: false
                    law_enforcement_agency_report:
                      type: boolean
                      example: false
      responses:
        '200':
          description: Quotation created successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: boolean
                    example: true
                  message:
                    type: string
                    example: Success
                  data:
                    type: object
                    properties:
                      id:
                        type: string
                        format: uuid
                        example: 2e104290-07c8-49f1-a5ca-0d27f0078f8a
                      customer_id:
                        type: string
                        format: uuid
                        example: def8b740-99f9-4cba-bc9e-99de57e927b4
                      bank_id:
                        type: string
                        format: uuid
                        example: 4e6f1b20-a73c-11ec-b909-0242ac120002
                      asset:
                        type: string
                        example: USDT
                      fiat:
                        type: string
                        example: INR
                      payment_method:
                        type: string
                        example: IMPS
                      sending_amount:
                        type: number
                        format: float
                        example: 1000
                      rate:
                        type: number
                        format: float
                        example: 91.91
                      receiving_amount:
                        type: number
                        format: float
                        example: 108.8
                      fees:
                        type: object
                        properties:
                          client_fee_fiat:
                            type: number
                            format: float
                            example: 450
                          client_fee_crypto:
                            type: number
                            format: float
                            example: 5
                          dollarpe_fee:
                            type: number
                            format: float
                            example: 450
                          pg_fee:
                            type: number
                            format: float
                            example: 18
                          client_gst_fiat:
                            type: number
                            format: float
                            example: 81
                          client_gst_crypto:
                            type: number
                            format: float
                            example: 0.9
                          dollarpe_gst:
                            type: number
                            format: float
                            example: 81
                          pg_gst:
                            type: number
                            format: float
                            example: 81
                          tds:
                            type: number
                            format: float
                            example: 889.17
                          gross_effective_exchange_rate:
                            type: number
                            format: float
                            example: 88.92
                      deposit_instructions:
                        type: object
                        properties:
                          account_number:
                            type: string
                            example: '1234567890'
                          ifsc:
                            type: string
                            example: '1234567890'
                          account_name:
                            type: string
                            example: Sandbox Technologies Pvt Ltd
                          deep_link:
                            type: string
                            example: upi://pay?pa=testing-payin@ybl&am=1000
                          ios_checkout_link:
                            type: string
                            example: >-
                              https://pay.google.com/upi/deeplink?pa=testing-payin@ybl&am=1000
                      created_at:
                        type: string
                        format: date-time
                        example: '2025-03-08T07:31:11.163005Z'
                      expiry_time:
                        type: string
                        format: date-time
                        example: '2025-03-08T07:36:11.163005Z'
              examples:
                IMPS:
                  summary: Quotation using IMPS
                  value:
                    status: true
                    message: Success
                    data:
                      id: 2e104290-07c8-49f1-a5ca-0d27f0078f8a
                      customer_id: def8b740-99f9-4cba-bc9e-99de57e927b4
                      bank_id: 4e6f1b20-a73c-11ec-b909-0242ac120002
                      asset: USDT
                      fiat: INR
                      payment_method: IMPS
                      sending_amount: 1000
                      rate: 91.91
                      receiving_amount: 108.8
                      fees:
                        client_fee_fiat: 450
                        client_fee_crypto: 5
                        dollarpe_fee: 450
                        pg_fee: 18
                        client_gst_fiat: 81
                        client_gst_crypto: 0.9
                        dollarpe_gst: 81
                        pg_gst: 81
                        tds: 889.17
                        gross_effective_exchange_rate: 88.92
                      deposit_instructions:
                        account_number: '1234567890'
                        ifsc: SBIN0000001
                        account_name: Sandbox Technologies Pvt Ltd
                      created_at: '2025-03-08T07:31:11.163005Z'
                      expiry_time: '2025-03-08T07:36:11.163005Z'
                UPI:
                  summary: Quotation using UPI
                  value:
                    status: true
                    message: Success
                    data:
                      id: 8f888de9-9ac7-42be-9e8e-123456789abc
                      customer_id: def8b740-99f9-4cba-bc9e-99de57e927b4
                      bank_id: 4e6f1b20-a73c-11ec-b909-0242ac120002
                      asset: USDT
                      fiat: INR
                      payment_method: UPI
                      sending_amount: 500
                      rate: 91
                      receiving_amount: 54.9
                      fees:
                        client_fee_fiat: 250
                        client_fee_crypto: 2.5
                        dollarpe_fee: 250
                        pg_fee: 9
                        client_gst_fiat: 45
                        client_gst_crypto: 0.5
                        dollarpe_gst: 45
                        pg_gst: 45
                        tds: 389.17
                        gross_effective_exchange_rate: 88.11
                      deposit_instructions:
                        deep_link: upi://pay?pa=testing-payin@ybl&am=1000
                        ios_checkout_link: >-
                          https://pay.google.com/upi/deeplink?pa=testing-payin@ybl&am=1000
                      created_at: '2025-07-14T16:00:00.000Z'
                      expiry_time: '2025-07-14T16:05:00.000Z'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: Bad Request
                  data:
                    type: 'null'
                  err_code:
                    type: string
                    example: REQ_FIELD_MISSING
                  errors:
                    type: object
                    additionalProperties:
                      type: array
                      items:
                        type: string
                    example:
                      amount:
                        - receiving_amount is required
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: Internal Server Error
                  data:
                    type: 'null'
                  err_code:
                    type: string
                    example: SYS_INTERNAL_ERROR
                  errors:
                    type: string
                    example: Unexpected error occurred. Please try again later.
        '503':
          description: Service unavailable
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: boolean
                    example: false
                  message:
                    type: string
                    example: Service unavailable
                  data:
                    type: 'null'
                  err_code:
                    type: string
                    example: SYS_SERVICE_UNAVAILABLE
                  errors:
                    type: string
                    example: Unexpected error occurred. Please try again later.
      servers:
        - url: https://sandbox.dollarpe.xyz/pis/api/v1
          description: Payin API Base URL
components:
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-KEY
      description: API Key for authentication
    TimestampAuth:
      type: apiKey
      in: header
      name: X-TIMESTAMP
      description: Current timestamp in seconds since epoch
    SignatureAuth:
      type: apiKey
      in: header
      name: X-SIGNATURE
      description: HMAC SHA256 signature of the request encoded in Base64

````