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

# Create QR deposit

> Creates a QR payin transaction and returns the QR image in base64. Payment confirmation is notified by webhook (transaction_updated).

### Fields by fundingSource

| Field | balance | conversion |
| --- | --- | --- |
| fiatAmount | Required | Optional |
| cryptoAmount | Optional | Required |
| depositAddress | Optional | Required and non-empty |

fundingSource, referenceId and fiatCurrency (BOB) are always required. asset and blockchain are optional in both cases and default to USDC and Polygon. country defaults to BO and qrExpirationTime defaults to 00:15:00.

Optional fields may be omitted, but must pass their validations when provided; null is not accepted. With conversion, fiatAmount is calculated from cryptoAmount, the exchange rate and fees, even if fiatAmount is provided.



## OpenAPI

````yaml /openapi-v3.en.yaml post /v3/transactions/deposit/qr
openapi: 3.0.0
info:
  title: YP API Partner
  description: Integration documentation for YP API partners.
  version: v3
  contact: {}
servers:
  - url: https://sandbox-rampa.mesadepagos.com/api
    description: Sandbox
security: []
tags:
  - name: Auth
    description: ''
  - name: Quotes
    description: ''
  - name: Payin
    description: ''
  - name: Payout
    description: ''
  - name: Wallet
    description: ''
  - name: Queries
    description: ''
  - name: Webhooks
    description: ''
  - name: Fees
    description: ''
  - name: Clients
    description: ''
  - name: Client verifications
    description: Las verificaciones que habilitan a un cliente a cobrar a su nombre.
  - name: Virtual accounts
    description: 'Las cuentas de cobro: las del partner y las de sus clientes.'
paths:
  /v3/transactions/deposit/qr:
    post:
      tags:
        - Payin
      summary: Create QR deposit
      description: >-
        Creates a QR payin transaction and returns the QR image in base64.
        Payment confirmation is notified by webhook (transaction_updated).


        ### Fields by fundingSource


        | Field | balance | conversion |

        | --- | --- | --- |

        | fiatAmount | Required | Optional |

        | cryptoAmount | Optional | Required |

        | depositAddress | Optional | Required and non-empty |


        fundingSource, referenceId and fiatCurrency (BOB) are always required.
        asset and blockchain are optional in both cases and default to USDC and
        Polygon. country defaults to BO and qrExpirationTime defaults to
        00:15:00.


        Optional fields may be omitted, but must pass their validations when
        provided; null is not accepted. With conversion, fiatAmount is
        calculated from cryptoAmount, the exchange rate and fees, even if
        fiatAmount is provided.
      operationId: createDepositQrV3
      parameters: []
      requestBody:
        required: true
        description: Data required to generate the deposit QR code.
        content:
          application/json:
            schema:
              allOf:
                - $ref: '#/components/schemas/CreateDepositQrRequestV3Doc'
              oneOf:
                - type: object
                  properties:
                    fundingSource:
                      type: string
                      enum:
                        - balance
                  required:
                    - fiatAmount
                - type: object
                  properties:
                    fundingSource:
                      type: string
                      enum:
                        - conversion
                    depositAddress:
                      type: string
                      minLength: 1
                  required:
                    - cryptoAmount
                    - depositAddress
            examples:
              balance:
                summary: QR deposit with balance
                value:
                  fundingSource: balance
                  referenceId: ORDER-1001
                  fiatCurrency: BOB
                  fiatAmount: 100
              conversion:
                summary: QR deposit with conversion
                value:
                  fundingSource: conversion
                  referenceId: ORDER-1002
                  fiatCurrency: BOB
                  cryptoAmount: 10
                  depositAddress: '0x0000000000000000000000000000000000000000'
      responses:
        '201':
          description: QR deposit created successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateDepositQrResponseV3Doc'
        '400':
          description: >-
            Invalid request, or a field rejected by the payment provider. Always
            a single 400 with the path of each field.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidationErrorV3ResponseDoc'
              example:
                statusCode: 400
                error: Bad Request
                message:
                  - path:
                      - fiatAmount
                    message: The value was rejected by the payment provider.
        '401':
          description: Missing, invalid, or expired token.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnauthorizedResponseDoc'
        '404':
          description: The payment provider did not find the transaction.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AppErrorResponseDoc'
              example:
                statusCode: 404
                code: TRANSACTION_NOT_FOUND
                message: The transaction was not found.
        '422':
          description: The payment provider permanently rejected the QR.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AppErrorResponseDoc'
              example:
                statusCode: 422
                code: INSUFFICIENT_FUNDS
                message: There are insufficient funds to complete this transaction.
        '500':
          description: Internal error (for example, merchant configuration).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AppErrorResponseDoc'
              example:
                statusCode: 500
                code: INTERNAL_SERVER_ERROR
                message: >-
                  An unexpected internal server error occurred. Please try again
                  later.
        '503':
          description: >-
            The payment provider did not respond (timeout, outage or 5xx error).
            The request can be retried.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AppErrorResponseDoc'
              example:
                statusCode: 503
                code: PAYMENT_PROVIDER_UNAVAILABLE
                message: >-
                  The payment provider is temporarily unavailable. Please try
                  again later.
      security:
        - bearer: []
components:
  schemas:
    CreateDepositQrRequestV3Doc:
      type: object
      properties:
        fundingSource:
          type: string
          enum:
            - balance
            - conversion
          example: balance
          description: Source of funds used for the operation.
        referenceId:
          type: string
          example: ORDER-1001
          description: Partner external reference.
          minLength: 1
          maxLength: 100
        country:
          type: string
          enum:
            - BO
          default: BO
          example: BO
          description: Country where the QR code is generated.
        fiatCurrency:
          type: string
          enum:
            - BOB
          example: BOB
          description: QR fiat currency.
        fiatAmount:
          type: number
          example: 100
          description: >-
            Fiat amount of the QR. Required with fundingSource "balance";
            optional with "conversion". Must be greater than 0 and a multiple of
            0.01.
          minimum: 0
          exclusiveMinimum: true
          multipleOf: 0.01
        cryptoAmount:
          type: number
          example: 10
          description: >-
            Crypto amount to credit. Required with fundingSource "conversion";
            optional with "balance". Must be greater than 0.
          minimum: 0
          exclusiveMinimum: true
        asset:
          type: string
          enum:
            - USDC
            - USDT
          default: USDC
          example: USDC
          description: Crypto asset used for the transaction.
        blockchain:
          type: string
          enum:
            - Polygon
            - Ethereum
            - TRON
          default: Polygon
          example: Polygon
          description: Blockchain of the asset.
        depositAddress:
          type: string
          example: '0x0000000000000000000000000000000000000000'
          description: >-
            Destination crypto address. Required and non-empty with
            fundingSource "conversion"; optional with "balance".
        description:
          type: string
          example: Payment for order 1001
          description: Description displayed for reconciliation.
          maxLength: 60
        qrExpirationTime:
          type: string
          example: '00:15:00'
          default: '00:15:00'
          description: QR code expiration time in HH:MM:SS format.
          pattern: ^([01]\d|2[0-3]):[0-5]\d:[0-5]\d$
      required:
        - fundingSource
        - referenceId
        - fiatCurrency
    CreateDepositQrResponseV3Doc:
      type: object
      properties:
        transactionId:
          type: string
          example: 550e8400-e29b-41d4-a716-446655440000
          description: Unique transaction identifier.
        type:
          type: string
          enum:
            - deposit_express
          example: deposit_express
          description: Created transaction type.
        transactionStatus:
          type: string
          example: pending_transaction
          description: Initial transaction status.
        requestedCryptoAmount:
          type: string
          example: '10'
          description: Requested crypto amount.
        calculatedFiatAmount:
          type: string
          example: '69.60'
          description: Fiat amount calculated for the QR code.
        exchangeRate:
          type: string
          example: '6.96'
          description: Applied exchange rate.
        feeAmount:
          type: string
          example: '0.00'
          description: Fee applied to the operation.
        asset:
          type: string
          example: USDC
          description: Transaction asset.
        country:
          type: string
          example: BO
          description: Country code.
        countryName:
          type: string
          example: Bolivia
          description: Country name.
        qrCodeBase64:
          type: string
          example: iVBORw0KGgoAAAANSUhEUgAA...
          description: Base64-encoded QR image.
        referenceId:
          type: string
          example: ORDER-1001
          description: External reference sent by the partner.
        fiatCurrency:
          type: string
          example: BOB
          description: QR fiat currency.
      required:
        - transactionId
        - type
        - transactionStatus
        - requestedCryptoAmount
        - calculatedFiatAmount
        - exchangeRate
        - asset
        - country
        - countryName
        - qrCodeBase64
        - referenceId
        - fiatCurrency
    ValidationErrorV3ResponseDoc:
      type: object
      properties:
        statusCode:
          type: number
          example: 400
        error:
          type: string
          example: Bad Request
        message:
          description: One item per invalid field.
          type: array
          items:
            $ref: '#/components/schemas/ValidationErrorPathV3Doc'
      required:
        - statusCode
        - error
        - message
    UnauthorizedResponseDoc:
      type: object
      properties:
        statusCode:
          type: number
          example: 401
        message:
          type: string
          example: Unauthorized
      required:
        - statusCode
        - message
    AppErrorResponseDoc:
      type: object
      properties:
        statusCode:
          type: number
          example: 503
        code:
          type: string
          enum:
            - QR_EXPIRED
            - TRANSACTION_REJECTED
            - ACH_PAYMENT_UNAVAILABLE
            - INSUFFICIENT_FUNDS
            - INTERNAL_SERVER_ERROR
            - PAYMENT_PROVIDER_UNAVAILABLE
            - TRANSACTION_NOT_FOUND
            - INTERNAL_ERROR_SERVER
          example: PAYMENT_PROVIDER_UNAVAILABLE
          description: Stable error code the partner can use to handle the case.
        message:
          type: string
          example: >-
            The payment provider is temporarily unavailable. Please try again
            later.
          description: Fixed English message associated with the code.
      required:
        - statusCode
        - code
        - message
    ValidationErrorPathV3Doc:
      type: object
      properties:
        path:
          example:
            - transaction
            - bank_code
          description: Path of the rejected field within the request.
          type: array
          items:
            type: string
        message:
          type: string
          example: The value was rejected by the payment provider.
          description: Reason the field was rejected.
      required:
        - path
        - message
  securitySchemes:
    bearer:
      scheme: bearer
      bearerFormat: JWT
      type: http
      description: JWT obtained from /v2/auth/login or /v3/auth/login

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.